Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/operation/start_snapshot/builders.rs

@@ -1,1 +277,313 @@
    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::start_snapshot::_start_snapshot_output::StartSnapshotOutputBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::operation::start_snapshot::_start_snapshot_input::StartSnapshotInputBuilder;
    5      7   
           8  +
/* FluentBuilderGenerator.kt:408 */
    6      9   
impl crate::operation::start_snapshot::builders::StartSnapshotInputBuilder {
    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::start_snapshot::StartSnapshotOutput,
   13     16   
        ::aws_smithy_runtime_api::client::result::SdkError<
   14     17   
            crate::operation::start_snapshot::StartSnapshotError,
   15     18   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   16     19   
        >,
   17     20   
    > {
   18     21   
        let mut fluent_builder = client.start_snapshot();
   19     22   
        fluent_builder.inner = self;
   20     23   
        fluent_builder.send().await
   21     24   
    }
   22     25   
}
   23         -
/// Fluent builder constructing a request to `StartSnapshot`.
          26  +
/// /* FluentBuilderGenerator.kt:129 */Fluent builder constructing a request to `StartSnapshot`.
   24     27   
///
   25         -
/// <p>Creates a new Amazon EBS snapshot. The new snapshot enters the <code>pending</code> state after the request completes.</p>
          28  +
/// /* FluentBuilderGenerator.kt:130 */<p>Creates a new Amazon EBS snapshot. The new snapshot enters the <code>pending</code> state after the request completes.</p>
   26     29   
/// <p>After creating the snapshot, use <a href="https://docs.aws.amazon.com/ebs/latest/APIReference/API_PutSnapshotBlock.html"> PutSnapshotBlock</a> to write blocks of data to the snapshot.</p>
          30  +
/* RustType.kt:516 */
   27     31   
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          32  +
/* FluentBuilderGenerator.kt:270 */
   28     33   
pub struct StartSnapshotFluentBuilder {
   29     34   
    handle: ::std::sync::Arc<crate::client::Handle>,
   30     35   
    inner: crate::operation::start_snapshot::builders::StartSnapshotInputBuilder,
   31     36   
    config_override: ::std::option::Option<crate::config::Builder>,
   32     37   
}
          38  +
/* FluentBuilderGenerator.kt:381 */
   33     39   
impl
   34     40   
    crate::client::customize::internal::CustomizableSend<
   35     41   
        crate::operation::start_snapshot::StartSnapshotOutput,
   36     42   
        crate::operation::start_snapshot::StartSnapshotError,
   37     43   
    > for StartSnapshotFluentBuilder
   38     44   
{
   39     45   
    fn send(
   40     46   
        self,
   41     47   
        config_override: crate::config::Builder,
   42     48   
    ) -> crate::client::customize::internal::BoxFuture<
   43     49   
        crate::client::customize::internal::SendResult<
   44     50   
            crate::operation::start_snapshot::StartSnapshotOutput,
   45     51   
            crate::operation::start_snapshot::StartSnapshotError,
   46     52   
        >,
   47     53   
    > {
   48     54   
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
   49     55   
    }
   50     56   
}
          57  +
/* FluentBuilderGenerator.kt:282 */
   51     58   
impl StartSnapshotFluentBuilder {
          59  +
    /* FluentBuilderGenerator.kt:288 */
   52     60   
    /// Creates a new `StartSnapshotFluentBuilder`.
   53     61   
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
   54     62   
        Self {
   55     63   
            handle,
   56     64   
            inner: ::std::default::Default::default(),
   57     65   
            config_override: ::std::option::Option::None,
   58     66   
        }
   59     67   
    }
          68  +
    /* FluentBuilderGenerator.kt:301 */
   60     69   
    /// Access the StartSnapshot as a reference.
   61     70   
    pub fn as_input(&self) -> &crate::operation::start_snapshot::builders::StartSnapshotInputBuilder {
   62     71   
        &self.inner
   63     72   
    }
          73  +
    /* FluentBuilderGenerator.kt:145 */
   64     74   
    /// Sends the request and returns the response.
   65     75   
    ///
   66     76   
    /// If an error occurs, an `SdkError` will be returned with additional details that
   67     77   
    /// can be matched against.
   68     78   
    ///
   69     79   
    /// By default, any retryable failures will be retried twice. Retry behavior
   70     80   
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
   71     81   
    /// set when configuring the client.
   72     82   
    pub async fn send(
   73     83   
        self,
   74     84   
    ) -> ::std::result::Result<
   75     85   
        crate::operation::start_snapshot::StartSnapshotOutput,
   76     86   
        ::aws_smithy_runtime_api::client::result::SdkError<
   77     87   
            crate::operation::start_snapshot::StartSnapshotError,
   78     88   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   79     89   
        >,
   80     90   
    > {
   81     91   
        let input = self
   82     92   
            .inner
   83     93   
            .build()
   84     94   
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
   85     95   
        let runtime_plugins = crate::operation::start_snapshot::StartSnapshot::operation_runtime_plugins(
   86     96   
            self.handle.runtime_plugins.clone(),
   87     97   
            &self.handle.conf,
   88     98   
            self.config_override,
   89     99   
        );
   90    100   
        crate::operation::start_snapshot::StartSnapshot::orchestrate(&runtime_plugins, input).await
   91    101   
    }
   92    102   
   93    103   
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
   94    104   
    pub fn customize(
   95    105   
        self,
   96    106   
    ) -> crate::client::customize::CustomizableOperation<
   97    107   
        crate::operation::start_snapshot::StartSnapshotOutput,
   98    108   
        crate::operation::start_snapshot::StartSnapshotError,
   99    109   
        Self,
  100    110   
    > {
  101    111   
        crate::client::customize::CustomizableOperation::new(self)
  102    112   
    }
         113  +
    /* FluentBuilderGenerator.kt:315 */
  103    114   
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
  104    115   
        self.set_config_override(::std::option::Option::Some(config_override.into()));
  105    116   
        self
  106    117   
    }
  107    118   
  108    119   
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
  109    120   
        self.config_override = config_override;
  110    121   
        self
  111    122   
    }
  112         -
    /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
         123  +
    /// /* FluentBuilderGenerator.kt:498 */<p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
  113    124   
    /// <ul>
  114    125   
    /// <li>
  115    126   
    /// <p>No blocks are written to the snapshot.</p></li>
  116    127   
    /// <li>
  117    128   
    /// <p>The snapshot is not completed after writing the last block of data.</p></li>
  118    129   
    /// </ul>
  119    130   
    /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
         131  +
    /* FluentBuilderGenerator.kt:500 */
  120    132   
    pub fn timeout(mut self, input: i32) -> Self {
  121    133   
        self.inner = self.inner.timeout(input);
  122    134   
        self
  123    135   
    }
  124         -
    /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
         136  +
    /// /* FluentBuilderGenerator.kt:498 */<p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
  125    137   
    /// <ul>
  126    138   
    /// <li>
  127    139   
    /// <p>No blocks are written to the snapshot.</p></li>
  128    140   
    /// <li>
  129    141   
    /// <p>The snapshot is not completed after writing the last block of data.</p></li>
  130    142   
    /// </ul>
  131    143   
    /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
         144  +
    /* FluentBuilderGenerator.kt:500 */
  132    145   
    pub fn set_timeout(mut self, input: ::std::option::Option<i32>) -> Self {
  133    146   
        self.inner = self.inner.set_timeout(input);
  134    147   
        self
  135    148   
    }
  136         -
    /// <p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
         149  +
    /// /* FluentBuilderGenerator.kt:518 */<p>The amount of time (in minutes) after which the snapshot is automatically cancelled if:</p>
  137    150   
    /// <ul>
  138    151   
    /// <li>
  139    152   
    /// <p>No blocks are written to the snapshot.</p></li>
  140    153   
    /// <li>
  141    154   
    /// <p>The snapshot is not completed after writing the last block of data.</p></li>
  142    155   
    /// </ul>
  143    156   
    /// <p>If no value is specified, the timeout defaults to <code>60</code> minutes.</p>
         157  +
    /* FluentBuilderGenerator.kt:520 */
  144    158   
    pub fn get_timeout(&self) -> &::std::option::Option<i32> {
  145    159   
        self.inner.get_timeout()
  146    160   
    }
  147         -
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
         161  +
    /// /* FluentBuilderGenerator.kt:498 */<p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
  148    162   
    /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
  149    163   
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html"> Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
         164  +
    /* FluentBuilderGenerator.kt:500 */
  150    165   
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  151    166   
        self.inner = self.inner.client_token(input.into());
  152    167   
        self
  153    168   
    }
  154         -
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
         169  +
    /// /* FluentBuilderGenerator.kt:498 */<p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
  155    170   
    /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
  156    171   
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html"> Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
         172  +
    /* FluentBuilderGenerator.kt:500 */
  157    173   
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  158    174   
        self.inner = self.inner.set_client_token(input);
  159    175   
        self
  160    176   
    }
  161         -
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
         177  +
    /// /* FluentBuilderGenerator.kt:518 */<p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
  162    178   
    /// <p>If you do not specify a client token, one is automatically generated by the AWS SDK.</p>
  163    179   
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html"> Idempotency for StartSnapshot API</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
         180  +
    /* FluentBuilderGenerator.kt:520 */
  164    181   
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
  165    182   
        self.inner.get_client_token()
  166    183   
    }
  167         -
    /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
         184  +
    /// /* FluentBuilderGenerator.kt:498 */<p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
         185  +
    /* FluentBuilderGenerator.kt:500 */
  168    186   
    pub fn volume_size(mut self, input: i64) -> Self {
  169    187   
        self.inner = self.inner.volume_size(input);
  170    188   
        self
  171    189   
    }
  172         -
    /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
         190  +
    /// /* FluentBuilderGenerator.kt:498 */<p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
         191  +
    /* FluentBuilderGenerator.kt:500 */
  173    192   
    pub fn set_volume_size(mut self, input: ::std::option::Option<i64>) -> Self {
  174    193   
        self.inner = self.inner.set_volume_size(input);
  175    194   
        self
  176    195   
    }
  177         -
    /// <p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
         196  +
    /// /* FluentBuilderGenerator.kt:518 */<p>The size of the volume, in GiB. The maximum size is <code>16384</code> GiB (16 TiB).</p>
         197  +
    /* FluentBuilderGenerator.kt:520 */
  178    198   
    pub fn get_volume_size(&self) -> &::std::option::Option<i64> {
  179    199   
        self.inner.get_volume_size()
  180    200   
    }
  181         -
    ///
         201  +
    /// /* FluentBuilderGenerator.kt:436 */
  182    202   
    /// Appends an item to `Tags`.
  183    203   
    ///
  184    204   
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
  185    205   
    ///
  186         -
    /// <p>The tags to apply to the snapshot.</p>
         206  +
    /// /* FluentBuilderGenerator.kt:443 */<p>The tags to apply to the snapshot.</p>
         207  +
    /* FluentBuilderGenerator.kt:446 */
  187    208   
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
  188    209   
        self.inner = self.inner.tags(input);
  189    210   
        self
  190    211   
    }
  191         -
    /// <p>The tags to apply to the snapshot.</p>
         212  +
    /// /* FluentBuilderGenerator.kt:498 */<p>The tags to apply to the snapshot.</p>
         213  +
    /* FluentBuilderGenerator.kt:500 */
  192    214   
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
  193    215   
        self.inner = self.inner.set_tags(input);
  194    216   
        self
  195    217   
    }
  196         -
    /// <p>The tags to apply to the snapshot.</p>
         218  +
    /// /* FluentBuilderGenerator.kt:518 */<p>The tags to apply to the snapshot.</p>
         219  +
    /* FluentBuilderGenerator.kt:520 */
  197    220   
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
  198    221   
        self.inner.get_tags()
  199    222   
    }
  200         -
    /// <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
         223  +
    /// /* FluentBuilderGenerator.kt:498 */<p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
  201    224   
    /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
  202    225   
    /// <p>If you specify <code>true</code>, the snapshot is encrypted using the CMK specified using the <b>KmsKeyArn</b> parameter. If no value is specified for <b>KmsKeyArn</b>, the default CMK for your account is used. If no default CMK has been specified for your account, the AWS managed CMK is used. To set a default CMK for your account, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html"> ModifyEbsDefaultKmsKeyId</a>.</p>
  203    226   
    /// <p>If your account is enabled for encryption by default, you cannot set this parameter to <code>false</code>. In this case, you can omit this parameter.</p>
  204    227   
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
         228  +
    /* FluentBuilderGenerator.kt:500 */
  205    229   
    pub fn encrypted(mut self, input: bool) -> Self {
  206    230   
        self.inner = self.inner.encrypted(input);
  207    231   
        self
  208    232   
    }
  209         -
    /// <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
         233  +
    /// /* FluentBuilderGenerator.kt:498 */<p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
  210    234   
    /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
  211    235   
    /// <p>If you specify <code>true</code>, the snapshot is encrypted using the CMK specified using the <b>KmsKeyArn</b> parameter. If no value is specified for <b>KmsKeyArn</b>, the default CMK for your account is used. If no default CMK has been specified for your account, the AWS managed CMK is used. To set a default CMK for your account, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html"> ModifyEbsDefaultKmsKeyId</a>.</p>
  212    236   
    /// <p>If your account is enabled for encryption by default, you cannot set this parameter to <code>false</code>. In this case, you can omit this parameter.</p>
  213    237   
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
         238  +
    /* FluentBuilderGenerator.kt:500 */
  214    239   
    pub fn set_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
  215    240   
        self.inner = self.inner.set_encrypted(input);
  216    241   
        self
  217    242   
    }
  218         -
    /// <p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
         243  +
    /// /* FluentBuilderGenerator.kt:518 */<p>Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify <code>true</code>. To create an unencrypted snapshot, omit this parameter.</p>
  219    244   
    /// <p>If you specify a value for <b>ParentSnapshotId</b>, omit this parameter.</p>
  220    245   
    /// <p>If you specify <code>true</code>, the snapshot is encrypted using the CMK specified using the <b>KmsKeyArn</b> parameter. If no value is specified for <b>KmsKeyArn</b>, the default CMK for your account is used. If no default CMK has been specified for your account, the AWS managed CMK is used. To set a default CMK for your account, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html"> ModifyEbsDefaultKmsKeyId</a>.</p>
  221    246   
    /// <p>If your account is enabled for encryption by default, you cannot set this parameter to <code>false</code>. In this case, you can omit this parameter.</p>
  222    247   
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
         248  +
    /* FluentBuilderGenerator.kt:520 */
  223    249   
    pub fn get_encrypted(&self) -> &::std::option::Option<bool> {
  224    250   
        self.inner.get_encrypted()
  225    251   
    }
  226         -
    /// <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK, the default AWS managed CMK is used.</p>
         252  +
    /// /* FluentBuilderGenerator.kt:498 */<p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK, the default AWS managed CMK is used.</p>
  227    253   
    /// <p>If you specify a <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted using the same CMK that was used to encrypt the parent snapshot.</p>
  228    254   
    /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
         255  +
    /* FluentBuilderGenerator.kt:500 */
  229    256   
    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  230    257   
        self.inner = self.inner.kms_key_arn(input.into());
  231    258   
        self
  232    259   
    }
  233         -
    /// <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK, the default AWS managed CMK is used.</p>
         260  +
    /// /* FluentBuilderGenerator.kt:498 */<p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK, the default AWS managed CMK is used.</p>
  234    261   
    /// <p>If you specify a <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted using the same CMK that was used to encrypt the parent snapshot.</p>
  235    262   
    /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
         263  +
    /* FluentBuilderGenerator.kt:500 */
  236    264   
    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  237    265   
        self.inner = self.inner.set_kms_key_arn(input);
  238    266   
        self
  239    267   
    }
  240         -
    /// <p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK, the default AWS managed CMK is used.</p>
         268  +
    /// /* FluentBuilderGenerator.kt:518 */<p>The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK, the default AWS managed CMK is used.</p>
  241    269   
    /// <p>If you specify a <b>ParentSnapshotId</b>, omit this parameter; the snapshot will be encrypted using the same CMK that was used to encrypt the parent snapshot.</p>
  242    270   
    /// <p>If <b>Encrypted</b> is set to <code>true</code>, you must specify a CMK ARN.</p>
         271  +
    /* FluentBuilderGenerator.kt:520 */
  243    272   
    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
  244    273   
        self.inner.get_kms_key_arn()
  245    274   
    }
  246         -
    /// <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
         275  +
    /// /* FluentBuilderGenerator.kt:498 */<p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
  247    276   
    /// <p>If your account is enabled for encryption by default, you cannot use an unencrypted snapshot as a parent snapshot. You must first create an encrypted copy of the parent snapshot using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
         277  +
    /* FluentBuilderGenerator.kt:500 */
  248    278   
    pub fn parent_snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  249    279   
        self.inner = self.inner.parent_snapshot_id(input.into());
  250    280   
        self
  251    281   
    }
  252         -
    /// <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
         282  +
    /// /* FluentBuilderGenerator.kt:498 */<p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
  253    283   
    /// <p>If your account is enabled for encryption by default, you cannot use an unencrypted snapshot as a parent snapshot. You must first create an encrypted copy of the parent snapshot using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
         284  +
    /* FluentBuilderGenerator.kt:500 */
  254    285   
    pub fn set_parent_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  255    286   
        self.inner = self.inner.set_parent_snapshot_id(input);
  256    287   
        self
  257    288   
    }
  258         -
    /// <p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
         289  +
    /// /* FluentBuilderGenerator.kt:518 */<p>The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.</p>
  259    290   
    /// <p>If your account is enabled for encryption by default, you cannot use an unencrypted snapshot as a parent snapshot. You must first create an encrypted copy of the parent snapshot using <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html">CopySnapshot</a>.</p>
         291  +
    /* FluentBuilderGenerator.kt:520 */
  260    292   
    pub fn get_parent_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
  261    293   
        self.inner.get_parent_snapshot_id()
  262    294   
    }
  263         -
    /// <p>A description for the snapshot.</p>
         295  +
    /// /* FluentBuilderGenerator.kt:498 */<p>A description for the snapshot.</p>
         296  +
    /* FluentBuilderGenerator.kt:500 */
  264    297   
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  265    298   
        self.inner = self.inner.description(input.into());
  266    299   
        self
  267    300   
    }
  268         -
    /// <p>A description for the snapshot.</p>
         301  +
    /// /* FluentBuilderGenerator.kt:498 */<p>A description for the snapshot.</p>
         302  +
    /* FluentBuilderGenerator.kt:500 */
  269    303   
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  270    304   
        self.inner = self.inner.set_description(input);
  271    305   
        self
  272    306   
    }
  273         -
    /// <p>A description for the snapshot.</p>
         307  +
    /// /* FluentBuilderGenerator.kt:518 */<p>A description for the snapshot.</p>
         308  +
    /* FluentBuilderGenerator.kt:520 */
  274    309   
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
  275    310   
        self.inner.get_description()
  276    311   
    }
         312  +
    /* FluentBuilderGenerator.kt:282 */
  277    313   
}

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

@@ -1,1 +17,18 @@
    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::body::SdkBody;
    3      4   
pub use ::aws_smithy_types::byte_stream::error::Error as ByteStreamError;
    4      5   
pub use ::aws_smithy_types::byte_stream::AggregatedBytes;
    5         -
pub use ::aws_smithy_types::byte_stream::ByteStream;
           6  +
/* SmithyTypesPubUseExtra.kt:86 */ pub use ::aws_smithy_types::byte_stream::ByteStream;
    6      7   
#[cfg(feature = "rt-tokio")]
    7      8   
pub use ::aws_smithy_types::byte_stream::FsBuilder;
    8      9   
#[cfg(feature = "rt-tokio")]
    9     10   
pub use ::aws_smithy_types::byte_stream::Length;
   10     11   
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
   11     12   
pub use ::aws_smithy_types::Blob;
   12         -
pub use ::aws_smithy_types::DateTime;
          13  +
/* SmithyTypesPubUseExtra.kt:69 */ pub use ::aws_smithy_types::DateTime;
   13     14   
   14         -
/// Event stream related primitives such as `Message` or `Header`.
          15  +
/// /* ClientRustModule.kt:121 */Event stream related primitives such as `Message` or `Header`.
   15     16   
pub mod event_stream;
   16     17   
   17     18   
pub(crate) mod sealed_enum_unknown;

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

@@ -1,1 +69,72 @@
    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_complete_snapshot;
   27     29   
   28     30   
pub(crate) mod shape_get_snapshot_block;
   29     31   
   30     32   
pub(crate) mod shape_list_changed_blocks;
   31     33   
   32     34   
pub(crate) mod shape_list_snapshot_blocks;
   33     35   
   34     36   
pub(crate) mod shape_put_snapshot_block;
   35     37   
   36     38   
pub(crate) mod shape_put_snapshot_block_input;
   37     39   
   38     40   
pub(crate) mod shape_start_snapshot;
   39     41   
          42  +
/* JsonParserGenerator.kt:227 */
   40     43   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   41     44   
    if data.is_empty() {
   42     45   
        b"{}"
   43     46   
    } else {
   44     47   
        data
   45     48   
    }
   46     49   
}
   47     50   
   48     51   
pub(crate) mod shape_access_denied_exception;
   49     52   

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

@@ -1,1 +43,73 @@
    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_access_denied_exception_json_err(
    3      4   
    value: &[u8],
    4      5   
    mut builder: crate::types::error::builders::AccessDeniedErrorBuilder,
    5      6   
) -> ::std::result::Result<crate::types::error::builders::AccessDeniedErrorBuilder, ::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:262 */
          34  +
                    "Reason" => {
          35  +
                        /* JsonParserGenerator.kt:265 */
          36  +
                        builder = builder.set_reason(
          37  +
                            /* JsonParserGenerator.kt:354 */
          38  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          39  +
                                .map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:345 */crate::types::AccessDeniedExceptionReason::from(u.as_ref())
          42  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          43  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
          44  +
                        );
          45  +
                        /* JsonParserGenerator.kt:262 */
          46  +
                    }
          47  +
                    /* JsonParserGenerator.kt:290 */
          48  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   19     49   
                }
   20         -
                "Reason" => {
   21         -
                    builder = builder.set_reason(
   22         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   23         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::AccessDeniedExceptionReason::from(u.as_ref())))
   24         -
                            .transpose()?,
   25         -
                    );
   26         -
                }
   27         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   28         -
            },
          50  +
                /* JsonParserGenerator.kt:686 */
          51  +
            }
          52  +
            /* JsonParserGenerator.kt:695 */
   29     53   
            other => {
   30     54   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   31     55   
                    "expected object key or end object, found: {:?}",
   32     56   
                    other
   33     57   
                )))
   34         -
            }
          58  +
            } /* JsonParserGenerator.kt:685 */
   35     59   
        }
          60  +
        /* JsonParserGenerator.kt:684 */
   36     61   
    }
          62  +
    /* JsonParserGenerator.kt:250 */
   37     63   
    if tokens.next().is_some() {
          64  +
        /* JsonParserGenerator.kt:251 */
   38     65   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   39     66   
            "found more JSON tokens after completing parsing",
   40     67   
        ));
          68  +
        /* JsonParserGenerator.kt:250 */
   41     69   
    }
          70  +
    /* JsonParserGenerator.kt:163 */
   42     71   
    Ok(builder)
          72  +
    /* JsonParserGenerator.kt:148 */
   43     73   
}

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

@@ -1,1 +47,79 @@
    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_block<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::Block>, ::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::BlockBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   17         -
                        "BlockToken" => {
   18         -
                            builder = builder.set_block_token(
   19         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                                    .transpose()?,
   22         -
                            );
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
          26  +
                            "BlockToken" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
          28  +
                                builder = builder.set_block_token(
          29  +
                                    /* JsonParserGenerator.kt:354 */
          30  +
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          31  +
                                        .map(|s|
          32  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          33  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          34  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          35  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
          36  +
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
          38  +
                            }
          39  +
                            /* JsonParserGenerator.kt:262 */
          40  +
                            "BlockIndex" => {
          41  +
                                /* JsonParserGenerator.kt:265 */
          42  +
                                builder = builder.set_block_index(
          43  +
                                    /* JsonParserGenerator.kt:365 */
          44  +
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          45  +
                                        .map(i32::try_from)
          46  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
          47  +
                                );
          48  +
                                /* JsonParserGenerator.kt:262 */
          49  +
                            }
          50  +
                            /* JsonParserGenerator.kt:290 */
          51  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   23     52   
                        }
   24         -
                        "BlockIndex" => {
   25         -
                            builder = builder.set_block_index(
   26         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   27         -
                                    .map(i32::try_from)
   28         -
                                    .transpose()?,
   29         -
                            );
   30         -
                        }
   31         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   32         -
                    },
          53  +
                        /* JsonParserGenerator.kt:686 */
          54  +
                    }
          55  +
                    /* JsonParserGenerator.kt:695 */
   33     56   
                    other => {
   34     57   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35     58   
                            "expected object key or end object, found: {:?}",
   36     59   
                            other
   37     60   
                        )))
   38         -
                    }
          61  +
                    } /* JsonParserGenerator.kt:685 */
   39     62   
                }
          63  +
                /* JsonParserGenerator.kt:684 */
   40     64   
            }
          65  +
            /* JsonParserGenerator.kt:540 */
   41     66   
            Ok(Some(builder.build()))
          67  +
            /* JsonParserGenerator.kt:713 */
   42     68   
        }
   43         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44         -
            "expected start object or null",
   45         -
        )),
          69  +
        /* JsonParserGenerator.kt:722 */
          70  +
        _ => {
          71  +
            /* JsonParserGenerator.kt:723 */
          72  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          73  +
                "expected start object or null",
          74  +
            ))
          75  +
            /* JsonParserGenerator.kt:722 */
          76  +
        } /* JsonParserGenerator.kt:712 */
   46     77   
    }
          78  +
    /* JsonParserGenerator.kt:516 */
   47     79   
}

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

@@ -1,1 +32,55 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_blocks<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::Block>>, ::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::StartArray { .. }) => {
          13  +
            /* JsonParserGenerator.kt:407 */
   11     14   
            let mut items = Vec::new();
          15  +
            /* JsonParserGenerator.kt:408 */
   12     16   
            loop {
          17  +
                /* JsonParserGenerator.kt:409 */
   13     18   
                match tokens.peek() {
          19  +
                    /* JsonParserGenerator.kt:410 */
   14     20   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          21  +
                        /* JsonParserGenerator.kt:411 */
   15     22   
                        tokens.next().transpose().unwrap();
   16     23   
                        break;
          24  +
                        /* JsonParserGenerator.kt:410 */
   17     25   
                    }
          26  +
                    /* JsonParserGenerator.kt:413 */
   18     27   
                    _ => {
   19         -
                        let value = crate::protocol_serde::shape_block::de_block(tokens)?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_block::de_block(tokens)?
          31  +
                        /* JsonParserGenerator.kt:419 */;
          32  +
                        /* JsonParserGenerator.kt:422 */
   20     33   
                        if let Some(value) = value {
   21     34   
                            items.push(value);
   22     35   
                        }
   23         -
                    }
          36  +
                        /* JsonParserGenerator.kt:413 */
          37  +
                    } /* JsonParserGenerator.kt:409 */
   24     38   
                }
          39  +
                /* JsonParserGenerator.kt:408 */
   25     40   
            }
          41  +
            /* JsonParserGenerator.kt:446 */
   26     42   
            Ok(Some(items))
          43  +
            /* JsonParserGenerator.kt:713 */
   27     44   
        }
   28         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29         -
            "expected start array or null",
   30         -
        )),
          45  +
        /* JsonParserGenerator.kt:722 */
          46  +
        _ => {
          47  +
            /* JsonParserGenerator.kt:723 */
          48  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          49  +
                "expected start array or null",
          50  +
            ))
          51  +
            /* JsonParserGenerator.kt:722 */
          52  +
        } /* JsonParserGenerator.kt:712 */
   31     53   
    }
          54  +
    /* JsonParserGenerator.kt:398 */
   32     55   
}

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

@@ -1,1 +54,93 @@
    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_changed_block<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::ChangedBlock>, ::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::ChangedBlockBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   17         -
                        "FirstBlockToken" => {
   18         -
                            builder = builder.set_first_block_token(
   19         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                                    .transpose()?,
   22         -
                            );
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
          26  +
                            "FirstBlockToken" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
          28  +
                                builder = builder.set_first_block_token(
          29  +
                                    /* JsonParserGenerator.kt:354 */
          30  +
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          31  +
                                        .map(|s|
          32  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          33  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          34  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          35  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
          36  +
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
          38  +
                            }
          39  +
                            /* JsonParserGenerator.kt:262 */
          40  +
                            "BlockIndex" => {
          41  +
                                /* JsonParserGenerator.kt:265 */
          42  +
                                builder = builder.set_block_index(
          43  +
                                    /* JsonParserGenerator.kt:365 */
          44  +
                                    ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
          45  +
                                        .map(i32::try_from)
          46  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
          47  +
                                );
          48  +
                                /* JsonParserGenerator.kt:262 */
          49  +
                            }
          50  +
                            /* JsonParserGenerator.kt:262 */
          51  +
                            "SecondBlockToken" => {
          52  +
                                /* JsonParserGenerator.kt:265 */
          53  +
                                builder = builder.set_second_block_token(
          54  +
                                    /* JsonParserGenerator.kt:354 */
          55  +
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          56  +
                                        .map(|s|
          57  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          58  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          59  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          60  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
          61  +
                                );
          62  +
                                /* JsonParserGenerator.kt:262 */
          63  +
                            }
          64  +
                            /* JsonParserGenerator.kt:290 */
          65  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   23     66   
                        }
   24         -
                        "BlockIndex" => {
   25         -
                            builder = builder.set_block_index(
   26         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   27         -
                                    .map(i32::try_from)
   28         -
                                    .transpose()?,
   29         -
                            );
   30         -
                        }
   31         -
                        "SecondBlockToken" => {
   32         -
                            builder = builder.set_second_block_token(
   33         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   34         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   35         -
                                    .transpose()?,
   36         -
                            );
   37         -
                        }
   38         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   39         -
                    },
          67  +
                        /* JsonParserGenerator.kt:686 */
          68  +
                    }
          69  +
                    /* JsonParserGenerator.kt:695 */
   40     70   
                    other => {
   41     71   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   42     72   
                            "expected object key or end object, found: {:?}",
   43     73   
                            other
   44     74   
                        )))
   45         -
                    }
          75  +
                    } /* JsonParserGenerator.kt:685 */
   46     76   
                }
          77  +
                /* JsonParserGenerator.kt:684 */
   47     78   
            }
          79  +
            /* JsonParserGenerator.kt:540 */
   48     80   
            Ok(Some(builder.build()))
          81  +
            /* JsonParserGenerator.kt:713 */
   49     82   
        }
   50         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   51         -
            "expected start object or null",
   52         -
        )),
          83  +
        /* JsonParserGenerator.kt:722 */
          84  +
        _ => {
          85  +
            /* JsonParserGenerator.kt:723 */
          86  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          87  +
                "expected start object or null",
          88  +
            ))
          89  +
            /* JsonParserGenerator.kt:722 */
          90  +
        } /* JsonParserGenerator.kt:712 */
   53     91   
    }
          92  +
    /* JsonParserGenerator.kt:516 */
   54     93   
}

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

@@ -1,1 +32,55 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_changed_blocks<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::ChangedBlock>>, ::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::StartArray { .. }) => {
          13  +
            /* JsonParserGenerator.kt:407 */
   11     14   
            let mut items = Vec::new();
          15  +
            /* JsonParserGenerator.kt:408 */
   12     16   
            loop {
          17  +
                /* JsonParserGenerator.kt:409 */
   13     18   
                match tokens.peek() {
          19  +
                    /* JsonParserGenerator.kt:410 */
   14     20   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          21  +
                        /* JsonParserGenerator.kt:411 */
   15     22   
                        tokens.next().transpose().unwrap();
   16     23   
                        break;
          24  +
                        /* JsonParserGenerator.kt:410 */
   17     25   
                    }
          26  +
                    /* JsonParserGenerator.kt:413 */
   18     27   
                    _ => {
   19         -
                        let value = crate::protocol_serde::shape_changed_block::de_changed_block(tokens)?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_changed_block::de_changed_block(tokens)?
          31  +
                        /* JsonParserGenerator.kt:419 */;
          32  +
                        /* JsonParserGenerator.kt:422 */
   20     33   
                        if let Some(value) = value {
   21     34   
                            items.push(value);
   22     35   
                        }
   23         -
                    }
          36  +
                        /* JsonParserGenerator.kt:413 */
          37  +
                    } /* JsonParserGenerator.kt:409 */
   24     38   
                }
          39  +
                /* JsonParserGenerator.kt:408 */
   25     40   
            }
          41  +
            /* JsonParserGenerator.kt:446 */
   26     42   
            Ok(Some(items))
          43  +
            /* JsonParserGenerator.kt:713 */
   27     44   
        }
   28         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29         -
            "expected start array or null",
   30         -
        )),
          45  +
        /* JsonParserGenerator.kt:722 */
          46  +
        _ => {
          47  +
            /* JsonParserGenerator.kt:723 */
          48  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          49  +
                "expected start array or null",
          50  +
            ))
          51  +
            /* JsonParserGenerator.kt:722 */
          52  +
        } /* JsonParserGenerator.kt:712 */
   31     53   
    }
          54  +
    /* JsonParserGenerator.kt:398 */
   32     55   
}

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

@@ -1,1 +222,314 @@
    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_complete_snapshot_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::complete_snapshot::CompleteSnapshotOutput, crate::operation::complete_snapshot::CompleteSnapshotError> {
          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::complete_snapshot::CompleteSnapshotError::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::complete_snapshot::CompleteSnapshotError::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   
        "AccessDeniedException" => crate::operation::complete_snapshot::CompleteSnapshotError::AccessDeniedError({
          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::AccessDeniedErrorBuilder::default();
   24         -
                output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
   25         -
                    .map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
   26         -
                let output = output.meta(generic);
   27         -
                crate::serde_util::access_denied_exception_correct_errors(output)
   28         -
                    .build()
   29         -
                    .map_err(crate::operation::complete_snapshot::CompleteSnapshotError::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::AccessDeniedErrorBuilder::default();
          34  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output).map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
          35  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          36  +
                    /* ClientBuilderInstantiator.kt:46 */crate::serde_util::access_denied_exception_correct_errors(output).build().map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?
          37  +
                /* ProtocolParserGenerator.kt:146 */}
          38  +
            /* ProtocolParserGenerator.kt:145 */;
          39  +
            /* ProtocolParserGenerator.kt:170 */
   31     40   
            if tmp.message.is_none() {
   32     41   
                tmp.message = _error_message;
   33     42   
            }
          43  +
            /* ProtocolParserGenerator.kt:179 */
   34     44   
            tmp
          45  +
            /* ProtocolParserGenerator.kt:139 */
   35     46   
        }),
          47  +
        /* ProtocolParserGenerator.kt:139 */
   36     48   
        "InternalServerException" => crate::operation::complete_snapshot::CompleteSnapshotError::InternalServerError({
          49  +
            /* RustType.kt:516 */
   37     50   
            #[allow(unused_mut)]
   38         -
            let mut tmp = {
   39         -
                #[allow(unused_mut)]
   40         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   41         -
                output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
   42         -
                    .map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
   43         -
                let output = output.meta(generic);
   44         -
                output.build()
   45         -
            };
          51  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          52  +
                /* ProtocolParserGenerator.kt:146 */ {
          53  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          54  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
          55  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output).map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
          56  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          57  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          58  +
                /* ProtocolParserGenerator.kt:146 */}
          59  +
            /* ProtocolParserGenerator.kt:145 */;
          60  +
            /* ProtocolParserGenerator.kt:170 */
   46     61   
            if tmp.message.is_none() {
   47     62   
                tmp.message = _error_message;
   48     63   
            }
          64  +
            /* ProtocolParserGenerator.kt:179 */
   49     65   
            tmp
          66  +
            /* ProtocolParserGenerator.kt:139 */
   50     67   
        }),
          68  +
        /* ProtocolParserGenerator.kt:139 */
   51     69   
        "RequestThrottledException" => crate::operation::complete_snapshot::CompleteSnapshotError::RequestThrottledError({
          70  +
            /* RustType.kt:516 */
   52     71   
            #[allow(unused_mut)]
   53         -
            let mut tmp = {
   54         -
                #[allow(unused_mut)]
   55         -
                let mut output = crate::types::error::builders::RequestThrottledErrorBuilder::default();
   56         -
                output = crate::protocol_serde::shape_request_throttled_exception::de_request_throttled_exception_json_err(_response_body, output)
   57         -
                    .map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
   58         -
                let output = output.meta(generic);
   59         -
                output.build()
   60         -
            };
          72  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          73  +
                /* ProtocolParserGenerator.kt:146 */ {
          74  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          75  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::RequestThrottledErrorBuilder::default();
          76  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_request_throttled_exception::de_request_throttled_exception_json_err(_response_body, output).map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
          77  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          78  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          79  +
                /* ProtocolParserGenerator.kt:146 */}
          80  +
            /* ProtocolParserGenerator.kt:145 */;
          81  +
            /* ProtocolParserGenerator.kt:170 */
   61     82   
            if tmp.message.is_none() {
   62     83   
                tmp.message = _error_message;
   63     84   
            }
          85  +
            /* ProtocolParserGenerator.kt:179 */
   64     86   
            tmp
          87  +
            /* ProtocolParserGenerator.kt:139 */
   65     88   
        }),
          89  +
        /* ProtocolParserGenerator.kt:139 */
   66     90   
        "ResourceNotFoundException" => crate::operation::complete_snapshot::CompleteSnapshotError::ResourceNotFoundError({
          91  +
            /* RustType.kt:516 */
   67     92   
            #[allow(unused_mut)]
   68         -
            let mut tmp = {
   69         -
                #[allow(unused_mut)]
   70         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   71         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   72         -
                    .map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
   73         -
                let output = output.meta(generic);
   74         -
                output.build()
   75         -
            };
          93  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          94  +
                /* ProtocolParserGenerator.kt:146 */ {
          95  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          96  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
          97  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output).map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
          98  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          99  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         100  +
                /* ProtocolParserGenerator.kt:146 */}
         101  +
            /* ProtocolParserGenerator.kt:145 */;
         102  +
            /* ProtocolParserGenerator.kt:170 */
   76    103   
            if tmp.message.is_none() {
   77    104   
                tmp.message = _error_message;
   78    105   
            }
         106  +
            /* ProtocolParserGenerator.kt:179 */
   79    107   
            tmp
         108  +
            /* ProtocolParserGenerator.kt:139 */
   80    109   
        }),
         110  +
        /* ProtocolParserGenerator.kt:139 */
   81    111   
        "ServiceQuotaExceededException" => crate::operation::complete_snapshot::CompleteSnapshotError::ServiceQuotaExceededError({
         112  +
            /* RustType.kt:516 */
   82    113   
            #[allow(unused_mut)]
   83         -
            let mut tmp = {
   84         -
                #[allow(unused_mut)]
   85         -
                let mut output = crate::types::error::builders::ServiceQuotaExceededErrorBuilder::default();
   86         -
                output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
   87         -
                    _response_body,
   88         -
                    output,
   89         -
                )
   90         -
                .map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
   91         -
                let output = output.meta(generic);
   92         -
                output.build()
   93         -
            };
         114  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         115  +
                /* ProtocolParserGenerator.kt:146 */ {
         116  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         117  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ServiceQuotaExceededErrorBuilder::default();
         118  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
         119  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         120  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         121  +
                /* ProtocolParserGenerator.kt:146 */}
         122  +
            /* ProtocolParserGenerator.kt:145 */;
         123  +
            /* ProtocolParserGenerator.kt:170 */
   94    124   
            if tmp.message.is_none() {
   95    125   
                tmp.message = _error_message;
   96    126   
            }
         127  +
            /* ProtocolParserGenerator.kt:179 */
   97    128   
            tmp
         129  +
            /* ProtocolParserGenerator.kt:139 */
   98    130   
        }),
         131  +
        /* ProtocolParserGenerator.kt:139 */
   99    132   
        "ValidationException" => crate::operation::complete_snapshot::CompleteSnapshotError::ValidationError({
         133  +
            /* RustType.kt:516 */
  100    134   
            #[allow(unused_mut)]
  101         -
            let mut tmp = {
  102         -
                #[allow(unused_mut)]
  103         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
  104         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
  105         -
                    .map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
  106         -
                let output = output.meta(generic);
  107         -
                output.build()
  108         -
            };
         135  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         136  +
                /* ProtocolParserGenerator.kt:146 */ {
         137  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         138  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
         139  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output).map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
         140  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         141  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         142  +
                /* ProtocolParserGenerator.kt:146 */}
         143  +
            /* ProtocolParserGenerator.kt:145 */;
         144  +
            /* ProtocolParserGenerator.kt:170 */
  109    145   
            if tmp.message.is_none() {
  110    146   
                tmp.message = _error_message;
  111    147   
            }
         148  +
            /* ProtocolParserGenerator.kt:179 */
  112    149   
            tmp
         150  +
            /* ProtocolParserGenerator.kt:139 */
  113    151   
        }),
  114         -
        _ => crate::operation::complete_snapshot::CompleteSnapshotError::generic(generic),
         152  +
        /* ProtocolParserGenerator.kt:182 */
         153  +
        _ => crate::operation::complete_snapshot::CompleteSnapshotError::generic(generic), /* ProtocolParserGenerator.kt:133 */
  115    154   
    })
         155  +
    /* ProtocolParserGenerator.kt:99 */
  116    156   
}
  117    157   
         158  +
/* RustType.kt:516 */
  118    159   
#[allow(clippy::unnecessary_wraps)]
         160  +
/* ProtocolParserGenerator.kt:71 */
  119    161   
pub fn de_complete_snapshot_http_response(
  120    162   
    _response_status: u16,
  121    163   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  122    164   
    _response_body: &[u8],
  123    165   
) -> std::result::Result<crate::operation::complete_snapshot::CompleteSnapshotOutput, crate::operation::complete_snapshot::CompleteSnapshotError> {
         166  +
    /* ProtocolParserGenerator.kt:77 */
  124    167   
    Ok({
         168  +
        /* RustType.kt:516 */
  125    169   
        #[allow(unused_mut)]
         170  +
        /* ProtocolParserGenerator.kt:240 */
  126    171   
        let mut output = crate::operation::complete_snapshot::builders::CompleteSnapshotOutputBuilder::default();
         172  +
        /* ProtocolParserGenerator.kt:247 */
  127    173   
        output = crate::protocol_serde::shape_complete_snapshot::de_complete_snapshot(_response_body, output)
  128    174   
            .map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
         175  +
        /* ClientBuilderInstantiator.kt:56 */
  129    176   
        output.build()
         177  +
        /* ProtocolParserGenerator.kt:77 */
  130    178   
    })
         179  +
    /* ProtocolParserGenerator.kt:71 */
  131    180   
}
  132    181   
         182  +
/* HttpBindingGenerator.kt:542 */
  133    183   
pub fn ser_complete_snapshot_headers(
  134    184   
    input: &crate::operation::complete_snapshot::CompleteSnapshotInput,
  135    185   
    mut builder: ::http::request::Builder,
  136    186   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         187  +
    /* HttpBindingGenerator.kt:592 */
  137    188   
    if let ::std::option::Option::Some(inner_1) = &input.changed_blocks_count {
         189  +
        /* HttpBindingGenerator.kt:690 */
  138    190   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_1);
         191  +
        /* HttpBindingGenerator.kt:704 */
  139    192   
        let formatted_2 = encoder.encode();
         193  +
        /* HttpBindingGenerator.kt:706 */
  140    194   
        let header_value = formatted_2;
  141    195   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  142    196   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  143    197   
                "changed_blocks_count",
  144    198   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  145    199   
            )
  146    200   
        })?;
  147    201   
        builder = builder.header("x-amz-ChangedBlocksCount", header_value);
         202  +
        /* HttpBindingGenerator.kt:592 */
  148    203   
    }
         204  +
    /* HttpBindingGenerator.kt:592 */
  149    205   
    if let ::std::option::Option::Some(inner_3) = &input.checksum_aggregation_method {
         206  +
        /* HttpBindingGenerator.kt:704 */
  150    207   
        let formatted_4 = inner_3.as_str();
         208  +
        /* HttpBindingGenerator.kt:706 */
  151    209   
        let header_value = formatted_4;
  152    210   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  153    211   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  154    212   
                "checksum_aggregation_method",
  155    213   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  156    214   
            )
  157    215   
        })?;
  158    216   
        builder = builder.header("x-amz-Checksum-Aggregation-Method", header_value);
         217  +
        /* HttpBindingGenerator.kt:592 */
  159    218   
    }
         219  +
    /* HttpBindingGenerator.kt:592 */
  160    220   
    if let ::std::option::Option::Some(inner_5) = &input.checksum_algorithm {
         221  +
        /* HttpBindingGenerator.kt:704 */
  161    222   
        let formatted_6 = inner_5.as_str();
         223  +
        /* HttpBindingGenerator.kt:706 */
  162    224   
        let header_value = formatted_6;
  163    225   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  164    226   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  165    227   
                "checksum_algorithm",
  166    228   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  167    229   
            )
  168    230   
        })?;
  169    231   
        builder = builder.header("x-amz-Checksum-Algorithm", header_value);
         232  +
        /* HttpBindingGenerator.kt:592 */
  170    233   
    }
         234  +
    /* HttpBindingGenerator.kt:592 */
  171    235   
    if let ::std::option::Option::Some(inner_7) = &input.checksum {
         236  +
        /* HttpBindingGenerator.kt:704 */
  172    237   
        let formatted_8 = inner_7.as_str();
         238  +
        /* HttpBindingGenerator.kt:706 */
  173    239   
        let header_value = formatted_8;
  174    240   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  175    241   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  176    242   
                "checksum",
  177    243   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  178    244   
            )
  179    245   
        })?;
  180    246   
        builder = builder.header("x-amz-Checksum", header_value);
         247  +
        /* HttpBindingGenerator.kt:592 */
  181    248   
    }
         249  +
    /* HttpBindingGenerator.kt:555 */
  182    250   
    Ok(builder)
         251  +
    /* HttpBindingGenerator.kt:542 */
  183    252   
}
  184    253   
         254  +
/* JsonParserGenerator.kt:148 */
  185    255   
pub(crate) fn de_complete_snapshot(
  186    256   
    value: &[u8],
  187    257   
    mut builder: crate::operation::complete_snapshot::builders::CompleteSnapshotOutputBuilder,
  188    258   
) -> ::std::result::Result<
  189    259   
    crate::operation::complete_snapshot::builders::CompleteSnapshotOutputBuilder,
  190    260   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  191    261   
> {
         262  +
    /* JsonParserGenerator.kt:153 */
  192    263   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
  193    264   
    let tokens = &mut tokens_owned;
  194    265   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         266  +
    /* JsonParserGenerator.kt:684 */
  195    267   
    loop {
         268  +
        /* JsonParserGenerator.kt:685 */
  196    269   
        match tokens.next().transpose()? {
  197         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  198         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  199         -
                "Status" => {
  200         -
                    builder = builder.set_status(
  201         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  202         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::Status::from(u.as_ref())))
  203         -
                            .transpose()?,
  204         -
                    );
         270  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
         271  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         272  +
                /* JsonParserGenerator.kt:260 */
         273  +
                match key.to_unescaped()?.as_ref() {
         274  +
                    /* JsonParserGenerator.kt:262 */
         275  +
                    "Status" => {
         276  +
                        /* JsonParserGenerator.kt:265 */
         277  +
                        builder = builder.set_status(
         278  +
                            /* JsonParserGenerator.kt:354 */
         279  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
         280  +
                                .map(|s|
         281  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         282  +
                                    /* JsonParserGenerator.kt:345 */crate::types::Status::from(u.as_ref())
         283  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         284  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
         285  +
                        );
         286  +
                        /* JsonParserGenerator.kt:262 */
         287  +
                    }
         288  +
                    /* JsonParserGenerator.kt:290 */
         289  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  205    290   
                }
  206         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  207         -
            },
         291  +
                /* JsonParserGenerator.kt:686 */
         292  +
            }
         293  +
            /* JsonParserGenerator.kt:695 */
  208    294   
            other => {
  209    295   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  210    296   
                    "expected object key or end object, found: {:?}",
  211    297   
                    other
  212    298   
                )))
  213         -
            }
         299  +
            } /* JsonParserGenerator.kt:685 */
  214    300   
        }
         301  +
        /* JsonParserGenerator.kt:684 */
  215    302   
    }
         303  +
    /* JsonParserGenerator.kt:250 */
  216    304   
    if tokens.next().is_some() {
         305  +
        /* JsonParserGenerator.kt:251 */
  217    306   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  218    307   
            "found more JSON tokens after completing parsing",
  219    308   
        ));
         309  +
        /* JsonParserGenerator.kt:250 */
  220    310   
    }
         311  +
    /* JsonParserGenerator.kt:163 */
  221    312   
    Ok(builder)
         313  +
    /* JsonParserGenerator.kt:148 */
  222    314   
}

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

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

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/protocol_serde/shape_conflict_exception.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_conflict_exception_json_err(
    3      4   
    value: &[u8],
    4      5   
    mut builder: crate::types::error::builders::ConflictErrorBuilder,
    5      6   
) -> ::std::result::Result<crate::types::error::builders::ConflictErrorBuilder, ::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/ebs/rust-client-codegen/src/protocol_serde/shape_get_snapshot_block.rs

@@ -1,1 +153,212 @@
    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:200 */
    3      5   
pub fn de_get_snapshot_block_http_response(
    4      6   
    response: &mut ::aws_smithy_runtime_api::http::Response,
    5      7   
) -> std::result::Result<crate::operation::get_snapshot_block::GetSnapshotBlockOutput, crate::operation::get_snapshot_block::GetSnapshotBlockError> {
           8  +
    /* ProtocolParserGenerator.kt:206 */
    6      9   
    let mut _response_body = ::aws_smithy_types::body::SdkBody::taken();
    7     10   
    std::mem::swap(&mut _response_body, response.body_mut());
    8     11   
    let _response_body = &mut _response_body;
    9     12   
   10     13   
    let _response_status = response.status().as_u16();
   11     14   
    let _response_headers = response.headers();
          15  +
    /* ProtocolParserGenerator.kt:217 */
   12     16   
    Ok({
          17  +
        /* RustType.kt:516 */
   13     18   
        #[allow(unused_mut)]
          19  +
        /* ProtocolParserGenerator.kt:240 */
   14     20   
        let mut output = crate::operation::get_snapshot_block::builders::GetSnapshotBlockOutputBuilder::default();
   15         -
        output = output.set_block_data(Some(crate::protocol_serde::shape_get_snapshot_block_output::de_block_data_payload(
   16         -
            _response_body,
   17         -
        )?));
          21  +
        /* ProtocolParserGenerator.kt:267 */
          22  +
        output = output.set_block_data(
          23  +
            /* ProtocolParserGenerator.kt:325 */
          24  +
            Some(crate::protocol_serde::shape_get_snapshot_block_output::de_block_data_payload(
          25  +
                _response_body,
          26  +
            )?), /* ProtocolParserGenerator.kt:267 */
          27  +
        );
          28  +
        /* ProtocolParserGenerator.kt:267 */
   18     29   
        output = output.set_checksum(
          30  +
            /* ProtocolParserGenerator.kt:302 */
   19     31   
            crate::protocol_serde::shape_get_snapshot_block_output::de_checksum_header(_response_headers).map_err(|_| {
   20     32   
                crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled("Failed to parse Checksum from header `x-amz-Checksum")
   21         -
            })?,
          33  +
            })?, /* ProtocolParserGenerator.kt:267 */
   22     34   
        );
          35  +
        /* ProtocolParserGenerator.kt:267 */
   23     36   
        output = output.set_checksum_algorithm(
          37  +
            /* ProtocolParserGenerator.kt:302 */
   24     38   
            crate::protocol_serde::shape_get_snapshot_block_output::de_checksum_algorithm_header(_response_headers).map_err(|_| {
   25     39   
                crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled(
   26     40   
                    "Failed to parse ChecksumAlgorithm from header `x-amz-Checksum-Algorithm",
   27     41   
                )
   28         -
            })?,
          42  +
            })?, /* ProtocolParserGenerator.kt:267 */
   29     43   
        );
          44  +
        /* ProtocolParserGenerator.kt:267 */
   30     45   
        output = output.set_data_length(
          46  +
            /* ProtocolParserGenerator.kt:302 */
   31     47   
            crate::protocol_serde::shape_get_snapshot_block_output::de_data_length_header(_response_headers).map_err(|_| {
   32     48   
                crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled("Failed to parse DataLength from header `x-amz-Data-Length")
   33         -
            })?,
          49  +
            })?, /* ProtocolParserGenerator.kt:267 */
   34     50   
        );
          51  +
        /* ClientBuilderInstantiator.kt:56 */
   35     52   
        output.build()
          53  +
        /* ProtocolParserGenerator.kt:217 */
   36     54   
    })
          55  +
    /* ProtocolParserGenerator.kt:200 */
   37     56   
}
   38     57   
          58  +
/* RustType.kt:516 */
   39     59   
#[allow(clippy::unnecessary_wraps)]
          60  +
/* ProtocolParserGenerator.kt:99 */
   40     61   
pub fn de_get_snapshot_block_http_error(
   41     62   
    _response_status: u16,
   42     63   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   43     64   
    _response_body: &[u8],
   44     65   
) -> std::result::Result<crate::operation::get_snapshot_block::GetSnapshotBlockOutput, crate::operation::get_snapshot_block::GetSnapshotBlockError> {
          66  +
    /* RustType.kt:516 */
   45     67   
    #[allow(unused_mut)]
          68  +
    /* ProtocolParserGenerator.kt:106 */
   46     69   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   47     70   
        .map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
          71  +
    /* ProtocolParserGenerator.kt:120 */
   48     72   
    let generic = generic_builder.build();
          73  +
    /* ProtocolParserGenerator.kt:122 */
   49     74   
    let error_code = match generic.code() {
   50     75   
        Some(code) => code,
   51     76   
        None => return Err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled(generic)),
   52     77   
    };
   53     78   
   54     79   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          80  +
    /* ProtocolParserGenerator.kt:133 */
   55     81   
    Err(match error_code {
          82  +
        /* ProtocolParserGenerator.kt:139 */
   56     83   
        "AccessDeniedException" => crate::operation::get_snapshot_block::GetSnapshotBlockError::AccessDeniedError({
          84  +
            /* RustType.kt:516 */
   57     85   
            #[allow(unused_mut)]
   58         -
            let mut tmp = {
   59         -
                #[allow(unused_mut)]
   60         -
                let mut output = crate::types::error::builders::AccessDeniedErrorBuilder::default();
   61         -
                output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
   62         -
                    .map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
   63         -
                let output = output.meta(generic);
   64         -
                crate::serde_util::access_denied_exception_correct_errors(output)
   65         -
                    .build()
   66         -
                    .map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?
   67         -
            };
          86  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          87  +
                /* ProtocolParserGenerator.kt:146 */ {
          88  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          89  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::AccessDeniedErrorBuilder::default();
          90  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output).map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
          91  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          92  +
                    /* ClientBuilderInstantiator.kt:46 */crate::serde_util::access_denied_exception_correct_errors(output).build().map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?
          93  +
                /* ProtocolParserGenerator.kt:146 */}
          94  +
            /* ProtocolParserGenerator.kt:145 */;
          95  +
            /* ProtocolParserGenerator.kt:170 */
   68     96   
            if tmp.message.is_none() {
   69     97   
                tmp.message = _error_message;
   70     98   
            }
          99  +
            /* ProtocolParserGenerator.kt:179 */
   71    100   
            tmp
         101  +
            /* ProtocolParserGenerator.kt:139 */
   72    102   
        }),
         103  +
        /* ProtocolParserGenerator.kt:139 */
   73    104   
        "InternalServerException" => crate::operation::get_snapshot_block::GetSnapshotBlockError::InternalServerError({
         105  +
            /* RustType.kt:516 */
   74    106   
            #[allow(unused_mut)]
   75         -
            let mut tmp = {
   76         -
                #[allow(unused_mut)]
   77         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   78         -
                output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
   79         -
                    .map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
   80         -
                let output = output.meta(generic);
   81         -
                output.build()
   82         -
            };
         107  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         108  +
                /* ProtocolParserGenerator.kt:146 */ {
         109  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         110  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
         111  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output).map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
         112  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         113  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         114  +
                /* ProtocolParserGenerator.kt:146 */}
         115  +
            /* ProtocolParserGenerator.kt:145 */;
         116  +
            /* ProtocolParserGenerator.kt:170 */
   83    117   
            if tmp.message.is_none() {
   84    118   
                tmp.message = _error_message;
   85    119   
            }
         120  +
            /* ProtocolParserGenerator.kt:179 */
   86    121   
            tmp
         122  +
            /* ProtocolParserGenerator.kt:139 */
   87    123   
        }),
         124  +
        /* ProtocolParserGenerator.kt:139 */
   88    125   
        "RequestThrottledException" => crate::operation::get_snapshot_block::GetSnapshotBlockError::RequestThrottledError({
         126  +
            /* RustType.kt:516 */
   89    127   
            #[allow(unused_mut)]
   90         -
            let mut tmp = {
   91         -
                #[allow(unused_mut)]
   92         -
                let mut output = crate::types::error::builders::RequestThrottledErrorBuilder::default();
   93         -
                output = crate::protocol_serde::shape_request_throttled_exception::de_request_throttled_exception_json_err(_response_body, output)
   94         -
                    .map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
   95         -
                let output = output.meta(generic);
   96         -
                output.build()
   97         -
            };
         128  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         129  +
                /* ProtocolParserGenerator.kt:146 */ {
         130  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         131  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::RequestThrottledErrorBuilder::default();
         132  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_request_throttled_exception::de_request_throttled_exception_json_err(_response_body, output).map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
         133  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         134  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         135  +
                /* ProtocolParserGenerator.kt:146 */}
         136  +
            /* ProtocolParserGenerator.kt:145 */;
         137  +
            /* ProtocolParserGenerator.kt:170 */
   98    138   
            if tmp.message.is_none() {
   99    139   
                tmp.message = _error_message;
  100    140   
            }
         141  +
            /* ProtocolParserGenerator.kt:179 */
  101    142   
            tmp
         143  +
            /* ProtocolParserGenerator.kt:139 */
  102    144   
        }),
         145  +
        /* ProtocolParserGenerator.kt:139 */
  103    146   
        "ResourceNotFoundException" => crate::operation::get_snapshot_block::GetSnapshotBlockError::ResourceNotFoundError({
         147  +
            /* RustType.kt:516 */
  104    148   
            #[allow(unused_mut)]
  105         -
            let mut tmp = {
  106         -
                #[allow(unused_mut)]
  107         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
  108         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
  109         -
                    .map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
  110         -
                let output = output.meta(generic);
  111         -
                output.build()
  112         -
            };
         149  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         150  +
                /* ProtocolParserGenerator.kt:146 */ {
         151  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         152  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
         153  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output).map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
         154  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         155  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         156  +
                /* ProtocolParserGenerator.kt:146 */}
         157  +
            /* ProtocolParserGenerator.kt:145 */;
         158  +
            /* ProtocolParserGenerator.kt:170 */
  113    159   
            if tmp.message.is_none() {
  114    160   
                tmp.message = _error_message;
  115    161   
            }
         162  +
            /* ProtocolParserGenerator.kt:179 */
  116    163   
            tmp
         164  +
            /* ProtocolParserGenerator.kt:139 */
  117    165   
        }),
         166  +
        /* ProtocolParserGenerator.kt:139 */
  118    167   
        "ServiceQuotaExceededException" => crate::operation::get_snapshot_block::GetSnapshotBlockError::ServiceQuotaExceededError({
         168  +
            /* RustType.kt:516 */
  119    169   
            #[allow(unused_mut)]
  120         -
            let mut tmp = {
  121         -
                #[allow(unused_mut)]
  122         -
                let mut output = crate::types::error::builders::ServiceQuotaExceededErrorBuilder::default();
  123         -
                output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
  124         -
                    _response_body,
  125         -
                    output,
  126         -
                )
  127         -
                .map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
  128         -
                let output = output.meta(generic);
  129         -
                output.build()
  130         -
            };
         170  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         171  +
                /* ProtocolParserGenerator.kt:146 */ {
         172  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         173  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ServiceQuotaExceededErrorBuilder::default();
         174  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
         175  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         176  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         177  +
                /* ProtocolParserGenerator.kt:146 */}
         178  +
            /* ProtocolParserGenerator.kt:145 */;
         179  +
            /* ProtocolParserGenerator.kt:170 */
  131    180   
            if tmp.message.is_none() {
  132    181   
                tmp.message = _error_message;
  133    182   
            }
         183  +
            /* ProtocolParserGenerator.kt:179 */
  134    184   
            tmp
         185  +
            /* ProtocolParserGenerator.kt:139 */
  135    186   
        }),
         187  +
        /* ProtocolParserGenerator.kt:139 */
  136    188   
        "ValidationException" => crate::operation::get_snapshot_block::GetSnapshotBlockError::ValidationError({
         189  +
            /* RustType.kt:516 */
  137    190   
            #[allow(unused_mut)]
  138         -
            let mut tmp = {
  139         -
                #[allow(unused_mut)]
  140         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
  141         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
  142         -
                    .map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
  143         -
                let output = output.meta(generic);
  144         -
                output.build()
  145         -
            };
         191  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         192  +
                /* ProtocolParserGenerator.kt:146 */ {
         193  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         194  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
         195  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output).map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
         196  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         197  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         198  +
                /* ProtocolParserGenerator.kt:146 */}
         199  +
            /* ProtocolParserGenerator.kt:145 */;
         200  +
            /* ProtocolParserGenerator.kt:170 */
  146    201   
            if tmp.message.is_none() {
  147    202   
                tmp.message = _error_message;
  148    203   
            }
         204  +
            /* ProtocolParserGenerator.kt:179 */
  149    205   
            tmp
         206  +
            /* ProtocolParserGenerator.kt:139 */
  150    207   
        }),
  151         -
        _ => crate::operation::get_snapshot_block::GetSnapshotBlockError::generic(generic),
         208  +
        /* ProtocolParserGenerator.kt:182 */
         209  +
        _ => crate::operation::get_snapshot_block::GetSnapshotBlockError::generic(generic), /* ProtocolParserGenerator.kt:133 */
  152    210   
    })
         211  +
    /* ProtocolParserGenerator.kt:99 */
  153    212   
}

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

@@ -1,1 +38,53 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:230 */
    2      3   
pub fn de_block_data_payload(
    3      4   
    body: &mut ::aws_smithy_types::body::SdkBody,
    4      5   
) -> std::result::Result<::aws_smithy_types::byte_stream::ByteStream, crate::operation::get_snapshot_block::GetSnapshotBlockError> {
    5         -
    // replace the body with an empty body
           6  +
    /* HttpBindingGenerator.kt:299 */// replace the body with an empty body
    6      7   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
    7      8   
    Ok(::aws_smithy_types::byte_stream::ByteStream::new(body))
           9  +
    /* HttpBindingGenerator.kt:230 */
    8     10   
}
    9     11   
          12  +
/* HttpBindingGenerator.kt:153 */
   10     13   
pub(crate) fn de_checksum_header(
   11     14   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   12     15   
) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
          16  +
    /* HttpBindingGenerator.kt:160 */
   13     17   
    let headers = header_map.get_all("x-amz-Checksum");
          18  +
    /* HttpBindingGenerator.kt:375 */
   14     19   
    ::aws_smithy_http::header::one_or_none(headers)
          20  +
    /* HttpBindingGenerator.kt:153 */
   15     21   
}
   16     22   
          23  +
/* HttpBindingGenerator.kt:153 */
   17     24   
pub(crate) fn de_checksum_algorithm_header(
   18     25   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   19     26   
) -> ::std::result::Result<::std::option::Option<crate::types::ChecksumAlgorithm>, ::aws_smithy_http::header::ParseError> {
          27  +
    /* HttpBindingGenerator.kt:160 */
   20     28   
    let headers = header_map.get_all("x-amz-Checksum-Algorithm");
          29  +
    /* HttpBindingGenerator.kt:375 */
   21     30   
    ::aws_smithy_http::header::one_or_none(headers)
          31  +
    /* HttpBindingGenerator.kt:153 */
   22     32   
}
   23     33   
          34  +
/* HttpBindingGenerator.kt:153 */
   24     35   
pub(crate) fn de_data_length_header(
   25     36   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   26     37   
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_http::header::ParseError> {
          38  +
    /* HttpBindingGenerator.kt:160 */
   27     39   
    let headers = header_map.get_all("x-amz-Data-Length");
          40  +
    /* HttpBindingGenerator.kt:404 */
   28     41   
    let var_1 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
          42  +
    /* HttpBindingGenerator.kt:468 */
   29     43   
    if var_1.len() > 1 {
   30     44   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   31     45   
            "expected one item but found {}",
   32     46   
            var_1.len()
   33     47   
        )))
   34     48   
    } else {
   35     49   
        let mut var_1 = var_1;
   36     50   
        Ok(var_1.pop())
   37     51   
    }
          52  +
    /* HttpBindingGenerator.kt:153 */
   38     53   
}

tmp-codegen-diff/codegen-client-test/ebs/rust-client-codegen/src/protocol_serde/shape_internal_server_exception.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_internal_server_exception_json_err(
    3      4   
    value: &[u8],
    4      5   
    mut builder: crate::types::error::builders::InternalServerErrorBuilder,
    5      6   
) -> ::std::result::Result<crate::types::error::builders::InternalServerErrorBuilder, ::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/ebs/rust-client-codegen/src/protocol_serde/shape_list_changed_blocks.rs

@@ -1,1 +195,287 @@
    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_list_changed_blocks_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::list_changed_blocks::ListChangedBlocksOutput, crate::operation::list_changed_blocks::ListChangedBlocksError>
    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::list_changed_blocks::ListChangedBlocksError::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::list_changed_blocks::ListChangedBlocksError::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   
        "AccessDeniedException" => crate::operation::list_changed_blocks::ListChangedBlocksError::AccessDeniedError({
          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::AccessDeniedErrorBuilder::default();
   25         -
                output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
   27         -
                let output = output.meta(generic);
   28         -
                crate::serde_util::access_denied_exception_correct_errors(output)
   29         -
                    .build()
   30         -
                    .map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::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::AccessDeniedErrorBuilder::default();
          35  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output).map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
          36  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          37  +
                    /* ClientBuilderInstantiator.kt:46 */crate::serde_util::access_denied_exception_correct_errors(output).build().map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?
          38  +
                /* ProtocolParserGenerator.kt:146 */}
          39  +
            /* ProtocolParserGenerator.kt:145 */;
          40  +
            /* ProtocolParserGenerator.kt:170 */
   32     41   
            if tmp.message.is_none() {
   33     42   
                tmp.message = _error_message;
   34     43   
            }
          44  +
            /* ProtocolParserGenerator.kt:179 */
   35     45   
            tmp
          46  +
            /* ProtocolParserGenerator.kt:139 */
   36     47   
        }),
          48  +
        /* ProtocolParserGenerator.kt:139 */
   37     49   
        "InternalServerException" => crate::operation::list_changed_blocks::ListChangedBlocksError::InternalServerError({
          50  +
            /* RustType.kt:516 */
   38     51   
            #[allow(unused_mut)]
   39         -
            let mut tmp = {
   40         -
                #[allow(unused_mut)]
   41         -
                let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
   42         -
                output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
   43         -
                    .map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
   44         -
                let output = output.meta(generic);
   45         -
                output.build()
   46         -
            };
          52  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          53  +
                /* ProtocolParserGenerator.kt:146 */ {
          54  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          55  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
          56  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output).map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
          57  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          58  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          59  +
                /* ProtocolParserGenerator.kt:146 */}
          60  +
            /* ProtocolParserGenerator.kt:145 */;
          61  +
            /* ProtocolParserGenerator.kt:170 */
   47     62   
            if tmp.message.is_none() {
   48     63   
                tmp.message = _error_message;
   49     64   
            }
          65  +
            /* ProtocolParserGenerator.kt:179 */
   50     66   
            tmp
          67  +
            /* ProtocolParserGenerator.kt:139 */
   51     68   
        }),
          69  +
        /* ProtocolParserGenerator.kt:139 */
   52     70   
        "RequestThrottledException" => crate::operation::list_changed_blocks::ListChangedBlocksError::RequestThrottledError({
          71  +
            /* RustType.kt:516 */
   53     72   
            #[allow(unused_mut)]
   54         -
            let mut tmp = {
   55         -
                #[allow(unused_mut)]
   56         -
                let mut output = crate::types::error::builders::RequestThrottledErrorBuilder::default();
   57         -
                output = crate::protocol_serde::shape_request_throttled_exception::de_request_throttled_exception_json_err(_response_body, output)
   58         -
                    .map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
   59         -
                let output = output.meta(generic);
   60         -
                output.build()
   61         -
            };
          73  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          74  +
                /* ProtocolParserGenerator.kt:146 */ {
          75  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          76  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::RequestThrottledErrorBuilder::default();
          77  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_request_throttled_exception::de_request_throttled_exception_json_err(_response_body, output).map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
          78  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          79  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
          80  +
                /* ProtocolParserGenerator.kt:146 */}
          81  +
            /* ProtocolParserGenerator.kt:145 */;
          82  +
            /* ProtocolParserGenerator.kt:170 */
   62     83   
            if tmp.message.is_none() {
   63     84   
                tmp.message = _error_message;
   64     85   
            }
          86  +
            /* ProtocolParserGenerator.kt:179 */
   65     87   
            tmp
          88  +
            /* ProtocolParserGenerator.kt:139 */
   66     89   
        }),
          90  +
        /* ProtocolParserGenerator.kt:139 */
   67     91   
        "ResourceNotFoundException" => crate::operation::list_changed_blocks::ListChangedBlocksError::ResourceNotFoundError({
          92  +
            /* RustType.kt:516 */
   68     93   
            #[allow(unused_mut)]
   69         -
            let mut tmp = {
   70         -
                #[allow(unused_mut)]
   71         -
                let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
   72         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   73         -
                    .map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
   74         -
                let output = output.meta(generic);
   75         -
                output.build()
   76         -
            };
          94  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          95  +
                /* ProtocolParserGenerator.kt:146 */ {
          96  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          97  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
          98  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output).map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
          99  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         100  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         101  +
                /* ProtocolParserGenerator.kt:146 */}
         102  +
            /* ProtocolParserGenerator.kt:145 */;
         103  +
            /* ProtocolParserGenerator.kt:170 */
   77    104   
            if tmp.message.is_none() {
   78    105   
                tmp.message = _error_message;
   79    106   
            }
         107  +
            /* ProtocolParserGenerator.kt:179 */
   80    108   
            tmp
         109  +
            /* ProtocolParserGenerator.kt:139 */
   81    110   
        }),
         111  +
        /* ProtocolParserGenerator.kt:139 */
   82    112   
        "ServiceQuotaExceededException" => crate::operation::list_changed_blocks::ListChangedBlocksError::ServiceQuotaExceededError({
         113  +
            /* RustType.kt:516 */
   83    114   
            #[allow(unused_mut)]
   84         -
            let mut tmp = {
   85         -
                #[allow(unused_mut)]
   86         -
                let mut output = crate::types::error::builders::ServiceQuotaExceededErrorBuilder::default();
   87         -
                output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
   88         -
                    _response_body,
   89         -
                    output,
   90         -
                )
   91         -
                .map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
   92         -
                let output = output.meta(generic);
   93         -
                output.build()
   94         -
            };
         115  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         116  +
                /* ProtocolParserGenerator.kt:146 */ {
         117  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         118  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ServiceQuotaExceededErrorBuilder::default();
         119  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
         120  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         121  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         122  +
                /* ProtocolParserGenerator.kt:146 */}
         123  +
            /* ProtocolParserGenerator.kt:145 */;
         124  +
            /* ProtocolParserGenerator.kt:170 */
   95    125   
            if tmp.message.is_none() {
   96    126   
                tmp.message = _error_message;
   97    127   
            }
         128  +
            /* ProtocolParserGenerator.kt:179 */
   98    129   
            tmp
         130  +
            /* ProtocolParserGenerator.kt:139 */
   99    131   
        }),
         132  +
        /* ProtocolParserGenerator.kt:139 */
  100    133   
        "ValidationException" => crate::operation::list_changed_blocks::ListChangedBlocksError::ValidationError({
         134  +
            /* RustType.kt:516 */
  101    135   
            #[allow(unused_mut)]
  102         -
            let mut tmp = {
  103         -
                #[allow(unused_mut)]
  104         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
  105         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
  106         -
                    .map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
  107         -
                let output = output.meta(generic);
  108         -
                output.build()
  109         -
            };
         136  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
         137  +
                /* ProtocolParserGenerator.kt:146 */ {
         138  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
         139  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
         140  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output).map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
         141  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
         142  +
                    /* ClientBuilderInstantiator.kt:56 */output.build()
         143  +
                /* ProtocolParserGenerator.kt:146 */}
         144  +
            /* ProtocolParserGenerator.kt:145 */;
         145  +
            /* ProtocolParserGenerator.kt:170 */
  110    146   
            if tmp.message.is_none() {
  111    147   
                tmp.message = _error_message;
  112    148   
            }
         149  +
            /* ProtocolParserGenerator.kt:179 */
  113    150   
            tmp
         151  +
            /* ProtocolParserGenerator.kt:139 */
  114    152   
        }),
  115         -
        _ => crate::operation::list_changed_blocks::ListChangedBlocksError::generic(generic),
         153  +
        /* ProtocolParserGenerator.kt:182 */
         154  +
        _ => crate::operation::list_changed_blocks::ListChangedBlocksError::generic(generic), /* ProtocolParserGenerator.kt:133 */
  116    155   
    })
         156  +
    /* ProtocolParserGenerator.kt:99 */
  117    157   
}
  118    158   
         159  +
/* RustType.kt:516 */
  119    160   
#[allow(clippy::unnecessary_wraps)]
         161  +
/* ProtocolParserGenerator.kt:71 */
  120    162   
pub fn de_list_changed_blocks_http_response(
  121    163   
    _response_status: u16,
  122    164   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  123    165   
    _response_body: &[u8],
  124    166   
) -> std::result::Result<crate::operation::list_changed_blocks::ListChangedBlocksOutput, crate::operation::list_changed_blocks::ListChangedBlocksError>
  125    167   
{
         168  +
    /* ProtocolParserGenerator.kt:77 */
  126    169   
    Ok({
         170  +
        /* RustType.kt:516 */
  127    171   
        #[allow(unused_mut)]
         172  +
        /* ProtocolParserGenerator.kt:240 */
  128    173   
        let mut output = crate::operation::list_changed_blocks::builders::ListChangedBlocksOutputBuilder::default();
         174  +
        /* ProtocolParserGenerator.kt:247 */
  129    175   
        output = crate::protocol_serde::shape_list_changed_blocks::de_list_changed_blocks(_response_body, output)
  130    176   
            .map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
         177  +
        /* ClientBuilderInstantiator.kt:56 */
  131    178   
        output.build()
         179  +
        /* ProtocolParserGenerator.kt:77 */
  132    180   
    })
         181  +
    /* ProtocolParserGenerator.kt:71 */
  133    182   
}
  134    183   
         184  +
/* JsonParserGenerator.kt:148 */
  135    185   
pub(crate) fn de_list_changed_blocks(
  136    186   
    value: &[u8],
  137    187   
    mut builder: crate::operation::list_changed_blocks::builders::ListChangedBlocksOutputBuilder,
  138    188   
) -> ::std::result::Result<
  139    189   
    crate::operation::list_changed_blocks::builders::ListChangedBlocksOutputBuilder,
  140    190   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  141    191   
> {
         192  +
    /* JsonParserGenerator.kt:153 */
  142    193   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
  143    194   
    let tokens = &mut tokens_owned;
  144    195   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         196  +
    /* JsonParserGenerator.kt:684 */
  145    197   
    loop {
         198  +
        /* JsonParserGenerator.kt:685 */
  146    199   
        match tokens.next().transpose()? {
  147         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  148         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  149         -
                "BlockSize" => {
  150         -
                    builder = builder.set_block_size(
  151         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  152         -
                            .map(i32::try_from)
  153         -
                            .transpose()?,
  154         -
                    );
         200  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
         201  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         202  +
                /* JsonParserGenerator.kt:260 */
         203  +
                match key.to_unescaped()?.as_ref() {
         204  +
                    /* JsonParserGenerator.kt:262 */
         205  +
                    "BlockSize" => {
         206  +
                        /* JsonParserGenerator.kt:265 */
         207  +
                        builder = builder.set_block_size(
         208  +
                            /* JsonParserGenerator.kt:365 */
         209  +
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
         210  +
                                .map(i32::try_from)
         211  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
         212  +
                        );
         213  +
                        /* JsonParserGenerator.kt:262 */
         214  +
                    }
         215  +
                    /* JsonParserGenerator.kt:262 */
         216  +
                    "ChangedBlocks" => {
         217  +
                        /* JsonParserGenerator.kt:265 */
         218  +
                        builder = builder.set_changed_blocks(
         219  +
                            /* JsonParserGenerator.kt:451 */
         220  +
                            crate::protocol_serde::shape_changed_blocks::de_changed_blocks(tokens)?, /* JsonParserGenerator.kt:265 */
         221  +
                        );
         222  +
                        /* JsonParserGenerator.kt:262 */
         223  +
                    }
         224  +
                    /* JsonParserGenerator.kt:262 */
         225  +
                    "ExpiryTime" => {
         226  +
                        /* JsonParserGenerator.kt:265 */
         227  +
                        builder = builder.set_expiry_time(
         228  +
                            /* JsonParserGenerator.kt:384 */
         229  +
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
         230  +
                                tokens.next(),
         231  +
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
         232  +
                            )?, /* JsonParserGenerator.kt:265 */
         233  +
                        );
         234  +
                        /* JsonParserGenerator.kt:262 */
         235  +
                    }
         236  +
                    /* JsonParserGenerator.kt:262 */
         237  +
                    "NextToken" => {
         238  +
                        /* JsonParserGenerator.kt:265 */
         239  +
                        builder = builder.set_next_token(
         240  +
                            /* JsonParserGenerator.kt:354 */
         241  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
         242  +
                                .map(|s|
         243  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         244  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         245  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         246  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
         247  +
                        );
         248  +
                        /* JsonParserGenerator.kt:262 */
         249  +
                    }
         250  +
                    /* JsonParserGenerator.kt:262 */
         251  +
                    "VolumeSize" => {
         252  +
                        /* JsonParserGenerator.kt:265 */
         253  +
                        builder = builder.set_volume_size(
         254  +
                            /* JsonParserGenerator.kt:365 */
         255  +
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
         256  +
                                .map(i64::try_from)
         257  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
         258  +
                        );
         259  +
                        /* JsonParserGenerator.kt:262 */
         260  +
                    }
         261  +
                    /* JsonParserGenerator.kt:290 */
         262  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  155    263   
                }
  156         -
                "ChangedBlocks" => {
  157         -
                    builder = builder.set_changed_blocks(crate::protocol_serde::shape_changed_blocks::de_changed_blocks(tokens)?);
  158         -
                }
  159         -
                "ExpiryTime" => {
  160         -
                    builder = builder.set_expiry_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
  161         -
                        tokens.next(),
  162         -
                        ::aws_smithy_types::date_time::Format::EpochSeconds,
  163         -
                    )?);
  164         -
                }
  165         -
                "NextToken" => {
  166         -
                    builder = builder.set_next_token(
  167         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  168         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  169         -
                            .transpose()?,
  170         -
                    );
  171         -
                }
  172         -
                "VolumeSize" => {
  173         -
                    builder = builder.set_volume_size(
  174         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  175         -
                            .map(i64::try_from)
  176         -
                            .transpose()?,
  177         -
                    );
  178         -
                }
  179         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  180         -
            },
         264  +
                /* JsonParserGenerator.kt:686 */
         265  +
            }
         266  +
            /* JsonParserGenerator.kt:695 */
  181    267   
            other => {
  182    268   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  183    269   
                    "expected object key or end object, found: {:?}",
  184    270   
                    other
  185    271   
                )))
  186         -
            }
         272  +
            } /* JsonParserGenerator.kt:685 */
  187    273   
        }
         274  +
        /* JsonParserGenerator.kt:684 */
  188    275   
    }
         276  +
    /* JsonParserGenerator.kt:250 */
  189    277   
    if tokens.next().is_some() {
         278  +
        /* JsonParserGenerator.kt:251 */
  190    279   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  191    280   
            "found more JSON tokens after completing parsing",
  192    281   
        ));
         282  +
        /* JsonParserGenerator.kt:250 */
  193    283   
    }
         284  +
    /* JsonParserGenerator.kt:163 */
  194    285   
    Ok(builder)
         286  +
    /* JsonParserGenerator.kt:148 */
  195    287   
}