Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/string_payload/_string_payload_input.rs

@@ -1,1 +49,93 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct StringPayloadInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct StringPayloadInput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub payload: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl StringPayloadInput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn payload(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.payload.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl StringPayloadInput {
   16         -
    /// Creates a new builder-style object to manufacture [`StringPayloadInput`](crate::operation::string_payload::StringPayloadInput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`StringPayloadInput`](crate::operation::string_payload::StringPayloadInput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::string_payload::builders::StringPayloadInputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::string_payload::builders::StringPayloadInputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`StringPayloadInput`](crate::operation::string_payload::StringPayloadInput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`StringPayloadInput`](crate::operation::string_payload::StringPayloadInput).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct StringPayloadInputBuilder {
   26         -
    pub(crate) payload: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) payload: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl StringPayloadInputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn payload(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.payload = ::std::option::Option::Some(input.into());
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_payload(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.payload = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_payload(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.payload
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`StringPayloadInput`](crate::operation::string_payload::StringPayloadInput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`StringPayloadInput`](crate::operation::string_payload::StringPayloadInput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(
   45     80   
        self,
   46     81   
    ) -> ::std::result::Result<crate::operation::string_payload::StringPayloadInput, ::aws_smithy_types::error::operation::BuildError> {
   47         -
        ::std::result::Result::Ok(crate::operation::string_payload::StringPayloadInput { payload: self.payload })
          82  +
        /* BuilderGenerator.kt:254 */
          83  +
        ::std::result::Result::Ok(
          84  +
            /* BuilderGenerator.kt:477 */
          85  +
            crate::operation::string_payload::StringPayloadInput {
          86  +
                /* BuilderGenerator.kt:481 */ payload: self.payload,
          87  +
                /* BuilderGenerator.kt:477 */
          88  +
            }, /* BuilderGenerator.kt:254 */
          89  +
        )
          90  +
        /* BuilderGenerator.kt:253 */
   48     91   
    }
          92  +
    /* BuilderGenerator.kt:355 */
   49     93   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/string_payload/_string_payload_output.rs

@@ -1,1 +47,88 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct StringPayloadOutput {
           8  +
pub /* StructureGenerator.kt:201 */ struct StringPayloadOutput {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub payload: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl StringPayloadOutput {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn payload(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   12     21   
        self.payload.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl StringPayloadOutput {
   16         -
    /// Creates a new builder-style object to manufacture [`StringPayloadOutput`](crate::operation::string_payload::StringPayloadOutput).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`StringPayloadOutput`](crate::operation::string_payload::StringPayloadOutput).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::operation::string_payload::builders::StringPayloadOutputBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::operation::string_payload::builders::StringPayloadOutputBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`StringPayloadOutput`](crate::operation::string_payload::StringPayloadOutput).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`StringPayloadOutput`](crate::operation::string_payload::StringPayloadOutput).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct StringPayloadOutputBuilder {
   26         -
    pub(crate) payload: ::std::option::Option<::std::string::String>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) payload: ::std::option::Option<::std::string::String>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl StringPayloadOutputBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn payload(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.payload = ::std::option::Option::Some(input.into());
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_payload(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.payload = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_payload(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.payload
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`StringPayloadOutput`](crate::operation::string_payload::StringPayloadOutput).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`StringPayloadOutput`](crate::operation::string_payload::StringPayloadOutput).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::operation::string_payload::StringPayloadOutput {
   45         -
        crate::operation::string_payload::StringPayloadOutput { payload: self.payload }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::operation::string_payload::StringPayloadOutput {
          82  +
            /* BuilderGenerator.kt:481 */ payload: self.payload,
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/string_payload/builders.rs

@@ -1,1 +124,142 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::operation::string_payload::_string_payload_output::StringPayloadOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::string_payload::_string_payload_input::StringPayloadInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::string_payload::builders::StringPayloadInputBuilder {
    7     10   
    /// Sends a request with this input using the given client.
    8     11   
    pub async fn send_with(
    9     12   
        self,
   10     13   
        client: &crate::Client,
   11     14   
    ) -> ::std::result::Result<
   12     15   
        crate::operation::string_payload::StringPayloadOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::string_payload::StringPayloadError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.string_payload();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `StringPayload`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `StringPayload`.
   24     27   
///
          28  +
/* RustType.kt:516 */
   25     29   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
/* FluentBuilderGenerator.kt:270 */
   26     31   
pub struct StringPayloadFluentBuilder {
   27     32   
    handle: ::std::sync::Arc<crate::client::Handle>,
   28     33   
    inner: crate::operation::string_payload::builders::StringPayloadInputBuilder,
   29     34   
    config_override: ::std::option::Option<crate::config::Builder>,
   30     35   
}
          36  +
/* FluentBuilderGenerator.kt:381 */
   31     37   
impl
   32     38   
    crate::client::customize::internal::CustomizableSend<
   33     39   
        crate::operation::string_payload::StringPayloadOutput,
   34     40   
        crate::operation::string_payload::StringPayloadError,
   35     41   
    > for StringPayloadFluentBuilder
   36     42   
{
   37     43   
    fn send(
   38     44   
        self,
   39     45   
        config_override: crate::config::Builder,
   40     46   
    ) -> crate::client::customize::internal::BoxFuture<
   41     47   
        crate::client::customize::internal::SendResult<
   42     48   
            crate::operation::string_payload::StringPayloadOutput,
   43     49   
            crate::operation::string_payload::StringPayloadError,
   44     50   
        >,
   45     51   
    > {
   46     52   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   47     53   
    }
   48     54   
}
          55  +
/* FluentBuilderGenerator.kt:282 */
   49     56   
impl StringPayloadFluentBuilder {
          57  +
    /* FluentBuilderGenerator.kt:288 */
   50     58   
    /// Creates a new `StringPayloadFluentBuilder`.
   51     59   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   52     60   
        Self {
   53     61   
            handle,
   54     62   
            inner: ::std::default::Default::default(),
   55     63   
            config_override: ::std::option::Option::None,
   56     64   
        }
   57     65   
    }
          66  +
    /* FluentBuilderGenerator.kt:301 */
   58     67   
    /// Access the StringPayload as a reference.
   59     68   
    pub fn as_input(&self) -> &crate::operation::string_payload::builders::StringPayloadInputBuilder {
   60     69   
        &self.inner
   61     70   
    }
          71  +
    /* FluentBuilderGenerator.kt:145 */
   62     72   
    /// Sends the request and returns the response.
   63     73   
    ///
   64     74   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   65     75   
    /// can be matched against.
   66     76   
    ///
   67     77   
    /// By default, any retryable failures will be retried twice. Retry behavior
   68     78   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   69     79   
    /// set when configuring the client.
   70     80   
    pub async fn send(
   71     81   
        self,
   72     82   
    ) -> ::std::result::Result<
   73     83   
        crate::operation::string_payload::StringPayloadOutput,
   74     84   
        ::aws_smithy_runtime_api::client::result::SdkError<
   75     85   
            crate::operation::string_payload::StringPayloadError,
   76     86   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   77     87   
        >,
   78     88   
    > {
   79     89   
        let input = self
   80     90   
            .inner
   81     91   
            .build()
   82     92   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   83     93   
        let runtime_plugins = crate::operation::string_payload::StringPayload::operation_runtime_plugins(
   84     94   
            self.handle.runtime_plugins.clone(),
   85     95   
            &self.handle.conf,
   86     96   
            self.config_override,
   87     97   
        );
   88     98   
        crate::operation::string_payload::StringPayload::orchestrate(&runtime_plugins, input).await
   89     99   
    }
   90    100   
   91    101   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   92    102   
    pub fn customize(
   93    103   
        self,
   94    104   
    ) -> crate::client::customize::CustomizableOperation<
   95    105   
        crate::operation::string_payload::StringPayloadOutput,
   96    106   
        crate::operation::string_payload::StringPayloadError,
   97    107   
        Self,
   98    108   
    > {
   99    109   
        crate::client::customize::CustomizableOperation::new(self)
  100    110   
    }
         111  +
    /* FluentBuilderGenerator.kt:315 */
  101    112   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  102    113   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  103    114   
        self
  104    115   
    }
  105    116   
  106    117   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  107    118   
        self.config_override = config_override;
  108    119   
        self
  109    120   
    }
         121  +
    /* FluentBuilderGenerator.kt:498 */
  110    122   
    #[allow(missing_docs)] // documentation missing in model
         123  +
                           /* FluentBuilderGenerator.kt:500 */
  111    124   
    pub fn payload(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  112    125   
        self.inner = self.inner.payload(input.into());
  113    126   
        self
  114    127   
    }
         128  +
    /* FluentBuilderGenerator.kt:498 */
  115    129   
    #[allow(missing_docs)] // documentation missing in model
         130  +
                           /* FluentBuilderGenerator.kt:500 */
  116    131   
    pub fn set_payload(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  117    132   
        self.inner = self.inner.set_payload(input);
  118    133   
        self
  119    134   
    }
         135  +
    /* FluentBuilderGenerator.kt:518 */
  120    136   
    #[allow(missing_docs)] // documentation missing in model
         137  +
                           /* FluentBuilderGenerator.kt:520 */
  121    138   
    pub fn get_payload(&self) -> &::std::option::Option<::std::string::String> {
  122    139   
        self.inner.get_payload()
  123    140   
    }
         141  +
    /* FluentBuilderGenerator.kt:282 */
  124    142   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/primitives.rs

@@ -1,1 +9,10 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* SmithyTypesPubUseExtra.kt:66 */
    2      3   
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
    3      4   
pub use ::aws_smithy_types::Blob;
    4         -
pub use ::aws_smithy_types::DateTime;
           5  +
/* SmithyTypesPubUseExtra.kt:69 */ pub use ::aws_smithy_types::DateTime;
    5      6   
    6         -
/// Event stream related primitives such as `Message` or `Header`.
           7  +
/// /* ClientRustModule.kt:121 */Event stream related primitives such as `Message` or `Header`.
    7      8   
pub mod event_stream;
    8      9   
    9     10   
pub(crate) mod sealed_enum_unknown;

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/primitives/sealed_enum_unknown.rs

@@ -1,1 +21,29 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Opaque struct used as inner data for the `Unknown` variant defined in enums in
           2  +
/* ClientEnumGenerator.kt:189 */
           3  +
/// /* ClientEnumGenerator.kt:189 */Opaque struct used as inner data for the `Unknown` variant defined in enums in
    4      4   
/// the crate.
    5      5   
///
    6      6   
/// This is not intended to be used directly.
           7  +
/* RustType.kt:516 */
    7      8   
#[non_exhaustive]
           9  +
/* RustType.kt:516 */
    8     10   
#[derive(
    9     11   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
   10     12   
)]
   11         -
pub struct UnknownVariantValue(pub(crate) ::std::string::String);
          13  +
pub /* ClientEnumGenerator.kt:203 */ struct UnknownVariantValue(pub(crate) ::std::string::String);
          14  +
/* ClientEnumGenerator.kt:204 */
   12     15   
impl UnknownVariantValue {
          16  +
    /* ClientEnumGenerator.kt:206 */
   13     17   
    pub(crate) fn as_str(&self) -> &str {
          18  +
        /* ClientEnumGenerator.kt:207 */
   14     19   
        &self.0
          20  +
        /* ClientEnumGenerator.kt:206 */
   15     21   
    }
          22  +
    /* ClientEnumGenerator.kt:204 */
   16     23   
}
          24  +
/* ClientEnumGenerator.kt:210 */
   17     25   
impl ::std::fmt::Display for UnknownVariantValue {
   18     26   
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
   19     27   
        write!(f, "{}", self.0)
   20     28   
    }
   21     29   
}

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

@@ -1,1 +79,82 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ResponseDeserializerGenerator.kt:170 */
    2      3   
pub(crate) fn type_erase_result<O, E>(
    3      4   
    result: ::std::result::Result<O, E>,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::aws_smithy_runtime_api::client::interceptors::context::Output,
    6      7   
    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>,
    7      8   
>
    8      9   
where
    9     10   
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10     11   
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11     12   
{
   12     13   
    result
   13     14   
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14     15   
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15     16   
        .map_err(::std::convert::Into::into)
   16     17   
}
   17     18   
          19  +
/* RestJson.kt:122 */
   18     20   
pub fn parse_http_error_metadata(
   19     21   
    _response_status: u16,
   20     22   
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21     23   
    response_body: &[u8],
   22     24   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23     25   
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   24     26   
}
   25     27   
   26     28   
pub(crate) mod shape_case_insensitive_error_operation;
   27     29   
   28     30   
pub(crate) mod shape_empty_struct_with_content_on_wire_op;
   29     31   
   30     32   
pub(crate) mod shape_enum_query;
   31     33   
   32     34   
pub(crate) mod shape_escaped_string_values;
   33     35   
   34     36   
pub(crate) mod shape_map_with_enum_key_op;
   35     37   
   36     38   
pub(crate) mod shape_null_in_non_sparse;
   37     39   
   38     40   
pub(crate) mod shape_primitive_int_header;
   39     41   
   40     42   
pub(crate) mod shape_primitive_int_op;
   41     43   
   42     44   
pub(crate) mod shape_query_precedence;
   43     45   
   44     46   
pub(crate) mod shape_status_response;
   45     47   
   46     48   
pub(crate) mod shape_string_payload;
   47     49   
   48     50   
pub(crate) mod shape_string_payload_input;
   49     51   
          52  +
/* JsonParserGenerator.kt:227 */
   50     53   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   51     54   
    if data.is_empty() {
   52     55   
        b"{}"
   53     56   
    } else {
   54     57   
        data
   55     58   
    }
   56     59   
}
   57     60   
   58     61   
pub(crate) mod shape_case_insensitive_error;
   59     62   

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_case_insensitive_error.rs

@@ -1,1 +36,59 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:148 */
    2      3   
pub(crate) fn de_case_insensitive_error_json_err(
    3      4   
    value: &[u8],
    4      5   
    mut builder: crate::types::error::builders::CaseInsensitiveErrorBuilder,
    5      6   
) -> ::std::result::Result<crate::types::error::builders::CaseInsensitiveErrorBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
           7  +
    /* JsonParserGenerator.kt:153 */
    6      8   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
    7      9   
    let tokens = &mut tokens_owned;
    8     10   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          11  +
    /* JsonParserGenerator.kt:684 */
    9     12   
    loop {
          13  +
        /* JsonParserGenerator.kt:685 */
   10     14   
        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         -
                    );
          15  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          16  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          17  +
                /* JsonParserGenerator.kt:260 */
          18  +
                match key.to_unescaped()?.as_ref() {
          19  +
                    /* JsonParserGenerator.kt:262 */
          20  +
                    "message" => {
          21  +
                        /* JsonParserGenerator.kt:265 */
          22  +
                        builder = builder.set_message(
          23  +
                            /* JsonParserGenerator.kt:354 */
          24  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          25  +
                                .map(|s|
          26  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          27  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          29  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
          30  +
                        );
          31  +
                        /* JsonParserGenerator.kt:262 */
          32  +
                    }
          33  +
                    /* JsonParserGenerator.kt:290 */
          34  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   19     35   
                }
   20         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   21         -
            },
          36  +
                /* JsonParserGenerator.kt:686 */
          37  +
            }
          38  +
            /* JsonParserGenerator.kt:695 */
   22     39   
            other => {
   23     40   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   24     41   
                    "expected object key or end object, found: {:?}",
   25     42   
                    other
   26     43   
                )))
   27         -
            }
          44  +
            } /* JsonParserGenerator.kt:685 */
   28     45   
        }
          46  +
        /* JsonParserGenerator.kt:684 */
   29     47   
    }
          48  +
    /* JsonParserGenerator.kt:250 */
   30     49   
    if tokens.next().is_some() {
          50  +
        /* JsonParserGenerator.kt:251 */
   31     51   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32     52   
            "found more JSON tokens after completing parsing",
   33     53   
        ));
          54  +
        /* JsonParserGenerator.kt:250 */
   34     55   
    }
          56  +
    /* JsonParserGenerator.kt:163 */
   35     57   
    Ok(builder)
          58  +
    /* JsonParserGenerator.kt:148 */
   36     59   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_case_insensitive_error_operation.rs

@@ -1,1 +70,99 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_case_insensitive_error_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput,
    9     11   
    crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:122 */
   15     21   
    let error_code = match generic.code() {
   16     22   
        Some(code) => code,
   17     23   
        None => return Err(crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::unhandled(generic)),
   18     24   
    };
   19     25   
   20     26   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          27  +
    /* ProtocolParserGenerator.kt:133 */
   21     28   
    Err(match error_code {
          29  +
        /* ProtocolParserGenerator.kt:139 */
   22     30   
        "CaseInsensitiveError" => crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::CaseInsensitiveError({
          31  +
            /* RustType.kt:516 */
   23     32   
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::CaseInsensitiveErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_case_insensitive_error::de_case_insensitive_error_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                output.build()
   31         -
            };
          33  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          34  +
                /* ProtocolParserGenerator.kt:146 */ {
          35  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          36  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::CaseInsensitiveErrorBuilder::default();
          37  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_case_insensitive_error::de_case_insensitive_error_json_err(_response_body, output).map_err(crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::unhandled)?;
          38  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          39  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          40  +
                /* ProtocolParserGenerator.kt:146 */}
          41  +
            /* ProtocolParserGenerator.kt:145 */;
          42  +
            /* ProtocolParserGenerator.kt:170 */
   32     43   
            if tmp.message.is_none() {
   33     44   
                tmp.message = _error_message;
   34     45   
            }
          46  +
            /* ProtocolParserGenerator.kt:179 */
   35     47   
            tmp
          48  +
            /* ProtocolParserGenerator.kt:139 */
   36     49   
        }),
          50  +
        /* ProtocolParserGenerator.kt:139 */
   37     51   
        "ExtraError" => crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::ExtraError({
          52  +
            /* RustType.kt:516 */
   38     53   
            #[allow(unused_mut)]
   39         -
            let mut tmp = {
   40         -
                #[allow(unused_mut)]
   41         -
                let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
   42         -
                output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output)
   43         -
                    .map_err(crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::unhandled)?;
   44         -
                let output = output.meta(generic);
   45         -
                output.build()
   46         -
            };
          54  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          55  +
                /* ProtocolParserGenerator.kt:146 */ {
          56  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          57  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
          58  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output).map_err(crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::unhandled)?;
          59  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          60  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          61  +
                /* ProtocolParserGenerator.kt:146 */}
          62  +
            /* ProtocolParserGenerator.kt:145 */;
          63  +
            /* ProtocolParserGenerator.kt:170 */
   47     64   
            if tmp.message.is_none() {
   48     65   
                tmp.message = _error_message;
   49     66   
            }
          67  +
            /* ProtocolParserGenerator.kt:179 */
   50     68   
            tmp
          69  +
            /* ProtocolParserGenerator.kt:139 */
   51     70   
        }),
   52         -
        _ => crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::generic(generic),
          71  +
        /* ProtocolParserGenerator.kt:182 */
          72  +
        _ => crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError::generic(generic), /* ProtocolParserGenerator.kt:133 */
   53     73   
    })
          74  +
    /* ProtocolParserGenerator.kt:99 */
   54     75   
}
   55     76   
          77  +
/* RustType.kt:516 */
   56     78   
#[allow(clippy::unnecessary_wraps)]
          79  +
/* ProtocolParserGenerator.kt:71 */
   57     80   
pub fn de_case_insensitive_error_operation_http_response(
   58     81   
    _response_status: u16,
   59     82   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   60     83   
    _response_body: &[u8],
   61     84   
) -> std::result::Result<
   62     85   
    crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationOutput,
   63     86   
    crate::operation::case_insensitive_error_operation::CaseInsensitiveErrorOperationError,
   64     87   
> {
          88  +
    /* ProtocolParserGenerator.kt:77 */
   65     89   
    Ok({
          90  +
        /* RustType.kt:516 */
   66     91   
        #[allow(unused_mut)]
          92  +
        /* ProtocolParserGenerator.kt:240 */
   67     93   
        let mut output = crate::operation::case_insensitive_error_operation::builders::CaseInsensitiveErrorOperationOutputBuilder::default();
          94  +
        /* ClientBuilderInstantiator.kt:56 */
   68     95   
        output.build()
          96  +
        /* ProtocolParserGenerator.kt:77 */
   69     97   
    })
          98  +
    /* ProtocolParserGenerator.kt:71 */
   70     99   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_empty_struct.rs

@@ -1,1 +20,33 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_empty_struct<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::EmptyStruct>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          13  +
            /* RustType.kt:516 */
   11     14   
            #[allow(unused_mut)]
          15  +
            /* JsonParserGenerator.kt:526 */
   12     16   
            let mut builder = crate::types::builders::EmptyStructBuilder::default();
          17  +
            /* JsonParserGenerator.kt:682 */
   13     18   
            ::aws_smithy_json::deserialize::token::skip_to_end(tokens)?;
          19  +
            /* JsonParserGenerator.kt:540 */
   14     20   
            Ok(Some(builder.build()))
          21  +
            /* JsonParserGenerator.kt:713 */
   15     22   
        }
   16         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   17         -
            "expected start object or null",
   18         -
        )),
          23  +
        /* JsonParserGenerator.kt:722 */
          24  +
        _ => {
          25  +
            /* JsonParserGenerator.kt:723 */
          26  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          27  +
                "expected start object or null",
          28  +
            ))
          29  +
            /* JsonParserGenerator.kt:722 */
          30  +
        } /* JsonParserGenerator.kt:712 */
   19     31   
    }
          32  +
    /* JsonParserGenerator.kt:516 */
   20     33   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_empty_struct_with_content_on_wire_op.rs

@@ -1,1 +92,138 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_empty_struct_with_content_on_wire_op_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput,
    9     11   
    crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:122 */
   15     21   
    let error_code = match generic.code() {
   16     22   
        Some(code) => code,
   17     23   
        None => return Err(crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::unhandled(generic)),
   18     24   
    };
   19     25   
   20     26   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          27  +
    /* ProtocolParserGenerator.kt:133 */
   21     28   
    Err(match error_code {
          29  +
        /* ProtocolParserGenerator.kt:139 */
   22     30   
        "ExtraError" => crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::ExtraError({
          31  +
            /* RustType.kt:516 */
   23     32   
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                output.build()
   31         -
            };
          33  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          34  +
                /* ProtocolParserGenerator.kt:146 */ {
          35  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          36  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
          37  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output).map_err(crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::unhandled)?;
          38  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          39  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          40  +
                /* ProtocolParserGenerator.kt:146 */}
          41  +
            /* ProtocolParserGenerator.kt:145 */;
          42  +
            /* ProtocolParserGenerator.kt:170 */
   32     43   
            if tmp.message.is_none() {
   33     44   
                tmp.message = _error_message;
   34     45   
            }
          46  +
            /* ProtocolParserGenerator.kt:179 */
   35     47   
            tmp
          48  +
            /* ProtocolParserGenerator.kt:139 */
   36     49   
        }),
   37         -
        _ => crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::generic(generic),
          50  +
        /* ProtocolParserGenerator.kt:182 */
          51  +
        _ => crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::generic(generic), /* ProtocolParserGenerator.kt:133 */
   38     52   
    })
          53  +
    /* ProtocolParserGenerator.kt:99 */
   39     54   
}
   40     55   
          56  +
/* RustType.kt:516 */
   41     57   
#[allow(clippy::unnecessary_wraps)]
          58  +
/* ProtocolParserGenerator.kt:71 */
   42     59   
pub fn de_empty_struct_with_content_on_wire_op_http_response(
   43     60   
    _response_status: u16,
   44     61   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   45     62   
    _response_body: &[u8],
   46     63   
) -> std::result::Result<
   47     64   
    crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpOutput,
   48     65   
    crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError,
   49     66   
> {
          67  +
    /* ProtocolParserGenerator.kt:77 */
   50     68   
    Ok({
          69  +
        /* RustType.kt:516 */
   51     70   
        #[allow(unused_mut)]
          71  +
        /* ProtocolParserGenerator.kt:240 */
   52     72   
        let mut output = crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpOutputBuilder::default();
          73  +
        /* ProtocolParserGenerator.kt:247 */
   53     74   
        output = crate::protocol_serde::shape_empty_struct_with_content_on_wire_op::de_empty_struct_with_content_on_wire_op(_response_body, output)
   54     75   
            .map_err(crate::operation::empty_struct_with_content_on_wire_op::EmptyStructWithContentOnWireOpError::unhandled)?;
          76  +
        /* ClientBuilderInstantiator.kt:56 */
   55     77   
        output.build()
          78  +
        /* ProtocolParserGenerator.kt:77 */
   56     79   
    })
          80  +
    /* ProtocolParserGenerator.kt:71 */
   57     81   
}
   58     82   
          83  +
/* JsonParserGenerator.kt:148 */
   59     84   
pub(crate) fn de_empty_struct_with_content_on_wire_op(
   60     85   
    value: &[u8],
   61     86   
    mut builder: crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpOutputBuilder,
   62     87   
) -> ::std::result::Result<
   63     88   
    crate::operation::empty_struct_with_content_on_wire_op::builders::EmptyStructWithContentOnWireOpOutputBuilder,
   64     89   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   65     90   
> {
          91  +
    /* JsonParserGenerator.kt:153 */
   66     92   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   67     93   
    let tokens = &mut tokens_owned;
   68     94   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          95  +
    /* JsonParserGenerator.kt:684 */
   69     96   
    loop {
          97  +
        /* JsonParserGenerator.kt:685 */
   70     98   
        match tokens.next().transpose()? {
   71         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   72         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   73         -
                "empty" => {
   74         -
                    builder = builder.set_empty(crate::protocol_serde::shape_empty_struct::de_empty_struct(tokens)?);
          99  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
         100  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         101  +
                /* JsonParserGenerator.kt:260 */
         102  +
                match key.to_unescaped()?.as_ref() {
         103  +
                    /* JsonParserGenerator.kt:262 */
         104  +
                    "empty" => {
         105  +
                        /* JsonParserGenerator.kt:265 */
         106  +
                        builder = builder.set_empty(
         107  +
                            /* JsonParserGenerator.kt:544 */
         108  +
                            crate::protocol_serde::shape_empty_struct::de_empty_struct(tokens)?, /* JsonParserGenerator.kt:265 */
         109  +
                        );
         110  +
                        /* JsonParserGenerator.kt:262 */
         111  +
                    }
         112  +
                    /* JsonParserGenerator.kt:290 */
         113  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   75    114   
                }
   76         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   77         -
            },
         115  +
                /* JsonParserGenerator.kt:686 */
         116  +
            }
         117  +
            /* JsonParserGenerator.kt:695 */
   78    118   
            other => {
   79    119   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   80    120   
                    "expected object key or end object, found: {:?}",
   81    121   
                    other
   82    122   
                )))
   83         -
            }
         123  +
            } /* JsonParserGenerator.kt:685 */
   84    124   
        }
         125  +
        /* JsonParserGenerator.kt:684 */
   85    126   
    }
         127  +
    /* JsonParserGenerator.kt:250 */
   86    128   
    if tokens.next().is_some() {
         129  +
        /* JsonParserGenerator.kt:251 */
   87    130   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   88    131   
            "found more JSON tokens after completing parsing",
   89    132   
        ));
         133  +
        /* JsonParserGenerator.kt:250 */
   90    134   
    }
         135  +
    /* JsonParserGenerator.kt:163 */
   91    136   
    Ok(builder)
         137  +
    /* JsonParserGenerator.kt:148 */
   92    138   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_enum_query.rs

@@ -1,1 +63,89 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_enum_query_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::enum_query::EnumQueryOutput, crate::operation::enum_query::EnumQueryError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::enum_query::EnumQueryError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:122 */
   12     18   
    let error_code = match generic.code() {
   13     19   
        Some(code) => code,
   14     20   
        None => return Err(crate::operation::enum_query::EnumQueryError::unhandled(generic)),
   15     21   
    };
   16     22   
   17     23   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          24  +
    /* ProtocolParserGenerator.kt:133 */
   18     25   
    Err(match error_code {
          26  +
        /* ProtocolParserGenerator.kt:139 */
   19     27   
        "ValidationException" => crate::operation::enum_query::EnumQueryError::ValidationError({
          28  +
            /* RustType.kt:516 */
   20     29   
            #[allow(unused_mut)]
   21         -
            let mut tmp = {
   22         -
                #[allow(unused_mut)]
   23         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   24         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::enum_query::EnumQueryError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                crate::serde_util::validation_exception_correct_errors(output)
   28         -
                    .build()
   29         -
                    .map_err(crate::operation::enum_query::EnumQueryError::unhandled)?
   30         -
            };
          30  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          31  +
                /* ProtocolParserGenerator.kt:146 */ {
          32  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          33  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
          34  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output).map_err(crate::operation::enum_query::EnumQueryError::unhandled)?;
          35  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          36  +
                    /* ClientBuilderInstantiator.kt:46 */crate::serde_util::validation_exception_correct_errors(output).build().map_err(crate::operation::enum_query::EnumQueryError::unhandled)?
          37  +
                /* ProtocolParserGenerator.kt:146 */}
          38  +
            /* ProtocolParserGenerator.kt:145 */;
          39  +
            /* ProtocolParserGenerator.kt:179 */
   31     40   
            tmp
          41  +
            /* ProtocolParserGenerator.kt:139 */
   32     42   
        }),
          43  +
        /* ProtocolParserGenerator.kt:139 */
   33     44   
        "ExtraError" => crate::operation::enum_query::EnumQueryError::ExtraError({
          45  +
            /* RustType.kt:516 */
   34     46   
            #[allow(unused_mut)]
   35         -
            let mut tmp = {
   36         -
                #[allow(unused_mut)]
   37         -
                let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
   38         -
                output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output)
   39         -
                    .map_err(crate::operation::enum_query::EnumQueryError::unhandled)?;
   40         -
                let output = output.meta(generic);
   41         -
                output.build()
   42         -
            };
          47  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          48  +
                /* ProtocolParserGenerator.kt:146 */ {
          49  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          50  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
          51  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output).map_err(crate::operation::enum_query::EnumQueryError::unhandled)?;
          52  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          53  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          54  +
                /* ProtocolParserGenerator.kt:146 */}
          55  +
            /* ProtocolParserGenerator.kt:145 */;
          56  +
            /* ProtocolParserGenerator.kt:170 */
   43     57   
            if tmp.message.is_none() {
   44     58   
                tmp.message = _error_message;
   45     59   
            }
          60  +
            /* ProtocolParserGenerator.kt:179 */
   46     61   
            tmp
          62  +
            /* ProtocolParserGenerator.kt:139 */
   47     63   
        }),
   48         -
        _ => crate::operation::enum_query::EnumQueryError::generic(generic),
          64  +
        /* ProtocolParserGenerator.kt:182 */
          65  +
        _ => crate::operation::enum_query::EnumQueryError::generic(generic), /* ProtocolParserGenerator.kt:133 */
   49     66   
    })
          67  +
    /* ProtocolParserGenerator.kt:99 */
   50     68   
}
   51     69   
          70  +
/* RustType.kt:516 */
   52     71   
#[allow(clippy::unnecessary_wraps)]
          72  +
/* ProtocolParserGenerator.kt:71 */
   53     73   
pub fn de_enum_query_http_response(
   54     74   
    _response_status: u16,
   55     75   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   56     76   
    _response_body: &[u8],
   57     77   
) -> std::result::Result<crate::operation::enum_query::EnumQueryOutput, crate::operation::enum_query::EnumQueryError> {
          78  +
    /* ProtocolParserGenerator.kt:77 */
   58     79   
    Ok({
          80  +
        /* RustType.kt:516 */
   59     81   
        #[allow(unused_mut)]
          82  +
        /* ProtocolParserGenerator.kt:240 */
   60     83   
        let mut output = crate::operation::enum_query::builders::EnumQueryOutputBuilder::default();
          84  +
        /* ClientBuilderInstantiator.kt:56 */
   61     85   
        output.build()
          86  +
        /* ProtocolParserGenerator.kt:77 */
   62     87   
    })
          88  +
    /* ProtocolParserGenerator.kt:71 */
   63     89   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_escaped_string_values.rs

@@ -1,1 +127,191 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_escaped_string_values_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::escaped_string_values::EscapedStringValuesOutput,
    9     11   
    crate::operation::escaped_string_values::EscapedStringValuesError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:122 */
   15     21   
    let error_code = match generic.code() {
   16     22   
        Some(code) => code,
   17     23   
        None => return Err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled(generic)),
   18     24   
    };
   19     25   
   20     26   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          27  +
    /* ProtocolParserGenerator.kt:133 */
   21     28   
    Err(match error_code {
          29  +
        /* ProtocolParserGenerator.kt:139 */
   22     30   
        "ValidationException" => crate::operation::escaped_string_values::EscapedStringValuesError::ValidationError({
          31  +
            /* RustType.kt:516 */
   23     32   
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                crate::serde_util::validation_exception_correct_errors(output)
   31         -
                    .build()
   32         -
                    .map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?
   33         -
            };
          33  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          34  +
                /* ProtocolParserGenerator.kt:146 */ {
          35  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          36  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
          37  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output).map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?;
          38  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          39  +
                    /* ClientBuilderInstantiator.kt:46 */crate::serde_util::validation_exception_correct_errors(output).build().map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?
          40  +
                /* ProtocolParserGenerator.kt:146 */}
          41  +
            /* ProtocolParserGenerator.kt:145 */;
          42  +
            /* ProtocolParserGenerator.kt:179 */
   34     43   
            tmp
          44  +
            /* ProtocolParserGenerator.kt:139 */
   35     45   
        }),
          46  +
        /* ProtocolParserGenerator.kt:139 */
   36     47   
        "ExtraError" => crate::operation::escaped_string_values::EscapedStringValuesError::ExtraError({
          48  +
            /* RustType.kt:516 */
   37     49   
            #[allow(unused_mut)]
   38         -
            let mut tmp = {
   39         -
                #[allow(unused_mut)]
   40         -
                let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
   41         -
                output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output)
   42         -
                    .map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?;
   43         -
                let output = output.meta(generic);
   44         -
                output.build()
   45         -
            };
          50  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          51  +
                /* ProtocolParserGenerator.kt:146 */ {
          52  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          53  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
          54  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output).map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?;
          55  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          56  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          57  +
                /* ProtocolParserGenerator.kt:146 */}
          58  +
            /* ProtocolParserGenerator.kt:145 */;
          59  +
            /* ProtocolParserGenerator.kt:170 */
   46     60   
            if tmp.message.is_none() {
   47     61   
                tmp.message = _error_message;
   48     62   
            }
          63  +
            /* ProtocolParserGenerator.kt:179 */
   49     64   
            tmp
          65  +
            /* ProtocolParserGenerator.kt:139 */
   50     66   
        }),
   51         -
        _ => crate::operation::escaped_string_values::EscapedStringValuesError::generic(generic),
          67  +
        /* ProtocolParserGenerator.kt:182 */
          68  +
        _ => crate::operation::escaped_string_values::EscapedStringValuesError::generic(generic), /* ProtocolParserGenerator.kt:133 */
   52     69   
    })
          70  +
    /* ProtocolParserGenerator.kt:99 */
   53     71   
}
   54     72   
          73  +
/* RustType.kt:516 */
   55     74   
#[allow(clippy::unnecessary_wraps)]
          75  +
/* ProtocolParserGenerator.kt:71 */
   56     76   
pub fn de_escaped_string_values_http_response(
   57     77   
    _response_status: u16,
   58     78   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   59     79   
    _response_body: &[u8],
   60     80   
) -> std::result::Result<
   61     81   
    crate::operation::escaped_string_values::EscapedStringValuesOutput,
   62     82   
    crate::operation::escaped_string_values::EscapedStringValuesError,
   63     83   
> {
          84  +
    /* ProtocolParserGenerator.kt:77 */
   64     85   
    Ok({
          86  +
        /* RustType.kt:516 */
   65     87   
        #[allow(unused_mut)]
          88  +
        /* ProtocolParserGenerator.kt:240 */
   66     89   
        let mut output = crate::operation::escaped_string_values::builders::EscapedStringValuesOutputBuilder::default();
          90  +
        /* ProtocolParserGenerator.kt:247 */
   67     91   
        output = crate::protocol_serde::shape_escaped_string_values::de_escaped_string_values(_response_body, output)
   68     92   
            .map_err(crate::operation::escaped_string_values::EscapedStringValuesError::unhandled)?;
          93  +
        /* ClientBuilderInstantiator.kt:56 */
   69     94   
        output.build()
          95  +
        /* ProtocolParserGenerator.kt:77 */
   70     96   
    })
          97  +
    /* ProtocolParserGenerator.kt:71 */
   71     98   
}
   72     99   
         100  +
/* JsonSerializerGenerator.kt:287 */
   73    101   
pub fn ser_escaped_string_values_input(
   74    102   
    input: &crate::operation::escaped_string_values::EscapedStringValuesInput,
   75    103   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
         104  +
    /* JsonSerializerGenerator.kt:291 */
   76    105   
    let mut out = String::new();
         106  +
    /* JsonSerializerGenerator.kt:292 */
   77    107   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
         108  +
    /* JsonSerializerGenerator.kt:375 */
   78    109   
    crate::protocol_serde::shape_escaped_string_values_input::ser_escaped_string_values_input_input(&mut object, input)?;
         110  +
    /* JsonSerializerGenerator.kt:295 */
   79    111   
    object.finish();
         112  +
    /* JsonSerializerGenerator.kt:296 */
   80    113   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
         114  +
    /* JsonSerializerGenerator.kt:287 */
   81    115   
}
   82    116   
         117  +
/* JsonParserGenerator.kt:148 */
   83    118   
pub(crate) fn de_escaped_string_values(
   84    119   
    value: &[u8],
   85    120   
    mut builder: crate::operation::escaped_string_values::builders::EscapedStringValuesOutputBuilder,
   86    121   
) -> ::std::result::Result<
   87    122   
    crate::operation::escaped_string_values::builders::EscapedStringValuesOutputBuilder,
   88    123   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   89    124   
> {
         125  +
    /* JsonParserGenerator.kt:153 */
   90    126   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   91    127   
    let tokens = &mut tokens_owned;
   92    128   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         129  +
    /* JsonParserGenerator.kt:684 */
   93    130   
    loop {
         131  +
        /* JsonParserGenerator.kt:685 */
   94    132   
        match tokens.next().transpose()? {
   95         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   96         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   97         -
                "enum" => {
   98         -
                    builder = builder.set_enum(
   99         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  100         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::EnumWithEscapedChars::from(u.as_ref())))
  101         -
                            .transpose()?,
  102         -
                    );
         133  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
         134  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         135  +
                /* JsonParserGenerator.kt:260 */
         136  +
                match key.to_unescaped()?.as_ref() {
         137  +
                    /* JsonParserGenerator.kt:262 */
         138  +
                    "enum" => {
         139  +
                        /* JsonParserGenerator.kt:265 */
         140  +
                        builder = builder.set_enum(
         141  +
                            /* JsonParserGenerator.kt:354 */
         142  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
         143  +
                                .map(|s|
         144  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         145  +
                                    /* JsonParserGenerator.kt:345 */crate::types::EnumWithEscapedChars::from(u.as_ref())
         146  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         147  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
         148  +
                        );
         149  +
                        /* JsonParserGenerator.kt:262 */
         150  +
                    }
         151  +
                    /* JsonParserGenerator.kt:262 */
         152  +
                    "also\"has\"quotes" => {
         153  +
                        /* JsonParserGenerator.kt:265 */
         154  +
                        builder = builder.set_some_string(
         155  +
                            /* JsonParserGenerator.kt:354 */
         156  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
         157  +
                                .map(|s|
         158  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         159  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         160  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         161  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
         162  +
                        );
         163  +
                        /* JsonParserGenerator.kt:262 */
         164  +
                    }
         165  +
                    /* JsonParserGenerator.kt:290 */
         166  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  103    167   
                }
  104         -
                "also\"has\"quotes" => {
  105         -
                    builder = builder.set_some_string(
  106         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  107         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  108         -
                            .transpose()?,
  109         -
                    );
  110         -
                }
  111         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  112         -
            },
         168  +
                /* JsonParserGenerator.kt:686 */
         169  +
            }
         170  +
            /* JsonParserGenerator.kt:695 */
  113    171   
            other => {
  114    172   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  115    173   
                    "expected object key or end object, found: {:?}",
  116    174   
                    other
  117    175   
                )))
  118         -
            }
         176  +
            } /* JsonParserGenerator.kt:685 */
  119    177   
        }
         178  +
        /* JsonParserGenerator.kt:684 */
  120    179   
    }
         180  +
    /* JsonParserGenerator.kt:250 */
  121    181   
    if tokens.next().is_some() {
         182  +
        /* JsonParserGenerator.kt:251 */
  122    183   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  123    184   
            "found more JSON tokens after completing parsing",
  124    185   
        ));
         186  +
        /* JsonParserGenerator.kt:250 */
  125    187   
    }
         188  +
    /* JsonParserGenerator.kt:163 */
  126    189   
    Ok(builder)
         190  +
    /* JsonParserGenerator.kt:148 */
  127    191   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_escaped_string_values_input.rs

@@ -1,1 +13,22 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_escaped_string_values_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::escaped_string_values::EscapedStringValuesInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.r#enum {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("enum").string(var_1.as_str());
          11  +
        /* JsonSerializerGenerator.kt:382 */
    8     12   
    }
          13  +
    /* JsonSerializerGenerator.kt:382 */
    9     14   
    if let Some(var_2) = &input.some_string {
          15  +
        /* JsonSerializerGenerator.kt:423 */
   10     16   
        object.key("also\"has\"quotes").string(var_2.as_str());
          17  +
        /* JsonSerializerGenerator.kt:382 */
   11     18   
    }
          19  +
    /* JsonSerializerGenerator.kt:372 */
   12     20   
    Ok(())
          21  +
    /* JsonSerializerGenerator.kt:358 */
   13     22   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_extra_error.rs

@@ -1,1 +36,59 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:148 */
    2      3   
pub(crate) fn de_extra_error_json_err(
    3      4   
    value: &[u8],
    4      5   
    mut builder: crate::types::error::builders::ExtraErrorBuilder,
    5      6   
) -> ::std::result::Result<crate::types::error::builders::ExtraErrorBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
           7  +
    /* JsonParserGenerator.kt:153 */
    6      8   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
    7      9   
    let tokens = &mut tokens_owned;
    8     10   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          11  +
    /* JsonParserGenerator.kt:684 */
    9     12   
    loop {
          13  +
        /* JsonParserGenerator.kt:685 */
   10     14   
        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         -
                    );
          15  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          16  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          17  +
                /* JsonParserGenerator.kt:260 */
          18  +
                match key.to_unescaped()?.as_ref() {
          19  +
                    /* JsonParserGenerator.kt:262 */
          20  +
                    "Message" => {
          21  +
                        /* JsonParserGenerator.kt:265 */
          22  +
                        builder = builder.set_message(
          23  +
                            /* JsonParserGenerator.kt:354 */
          24  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          25  +
                                .map(|s|
          26  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          27  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          29  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
          30  +
                        );
          31  +
                        /* JsonParserGenerator.kt:262 */
          32  +
                    }
          33  +
                    /* JsonParserGenerator.kt:290 */
          34  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   19     35   
                }
   20         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   21         -
            },
          36  +
                /* JsonParserGenerator.kt:686 */
          37  +
            }
          38  +
            /* JsonParserGenerator.kt:695 */
   22     39   
            other => {
   23     40   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   24     41   
                    "expected object key or end object, found: {:?}",
   25     42   
                    other
   26     43   
                )))
   27         -
            }
          44  +
            } /* JsonParserGenerator.kt:685 */
   28     45   
        }
          46  +
        /* JsonParserGenerator.kt:684 */
   29     47   
    }
          48  +
    /* JsonParserGenerator.kt:250 */
   30     49   
    if tokens.next().is_some() {
          50  +
        /* JsonParserGenerator.kt:251 */
   31     51   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32     52   
            "found more JSON tokens after completing parsing",
   33     53   
        ));
          54  +
        /* JsonParserGenerator.kt:250 */
   34     55   
    }
          56  +
    /* JsonParserGenerator.kt:163 */
   35     57   
    Ok(builder)
          58  +
    /* JsonParserGenerator.kt:148 */
   36     59   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_map_with_enum_key.rs

@@ -1,1 +41,68 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_map_with_enum_key<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::collections::HashMap<crate::types::StringEnum, ::std::string::String>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          16  +
            /* JsonParserGenerator.kt:469 */
   14     17   
            let mut map = ::std::collections::HashMap::new();
          18  +
            /* JsonParserGenerator.kt:684 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:685 */
   16     21   
                match tokens.next().transpose()? {
   17         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   18     23   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   19         -
                        let key = key.to_unescaped().map(|u| crate::types::StringEnum::from(u.as_ref()))?;
   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()?;
          24  +
                        /* JsonParserGenerator.kt:471 */
          25  +
                        let key =
          26  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          27  +
                                /* JsonParserGenerator.kt:345 */crate::types::StringEnum::from(u.as_ref())
          28  +
                            /* JsonParserGenerator.kt:339 */)
          29  +
                        /* JsonParserGenerator.kt:471 */?;
          30  +
                        /* JsonParserGenerator.kt:474 */
          31  +
                        let value =
          32  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          33  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          34  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                                /* JsonParserGenerator.kt:339 */)
          36  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          37  +
                        /* JsonParserGenerator.kt:474 */;
          38  +
                        /* JsonParserGenerator.kt:491 */
   23     39   
                        if let Some(value) = value {
   24     40   
                            map.insert(key, value);
   25     41   
                        }
          42  +
                        /* JsonParserGenerator.kt:686 */
   26     43   
                    }
          44  +
                    /* JsonParserGenerator.kt:695 */
   27     45   
                    other => {
   28     46   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   29     47   
                            "expected object key or end object, found: {:?}",
   30     48   
                            other
   31     49   
                        )))
   32         -
                    }
          50  +
                    } /* JsonParserGenerator.kt:685 */
   33     51   
                }
          52  +
                /* JsonParserGenerator.kt:684 */
   34     53   
            }
          54  +
            /* JsonParserGenerator.kt:504 */
   35     55   
            Ok(Some(map))
          56  +
            /* JsonParserGenerator.kt:713 */
   36     57   
        }
   37         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   38         -
            "expected start object or null",
   39         -
        )),
          58  +
        /* JsonParserGenerator.kt:722 */
          59  +
        _ => {
          60  +
            /* JsonParserGenerator.kt:723 */
          61  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          62  +
                "expected start object or null",
          63  +
            ))
          64  +
            /* JsonParserGenerator.kt:722 */
          65  +
        } /* JsonParserGenerator.kt:712 */
   40     66   
    }
          67  +
    /* JsonParserGenerator.kt:460 */
   41     68   
}

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/protocol_serde/shape_map_with_enum_key_op.rs

@@ -1,1 +112,168 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_map_with_enum_key_op_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput, crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError>
    8     10   
{
          11  +
    /* RustType.kt:516 */
    9     12   
    #[allow(unused_mut)]
          13  +
    /* ProtocolParserGenerator.kt:106 */
   10     14   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   11     15   
        .map_err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled)?;
          16  +
    /* ProtocolParserGenerator.kt:120 */
   12     17   
    let generic = generic_builder.build();
          18  +
    /* ProtocolParserGenerator.kt:122 */
   13     19   
    let error_code = match generic.code() {
   14     20   
        Some(code) => code,
   15     21   
        None => return Err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled(generic)),
   16     22   
    };
   17     23   
   18     24   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          25  +
    /* ProtocolParserGenerator.kt:133 */
   19     26   
    Err(match error_code {
          27  +
        /* ProtocolParserGenerator.kt:139 */
   20     28   
        "ValidationException" => crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::ValidationError({
          29  +
            /* RustType.kt:516 */
   21     30   
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   25         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled)?;
   27         -
                let output = output.meta(generic);
   28         -
                crate::serde_util::validation_exception_correct_errors(output)
   29         -
                    .build()
   30         -
                    .map_err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled)?
   31         -
            };
          31  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          32  +
                /* ProtocolParserGenerator.kt:146 */ {
          33  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          34  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
          35  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output).map_err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled)?;
          36  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          37  +
                    /* ClientBuilderInstantiator.kt:46 */crate::serde_util::validation_exception_correct_errors(output).build().map_err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled)?
          38  +
                /* ProtocolParserGenerator.kt:146 */}
          39  +
            /* ProtocolParserGenerator.kt:145 */;
          40  +
            /* ProtocolParserGenerator.kt:179 */
   32     41   
            tmp
          42  +
            /* ProtocolParserGenerator.kt:139 */
   33     43   
        }),
          44  +
        /* ProtocolParserGenerator.kt:139 */
   34     45   
        "ExtraError" => crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::ExtraError({
          46  +
            /* RustType.kt:516 */
   35     47   
            #[allow(unused_mut)]
   36         -
            let mut tmp = {
   37         -
                #[allow(unused_mut)]
   38         -
                let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
   39         -
                output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output)
   40         -
                    .map_err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled)?;
   41         -
                let output = output.meta(generic);
   42         -
                output.build()
   43         -
            };
          48  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          49  +
                /* ProtocolParserGenerator.kt:146 */ {
          50  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          51  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ExtraErrorBuilder::default();
          52  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_extra_error::de_extra_error_json_err(_response_body, output).map_err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled)?;
          53  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          54  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          55  +
                /* ProtocolParserGenerator.kt:146 */}
          56  +
            /* ProtocolParserGenerator.kt:145 */;
          57  +
            /* ProtocolParserGenerator.kt:170 */
   44     58   
            if tmp.message.is_none() {
   45     59   
                tmp.message = _error_message;
   46     60   
            }
          61  +
            /* ProtocolParserGenerator.kt:179 */
   47     62   
            tmp
          63  +
            /* ProtocolParserGenerator.kt:139 */
   48     64   
        }),
   49         -
        _ => crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::generic(generic),
          65  +
        /* ProtocolParserGenerator.kt:182 */
          66  +
        _ => crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::generic(generic), /* ProtocolParserGenerator.kt:133 */
   50     67   
    })
          68  +
    /* ProtocolParserGenerator.kt:99 */
   51     69   
}
   52     70   
          71  +
/* RustType.kt:516 */
   53     72   
#[allow(clippy::unnecessary_wraps)]
          73  +
/* ProtocolParserGenerator.kt:71 */
   54     74   
pub fn de_map_with_enum_key_op_http_response(
   55     75   
    _response_status: u16,
   56     76   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   57     77   
    _response_body: &[u8],
   58     78   
) -> std::result::Result<crate::operation::map_with_enum_key_op::MapWithEnumKeyOpOutput, crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError>
   59     79   
{
          80  +
    /* ProtocolParserGenerator.kt:77 */
   60     81   
    Ok({
          82  +
        /* RustType.kt:516 */
   61     83   
        #[allow(unused_mut)]
          84  +
        /* ProtocolParserGenerator.kt:240 */
   62     85   
        let mut output = crate::operation::map_with_enum_key_op::builders::MapWithEnumKeyOpOutputBuilder::default();
          86  +
        /* ProtocolParserGenerator.kt:247 */
   63     87   
        output = crate::protocol_serde::shape_map_with_enum_key_op::de_map_with_enum_key_op(_response_body, output)
   64     88   
            .map_err(crate::operation::map_with_enum_key_op::MapWithEnumKeyOpError::unhandled)?;
          89  +
        /* ClientBuilderInstantiator.kt:56 */
   65     90   
        output.build()
          91  +
        /* ProtocolParserGenerator.kt:77 */
   66     92   
    })
          93  +
    /* ProtocolParserGenerator.kt:71 */
   67     94   
}
   68     95   
          96  +
/* JsonSerializerGenerator.kt:287 */
   69     97   
pub fn ser_map_with_enum_key_op_input(
   70     98   
    input: &crate::operation::map_with_enum_key_op::MapWithEnumKeyOpInput,
   71     99   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
         100  +
    /* JsonSerializerGenerator.kt:291 */
   72    101   
    let mut out = String::new();
         102  +
    /* JsonSerializerGenerator.kt:292 */
   73    103   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
         104  +
    /* JsonSerializerGenerator.kt:375 */
   74    105   
    crate::protocol_serde::shape_map_with_enum_key_op_input::ser_map_with_enum_key_op_input_input(&mut object, input)?;
         106  +
    /* JsonSerializerGenerator.kt:295 */
   75    107   
    object.finish();
         108  +
    /* JsonSerializerGenerator.kt:296 */
   76    109   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
         110  +
    /* JsonSerializerGenerator.kt:287 */
   77    111   
}
   78    112   
         113  +
/* JsonParserGenerator.kt:148 */
   79    114   
pub(crate) fn de_map_with_enum_key_op(
   80    115   
    value: &[u8],
   81    116   
    mut builder: crate::operation::map_with_enum_key_op::builders::MapWithEnumKeyOpOutputBuilder,
   82    117   
) -> ::std::result::Result<
   83    118   
    crate::operation::map_with_enum_key_op::builders::MapWithEnumKeyOpOutputBuilder,
   84    119   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   85    120   
> {
         121  +
    /* JsonParserGenerator.kt:153 */
   86    122   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   87    123   
    let tokens = &mut tokens_owned;
   88    124   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         125  +
    /* JsonParserGenerator.kt:684 */
   89    126   
    loop {
         127  +
        /* JsonParserGenerator.kt:685 */
   90    128   
        match tokens.next().transpose()? {
   91         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   92         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   93         -
                "map" => {
   94         -
                    builder = builder.set_map(crate::protocol_serde::shape_map_with_enum_key::de_map_with_enum_key(tokens)?);
         129  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
         130  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         131  +
                /* JsonParserGenerator.kt:260 */
         132  +
                match key.to_unescaped()?.as_ref() {
         133  +
                    /* JsonParserGenerator.kt:262 */
         134  +
                    "map" => {
         135  +
                        /* JsonParserGenerator.kt:265 */
         136  +
                        builder = builder.set_map(
         137  +
                            /* JsonParserGenerator.kt:509 */
         138  +
                            crate::protocol_serde::shape_map_with_enum_key::de_map_with_enum_key(tokens)?, /* JsonParserGenerator.kt:265 */
         139  +
                        );
         140  +
                        /* JsonParserGenerator.kt:262 */
         141  +
                    }
         142  +
                    /* JsonParserGenerator.kt:290 */
         143  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   95    144   
                }
   96         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   97         -
            },
         145  +
                /* JsonParserGenerator.kt:686 */
         146  +
            }
         147  +
            /* JsonParserGenerator.kt:695 */
   98    148   
            other => {
   99    149   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  100    150   
                    "expected object key or end object, found: {:?}",
  101    151   
                    other
  102    152   
                )))
  103         -
            }
         153  +
            } /* JsonParserGenerator.kt:685 */
  104    154   
        }
         155  +
        /* JsonParserGenerator.kt:684 */
  105    156   
    }
         157  +
    /* JsonParserGenerator.kt:250 */
  106    158   
    if tokens.next().is_some() {
         159  +
        /* JsonParserGenerator.kt:251 */
  107    160   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  108    161   
            "found more JSON tokens after completing parsing",
  109    162   
        ));
         163  +
        /* JsonParserGenerator.kt:250 */
  110    164   
    }
         165  +
    /* JsonParserGenerator.kt:163 */
  111    166   
    Ok(builder)
         167  +
    /* JsonParserGenerator.kt:148 */
  112    168   
}