Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045

Files changed:

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

@@ -1,0 +26,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         -
}

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

@@ -1,0 +49,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_flavor_text<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::FlavorText>, ::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::FlavorTextBuilder::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         -
                        "flavorText" => {
   19         -
                            builder = builder.set_flavor_text(
   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         -
                        "language" => {
   26         -
                            builder = builder.set_language(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::Language::from(u.as_ref())))
   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(crate::serde_util::flavor_text_correct_errors(builder).build().map_err(|err| {
   42         -
                ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err)
   43         -
            })?))
   44         -
        }
   45         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46         -
            "expected start object or null",
   47         -
        )),
   48         -
    }
   49         -
}

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

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_flavor_text_entries<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::FlavorText>>, ::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_flavor_text::de_flavor_text(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-client/rust-client-codegen/src/protocol_serde/shape_get_pokemon_species.rs

@@ -1,0 +110,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_pokemon_species_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::get_pokemon_species::GetPokemonSpeciesOutput, crate::operation::get_pokemon_species::GetPokemonSpeciesError>
    8         -
{
    9         -
    #[allow(unused_mut)]
   10         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   11         -
        .map_err(crate::operation::get_pokemon_species::GetPokemonSpeciesError::unhandled)?;
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::get_pokemon_species::GetPokemonSpeciesError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "ResourceNotFoundException" => crate::operation::get_pokemon_species::GetPokemonSpeciesError::ResourceNotFoundError({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   25         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::get_pokemon_species::GetPokemonSpeciesError::unhandled)?;
   27         -
                let output = output.meta(generic);
   28         -
                crate::serde_util::resource_not_found_exception_correct_errors(output)
   29         -
                    .build()
   30         -
                    .map_err(crate::operation::get_pokemon_species::GetPokemonSpeciesError::unhandled)?
   31         -
            };
   32         -
            tmp
   33         -
        }),
   34         -
        "ValidationException" => crate::operation::get_pokemon_species::GetPokemonSpeciesError::ValidationError({
   35         -
            #[allow(unused_mut)]
   36         -
            let mut tmp = {
   37         -
                #[allow(unused_mut)]
   38         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   39         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   40         -
                    .map_err(crate::operation::get_pokemon_species::GetPokemonSpeciesError::unhandled)?;
   41         -
                let output = output.meta(generic);
   42         -
                crate::serde_util::validation_exception_correct_errors(output)
   43         -
                    .build()
   44         -
                    .map_err(crate::operation::get_pokemon_species::GetPokemonSpeciesError::unhandled)?
   45         -
            };
   46         -
            tmp
   47         -
        }),
   48         -
        _ => crate::operation::get_pokemon_species::GetPokemonSpeciesError::generic(generic),
   49         -
    })
   50         -
}
   51         -
   52         -
#[allow(clippy::unnecessary_wraps)]
   53         -
pub fn de_get_pokemon_species_http_response(
   54         -
    _response_status: u16,
   55         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   56         -
    _response_body: &[u8],
   57         -
) -> std::result::Result<crate::operation::get_pokemon_species::GetPokemonSpeciesOutput, crate::operation::get_pokemon_species::GetPokemonSpeciesError>
   58         -
{
   59         -
    Ok({
   60         -
        #[allow(unused_mut)]
   61         -
        let mut output = crate::operation::get_pokemon_species::builders::GetPokemonSpeciesOutputBuilder::default();
   62         -
        output = crate::protocol_serde::shape_get_pokemon_species::de_get_pokemon_species(_response_body, output)
   63         -
            .map_err(crate::operation::get_pokemon_species::GetPokemonSpeciesError::unhandled)?;
   64         -
        crate::serde_util::get_pokemon_species_output_output_correct_errors(output)
   65         -
            .build()
   66         -
            .map_err(crate::operation::get_pokemon_species::GetPokemonSpeciesError::unhandled)?
   67         -
    })
   68         -
}
   69         -
   70         -
pub(crate) fn de_get_pokemon_species(
   71         -
    _value: &[u8],
   72         -
    mut builder: crate::operation::get_pokemon_species::builders::GetPokemonSpeciesOutputBuilder,
   73         -
) -> ::std::result::Result<
   74         -
    crate::operation::get_pokemon_species::builders::GetPokemonSpeciesOutputBuilder,
   75         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   76         -
> {
   77         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   78         -
    let tokens = &mut tokens_owned;
   79         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   80         -
    loop {
   81         -
        match tokens.next().transpose()? {
   82         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   83         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   84         -
                "flavorTextEntries" => {
   85         -
                    builder =
   86         -
                        builder.set_flavor_text_entries(crate::protocol_serde::shape_flavor_text_entries::de_flavor_text_entries(tokens, _value)?);
   87         -
                }
   88         -
                "name" => {
   89         -
                    builder = builder.set_name(
   90         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   91         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   92         -
                            .transpose()?,
   93         -
                    );
   94         -
                }
   95         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   96         -
            },
   97         -
            other => {
   98         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   99         -
                    "expected object key or end object, found: {other:?}"
  100         -
                )))
  101         -
            }
  102         -
        }
  103         -
    }
  104         -
    if tokens.next().is_some() {
  105         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  106         -
            "found more JSON tokens after completing parsing",
  107         -
        ));
  108         -
    }
  109         -
    Ok(builder)
  110         -
}

tmp-codegen-diff/codegen-client-test/pokemon-service-client/rust-client-codegen/src/protocol_serde/shape_get_server_statistics.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_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(crate) fn de_get_server_statistics(
   39         -
    _value: &[u8],
   40         -
    mut builder: crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder,
   41         -
) -> ::std::result::Result<
   42         -
    crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder,
   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         -
                "calls_count" => {
   53         -
                    builder = builder.set_calls_count(
   54         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   55         -
                            .map(i64::try_from)
   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/pokemon-service-client/rust-client-codegen/src/protocol_serde/shape_get_storage.rs

@@ -1,0 +132,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_storage_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::get_storage::GetStorageOutput, crate::operation::get_storage::GetStorageError> {
    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::get_storage::GetStorageError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::get_storage::GetStorageError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "ResourceNotFoundException" => crate::operation::get_storage::GetStorageError::ResourceNotFoundError({
   20         -
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   24         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::get_storage::GetStorageError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                crate::serde_util::resource_not_found_exception_correct_errors(output)
   28         -
                    .build()
   29         -
                    .map_err(crate::operation::get_storage::GetStorageError::unhandled)?
   30         -
            };
   31         -
            tmp
   32         -
        }),
   33         -
        "StorageAccessNotAuthorized" => crate::operation::get_storage::GetStorageError::StorageAccessNotAuthorized({
   34         -
            #[allow(unused_mut)]
   35         -
            let mut tmp = {
   36         -
                #[allow(unused_mut)]
   37         -
                let mut output = crate::types::error::builders::StorageAccessNotAuthorizedBuilder::default();
   38         -
                output =
   39         -
                    crate::protocol_serde::shape_storage_access_not_authorized::de_storage_access_not_authorized_json_err(_response_body, output)
   40         -
                        .map_err(crate::operation::get_storage::GetStorageError::unhandled)?;
   41         -
                let output = output.meta(generic);
   42         -
                output.build()
   43         -
            };
   44         -
            if tmp.message.is_none() {
   45         -
                tmp.message = _error_message;
   46         -
            }
   47         -
            tmp
   48         -
        }),
   49         -
        "ValidationException" => crate::operation::get_storage::GetStorageError::ValidationError({
   50         -
            #[allow(unused_mut)]
   51         -
            let mut tmp = {
   52         -
                #[allow(unused_mut)]
   53         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   54         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   55         -
                    .map_err(crate::operation::get_storage::GetStorageError::unhandled)?;
   56         -
                let output = output.meta(generic);
   57         -
                crate::serde_util::validation_exception_correct_errors(output)
   58         -
                    .build()
   59         -
                    .map_err(crate::operation::get_storage::GetStorageError::unhandled)?
   60         -
            };
   61         -
            tmp
   62         -
        }),
   63         -
        _ => crate::operation::get_storage::GetStorageError::generic(generic),
   64         -
    })
   65         -
}
   66         -
   67         -
#[allow(clippy::unnecessary_wraps)]
   68         -
pub fn de_get_storage_http_response(
   69         -
    _response_status: u16,
   70         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   71         -
    _response_body: &[u8],
   72         -
) -> std::result::Result<crate::operation::get_storage::GetStorageOutput, crate::operation::get_storage::GetStorageError> {
   73         -
    Ok({
   74         -
        #[allow(unused_mut)]
   75         -
        let mut output = crate::operation::get_storage::builders::GetStorageOutputBuilder::default();
   76         -
        output = crate::protocol_serde::shape_get_storage::de_get_storage(_response_body, output)
   77         -
            .map_err(crate::operation::get_storage::GetStorageError::unhandled)?;
   78         -
        crate::serde_util::get_storage_output_output_correct_errors(output)
   79         -
            .build()
   80         -
            .map_err(crate::operation::get_storage::GetStorageError::unhandled)?
   81         -
    })
   82         -
}
   83         -
   84         -
pub fn ser_get_storage_headers(
   85         -
    input: &crate::operation::get_storage::GetStorageInput,
   86         -
    mut builder: ::http_1x::request::Builder,
   87         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   88         -
    if let ::std::option::Option::Some(inner_1) = &input.passcode {
   89         -
        let formatted_2 = inner_1.as_str();
   90         -
        let header_value = formatted_2;
   91         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
   92         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   93         -
                "passcode",
   94         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   95         -
            )
   96         -
        })?;
   97         -
        builder = builder.header("passcode", header_value);
   98         -
    }
   99         -
    Ok(builder)
  100         -
}
  101         -
  102         -
pub(crate) fn de_get_storage(
  103         -
    _value: &[u8],
  104         -
    mut builder: crate::operation::get_storage::builders::GetStorageOutputBuilder,
  105         -
) -> ::std::result::Result<crate::operation::get_storage::builders::GetStorageOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
  106         -
{
  107         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  108         -
    let tokens = &mut tokens_owned;
  109         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  110         -
    loop {
  111         -
        match tokens.next().transpose()? {
  112         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  113         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  114         -
                "collection" => {
  115         -
                    builder = builder.set_collection(crate::protocol_serde::shape_species_collection::de_species_collection(tokens, _value)?);
  116         -
                }
  117         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  118         -
            },
  119         -
            other => {
  120         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  121         -
                    "expected object key or end object, found: {other:?}"
  122         -
                )))
  123         -
            }
  124         -
        }
  125         -
    }
  126         -
    if tokens.next().is_some() {
  127         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  128         -
            "found more JSON tokens after completing parsing",
  129         -
        ));
  130         -
    }
  131         -
    Ok(builder)
  132         -
}

tmp-codegen-diff/codegen-client-test/pokemon-service-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-client/rust-client-codegen/src/protocol_serde/shape_resource_not_found_exception.rs

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

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

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

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

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

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

@@ -1,1 +39,0 @@
   14     14   
    let _response_headers = response.headers();
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut output = crate::operation::stream_pokemon_radio::builders::StreamPokemonRadioOutputBuilder::default();
   18     18   
        output = output.set_data(Some(crate::protocol_serde::shape_stream_pokemon_radio_output::de_data_payload(
   19     19   
            _response_body,
   20     20   
        )?));
   21     21   
        output.build()
   22     22   
    })
   23     23   
}
   24         -
   25         -
#[allow(clippy::unnecessary_wraps)]
   26         -
pub fn de_stream_pokemon_radio_http_error(
   27         -
    _response_status: u16,
   28         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   29         -
    _response_body: &[u8],
   30         -
) -> std::result::Result<
   31         -
    crate::operation::stream_pokemon_radio::StreamPokemonRadioOutput,
   32         -
    crate::operation::stream_pokemon_radio::StreamPokemonRadioError,
   33         -
> {
   34         -
    #[allow(unused_mut)]
   35         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   36         -
        .map_err(crate::operation::stream_pokemon_radio::StreamPokemonRadioError::unhandled)?;
   37         -
    let generic = generic_builder.build();
   38         -
    Err(crate::operation::stream_pokemon_radio::StreamPokemonRadioError::generic(generic))
   39         -
}

tmp-codegen-diff/codegen-client-test/pokemon-service-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-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-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-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-client/rust-client-codegen/src/serde_util.rs

@@ -1,1 +88,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 resource_not_found_exception_correct_errors(
   30         -
    mut builder: crate::types::error::builders::ResourceNotFoundErrorBuilder,
   31         -
) -> crate::types::error::builders::ResourceNotFoundErrorBuilder {
   32         -
    if builder.message.is_none() {
   33         -
        builder.message = Some(Default::default())
   34         -
    }
   35         -
    builder
   36         -
}
   37         -
   38         -
pub(crate) fn get_pokemon_species_output_output_correct_errors(
   39         -
    mut builder: crate::operation::get_pokemon_species::builders::GetPokemonSpeciesOutputBuilder,
   40         -
) -> crate::operation::get_pokemon_species::builders::GetPokemonSpeciesOutputBuilder {
   41         -
    if builder.name.is_none() {
   42         -
        builder.name = Some(Default::default())
   43         -
    }
   44         -
    if builder.flavor_text_entries.is_none() {
   45         -
        builder.flavor_text_entries = Some(Default::default())
   46         -
    }
   47         -
    builder
   48         -
}
   49         -
   50         -
pub(crate) fn get_server_statistics_output_output_correct_errors(
   51         -
    mut builder: crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder,
   52         -
) -> crate::operation::get_server_statistics::builders::GetServerStatisticsOutputBuilder {
   53         -
    if builder.calls_count.is_none() {
   54         -
        builder.calls_count = Some(Default::default())
   55         -
    }
   56         -
    builder
   57         -
}
   58         -
   59         -
pub(crate) fn get_storage_output_output_correct_errors(
   60         -
    mut builder: crate::operation::get_storage::builders::GetStorageOutputBuilder,
   61         -
) -> crate::operation::get_storage::builders::GetStorageOutputBuilder {
   62         -
    if builder.collection.is_none() {
   63         -
        builder.collection = Some(Default::default())
   64         -
    }
   65         -
    builder
   66         -
}
   67         -
   68         -
pub(crate) fn flavor_text_correct_errors(mut builder: crate::types::builders::FlavorTextBuilder) -> crate::types::builders::FlavorTextBuilder {
   69         -
    if builder.flavor_text.is_none() {
   70         -
        builder.flavor_text = Some(Default::default())
   71         -
    }
   72         -
    if builder.language.is_none() {
   73         -
        builder.language = "no value was set".parse::<crate::types::Language>().ok()
   74         -
    }
   75         -
    builder
   76         -
}
   77         -
   78         -
pub(crate) fn validation_exception_field_correct_errors(
   79         -
    mut builder: crate::types::builders::ValidationExceptionFieldBuilder,
   80         -
) -> crate::types::builders::ValidationExceptionFieldBuilder {
   81         -
    if builder.path.is_none() {
   82         -
        builder.path = Some(Default::default())
   83         -
    }
   84         -
    if builder.message.is_none() {
   85         -
        builder.message = Some(Default::default())
   86         -
    }
   87         -
    builder
   88         -
}