Client Test

Client Test

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406 (ignoring whitespace)

Files changed:

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

@@ -87,87 +337,347 @@
  107    107   
    "com.amazonaws.ebs.synthetic",
  108    108   
    "StartSnapshotInput",
  109    109   
);
  110    110   
static STARTSNAPSHOTINPUT_MEMBER_TIMEOUT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  111    111   
    ::aws_smithy_schema::ShapeId::from_static(
  112    112   
        "com.amazonaws.ebs.synthetic#StartSnapshotInput$Timeout",
  113    113   
        "com.amazonaws.ebs.synthetic",
  114    114   
        "StartSnapshotInput",
  115    115   
    ),
  116    116   
    ::aws_smithy_schema::ShapeType::Integer,
  117         -
    "timeout",
         117  +
    "Timeout",
  118    118   
    0,
  119    119   
);
  120    120   
static STARTSNAPSHOTINPUT_MEMBER_CLIENT_TOKEN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  121    121   
    ::aws_smithy_schema::ShapeId::from_static(
  122    122   
        "com.amazonaws.ebs.synthetic#StartSnapshotInput$ClientToken",
  123    123   
        "com.amazonaws.ebs.synthetic",
  124    124   
        "StartSnapshotInput",
  125    125   
    ),
  126    126   
    ::aws_smithy_schema::ShapeType::String,
  127         -
    "client_token",
         127  +
    "ClientToken",
  128    128   
    1,
  129    129   
);
  130    130   
static STARTSNAPSHOTINPUT_MEMBER_VOLUME_SIZE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  131    131   
    ::aws_smithy_schema::ShapeId::from_static(
  132    132   
        "com.amazonaws.ebs.synthetic#StartSnapshotInput$VolumeSize",
  133    133   
        "com.amazonaws.ebs.synthetic",
  134    134   
        "StartSnapshotInput",
  135    135   
    ),
  136    136   
    ::aws_smithy_schema::ShapeType::Long,
  137         -
    "volume_size",
         137  +
    "VolumeSize",
  138    138   
    2,
  139    139   
);
  140    140   
static STARTSNAPSHOTINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  141    141   
    ::aws_smithy_schema::ShapeId::from_static(
  142    142   
        "com.amazonaws.ebs.synthetic#StartSnapshotInput$Tags",
  143    143   
        "com.amazonaws.ebs.synthetic",
  144    144   
        "StartSnapshotInput",
  145    145   
    ),
  146    146   
    ::aws_smithy_schema::ShapeType::List,
  147         -
    "tags",
         147  +
    "Tags",
  148    148   
    3,
  149    149   
);
  150    150   
static STARTSNAPSHOTINPUT_MEMBER_ENCRYPTED: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  151    151   
    ::aws_smithy_schema::ShapeId::from_static(
  152    152   
        "com.amazonaws.ebs.synthetic#StartSnapshotInput$Encrypted",
  153    153   
        "com.amazonaws.ebs.synthetic",
  154    154   
        "StartSnapshotInput",
  155    155   
    ),
  156    156   
    ::aws_smithy_schema::ShapeType::Boolean,
  157         -
    "encrypted",
         157  +
    "Encrypted",
  158    158   
    4,
  159    159   
);
  160    160   
static STARTSNAPSHOTINPUT_MEMBER_KMS_KEY_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  161    161   
    ::aws_smithy_schema::ShapeId::from_static(
  162    162   
        "com.amazonaws.ebs.synthetic#StartSnapshotInput$KmsKeyArn",
  163    163   
        "com.amazonaws.ebs.synthetic",
  164    164   
        "StartSnapshotInput",
  165    165   
    ),
  166    166   
    ::aws_smithy_schema::ShapeType::String,
  167         -
    "kms_key_arn",
         167  +
    "KmsKeyArn",
  168    168   
    5,
  169    169   
);
  170    170   
static STARTSNAPSHOTINPUT_MEMBER_PARENT_SNAPSHOT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  171    171   
    ::aws_smithy_schema::ShapeId::from_static(
  172    172   
        "com.amazonaws.ebs.synthetic#StartSnapshotInput$ParentSnapshotId",
  173    173   
        "com.amazonaws.ebs.synthetic",
  174    174   
        "StartSnapshotInput",
  175    175   
    ),
  176    176   
    ::aws_smithy_schema::ShapeType::String,
  177         -
    "parent_snapshot_id",
         177  +
    "ParentSnapshotId",
  178    178   
    6,
  179    179   
);
  180    180   
static STARTSNAPSHOTINPUT_MEMBER_DESCRIPTION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  181    181   
    ::aws_smithy_schema::ShapeId::from_static(
  182    182   
        "com.amazonaws.ebs.synthetic#StartSnapshotInput$Description",
  183    183   
        "com.amazonaws.ebs.synthetic",
  184    184   
        "StartSnapshotInput",
  185    185   
    ),
  186    186   
    ::aws_smithy_schema::ShapeType::String,
  187         -
    "description",
         187  +
    "Description",
  188    188   
    7,
  189    189   
);
  190    190   
static STARTSNAPSHOTINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  191    191   
    STARTSNAPSHOTINPUT_SCHEMA_ID,
  192    192   
    ::aws_smithy_schema::ShapeType::Structure,
  193    193   
    &[
  194    194   
        &STARTSNAPSHOTINPUT_MEMBER_TIMEOUT,
  195    195   
        &STARTSNAPSHOTINPUT_MEMBER_CLIENT_TOKEN,
  196    196   
        &STARTSNAPSHOTINPUT_MEMBER_VOLUME_SIZE,
  197    197   
        &STARTSNAPSHOTINPUT_MEMBER_TAGS,
  198    198   
        &STARTSNAPSHOTINPUT_MEMBER_ENCRYPTED,
  199    199   
        &STARTSNAPSHOTINPUT_MEMBER_KMS_KEY_ARN,
  200    200   
        &STARTSNAPSHOTINPUT_MEMBER_PARENT_SNAPSHOT_ID,
  201    201   
        &STARTSNAPSHOTINPUT_MEMBER_DESCRIPTION,
  202    202   
    ],
  203         -
);
         203  +
)
         204  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/snapshots", Some(201)));
  204    205   
impl StartSnapshotInput {
  205    206   
    /// The schema for this shape.
  206    207   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STARTSNAPSHOTINPUT_SCHEMA;
  207    208   
}
  208    209   
impl ::aws_smithy_schema::serde::SerializableStruct for StartSnapshotInput {
  209    210   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  210    211   
    fn serialize_members(
  211    212   
        &self,
  212    213   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  213    214   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  214    215   
        if let Some(ref val) = self.timeout {
  215    216   
            ser.write_integer(&STARTSNAPSHOTINPUT_MEMBER_TIMEOUT, *val)?;
  216    217   
        }
  217    218   
        if let Some(ref val) = self.client_token {
  218    219   
            ser.write_string(&STARTSNAPSHOTINPUT_MEMBER_CLIENT_TOKEN, val)?;
  219    220   
        }
  220    221   
        if let Some(ref val) = self.volume_size {
  221    222   
            ser.write_long(&STARTSNAPSHOTINPUT_MEMBER_VOLUME_SIZE, *val)?;
  222    223   
        }
  223    224   
        if let Some(ref val) = self.tags {
  224    225   
            ser.write_list(
  225    226   
                &STARTSNAPSHOTINPUT_MEMBER_TAGS,
  226    227   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  227    228   
                    for item in val {
  228    229   
                        ser.write_struct(crate::types::Tag::SCHEMA, item)?;
  229    230   
                    }
  230    231   
                    Ok(())
  231    232   
                },
  232    233   
            )?;
  233    234   
        }
  234    235   
        if let Some(ref val) = self.encrypted {
  235    236   
            ser.write_boolean(&STARTSNAPSHOTINPUT_MEMBER_ENCRYPTED, *val)?;
  236    237   
        }
  237    238   
        if let Some(ref val) = self.kms_key_arn {
  238    239   
            ser.write_string(&STARTSNAPSHOTINPUT_MEMBER_KMS_KEY_ARN, val)?;
  239    240   
        }
  240    241   
        if let Some(ref val) = self.parent_snapshot_id {
  241    242   
            ser.write_string(&STARTSNAPSHOTINPUT_MEMBER_PARENT_SNAPSHOT_ID, val)?;
  242    243   
        }
  243    244   
        if let Some(ref val) = self.description {
  244    245   
            ser.write_string(&STARTSNAPSHOTINPUT_MEMBER_DESCRIPTION, val)?;
  245    246   
        }
  246    247   
        Ok(())
  247    248   
    }
  248    249   
}
  249    250   
impl StartSnapshotInput {
  250    251   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  251         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  252         -
        deserializer: &mut D,
         252  +
    pub fn deserialize(
         253  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  253    254   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  254    255   
        #[allow(unused_variables, unused_mut)]
  255    256   
        let mut builder = Self::builder();
  256    257   
        #[allow(
  257    258   
            unused_variables,
  258    259   
            unreachable_code,
  259    260   
            clippy::single_match,
  260    261   
            clippy::match_single_binding,
  261    262   
            clippy::diverging_sub_expression
  262    263   
        )]
  263         -
        deserializer.read_struct(&STARTSNAPSHOTINPUT_SCHEMA, (), |_, member, deser| {
         264  +
        deserializer.read_struct(&STARTSNAPSHOTINPUT_SCHEMA, &mut |member, deser| {
  264    265   
            match member.member_index() {
  265    266   
                Some(0) => {
  266    267   
                    builder.timeout = Some(deser.read_integer(member)?);
  267    268   
                }
  268    269   
                Some(1) => {
  269    270   
                    builder.client_token = Some(deser.read_string(member)?);
  270    271   
                }
  271    272   
                Some(2) => {
  272    273   
                    builder.volume_size = Some(deser.read_long(member)?);
  273    274   
                }
  274    275   
                Some(3) => {
  275    276   
                    builder.tags = Some({
  276         -
                        let container = if let Some(cap) = deser.container_size() {
  277         -
                            Vec::with_capacity(cap)
  278         -
                        } else {
  279         -
                            Vec::new()
  280         -
                        };
  281         -
                        deser.read_list(member, container, |mut list, deser| {
  282         -
                            list.push(crate::types::Tag::deserialize(deser)?);
  283         -
                            Ok(list)
  284         -
                        })?
         277  +
                        let mut container = Vec::new();
         278  +
                        deser.read_list(member, &mut |deser| {
         279  +
                            container.push(crate::types::Tag::deserialize(deser)?);
         280  +
                            Ok(())
         281  +
                        })?;
         282  +
                        container
  285    283   
                    });
  286    284   
                }
  287    285   
                Some(4) => {
  288    286   
                    builder.encrypted = Some(deser.read_boolean(member)?);
  289    287   
                }
  290    288   
                Some(5) => {
  291    289   
                    builder.kms_key_arn = Some(deser.read_string(member)?);
  292    290   
                }
  293    291   
                Some(6) => {
  294    292   
                    builder.parent_snapshot_id = Some(deser.read_string(member)?);
  295    293   
                }
  296    294   
                Some(7) => {
  297    295   
                    builder.description = Some(deser.read_string(member)?);
  298    296   
                }
  299    297   
                _ => {}
  300    298   
            }
  301    299   
            Ok(())
  302    300   
        })?;
         301  +
        builder.volume_size = builder.volume_size.or(Some(0i64));
  303    302   
        builder
  304    303   
            .build()
  305    304   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  306    305   
    }
  307    306   
}
         307  +
impl StartSnapshotInput {
         308  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         309  +
    pub fn deserialize_with_response(
         310  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         311  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         312  +
        _status: u16,
         313  +
        _body: &[u8],
         314  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         315  +
        Self::deserialize(deserializer)
         316  +
    }
         317  +
}
  308    318   
impl StartSnapshotInput {
  309    319   
    /// Creates a new builder-style object to manufacture [`StartSnapshotInput`](crate::operation::start_snapshot::StartSnapshotInput).
  310    320   
    pub fn builder() -> crate::operation::start_snapshot::builders::StartSnapshotInputBuilder {
  311    321   
        crate::operation::start_snapshot::builders::StartSnapshotInputBuilder::default()
  312    322   
    }
  313    323   
}
  314    324   
  315    325   
/// A builder for [`StartSnapshotInput`](crate::operation::start_snapshot::StartSnapshotInput).
  316    326   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
  317    327   
#[non_exhaustive]

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

@@ -69,69 +219,219 @@
   89     89   
    "com.amazonaws.ebs.synthetic",
   90     90   
    "StartSnapshotOutput",
   91     91   
);
   92     92   
static STARTSNAPSHOTOUTPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   93     93   
    ::aws_smithy_schema::ShapeId::from_static(
   94     94   
        "com.amazonaws.ebs.synthetic#StartSnapshotOutput$Tags",
   95     95   
        "com.amazonaws.ebs.synthetic",
   96     96   
        "StartSnapshotOutput",
   97     97   
    ),
   98     98   
    ::aws_smithy_schema::ShapeType::List,
   99         -
    "tags",
          99  +
    "Tags",
  100    100   
    0,
  101    101   
);
  102    102   
static STARTSNAPSHOTOUTPUT_MEMBER_KMS_KEY_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  103    103   
    ::aws_smithy_schema::ShapeId::from_static(
  104    104   
        "com.amazonaws.ebs.synthetic#StartSnapshotOutput$KmsKeyArn",
  105    105   
        "com.amazonaws.ebs.synthetic",
  106    106   
        "StartSnapshotOutput",
  107    107   
    ),
  108    108   
    ::aws_smithy_schema::ShapeType::String,
  109         -
    "kms_key_arn",
         109  +
    "KmsKeyArn",
  110    110   
    1,
  111    111   
);
  112    112   
static STARTSNAPSHOTOUTPUT_MEMBER_OWNER_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  113    113   
    ::aws_smithy_schema::ShapeId::from_static(
  114    114   
        "com.amazonaws.ebs.synthetic#StartSnapshotOutput$OwnerId",
  115    115   
        "com.amazonaws.ebs.synthetic",
  116    116   
        "StartSnapshotOutput",
  117    117   
    ),
  118    118   
    ::aws_smithy_schema::ShapeType::String,
  119         -
    "owner_id",
         119  +
    "OwnerId",
  120    120   
    2,
  121    121   
);
  122    122   
static STARTSNAPSHOTOUTPUT_MEMBER_VOLUME_SIZE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  123    123   
    ::aws_smithy_schema::ShapeId::from_static(
  124    124   
        "com.amazonaws.ebs.synthetic#StartSnapshotOutput$VolumeSize",
  125    125   
        "com.amazonaws.ebs.synthetic",
  126    126   
        "StartSnapshotOutput",
  127    127   
    ),
  128    128   
    ::aws_smithy_schema::ShapeType::Long,
  129         -
    "volume_size",
         129  +
    "VolumeSize",
  130    130   
    3,
  131    131   
);
  132    132   
static STARTSNAPSHOTOUTPUT_MEMBER_PARENT_SNAPSHOT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  133    133   
    ::aws_smithy_schema::ShapeId::from_static(
  134    134   
        "com.amazonaws.ebs.synthetic#StartSnapshotOutput$ParentSnapshotId",
  135    135   
        "com.amazonaws.ebs.synthetic",
  136    136   
        "StartSnapshotOutput",
  137    137   
    ),
  138    138   
    ::aws_smithy_schema::ShapeType::String,
  139         -
    "parent_snapshot_id",
         139  +
    "ParentSnapshotId",
  140    140   
    4,
  141    141   
);
  142    142   
static STARTSNAPSHOTOUTPUT_MEMBER_DESCRIPTION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  143    143   
    ::aws_smithy_schema::ShapeId::from_static(
  144    144   
        "com.amazonaws.ebs.synthetic#StartSnapshotOutput$Description",
  145    145   
        "com.amazonaws.ebs.synthetic",
  146    146   
        "StartSnapshotOutput",
  147    147   
    ),
  148    148   
    ::aws_smithy_schema::ShapeType::String,
  149         -
    "description",
         149  +
    "Description",
  150    150   
    5,
  151    151   
);
  152    152   
static STARTSNAPSHOTOUTPUT_MEMBER_SNAPSHOT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  153    153   
    ::aws_smithy_schema::ShapeId::from_static(
  154    154   
        "com.amazonaws.ebs.synthetic#StartSnapshotOutput$SnapshotId",
  155    155   
        "com.amazonaws.ebs.synthetic",
  156    156   
        "StartSnapshotOutput",
  157    157   
    ),
  158    158   
    ::aws_smithy_schema::ShapeType::String,
  159         -
    "snapshot_id",
         159  +
    "SnapshotId",
  160    160   
    6,
  161    161   
);
  162    162   
static STARTSNAPSHOTOUTPUT_MEMBER_BLOCK_SIZE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  163    163   
    ::aws_smithy_schema::ShapeId::from_static(
  164    164   
        "com.amazonaws.ebs.synthetic#StartSnapshotOutput$BlockSize",
  165    165   
        "com.amazonaws.ebs.synthetic",
  166    166   
        "StartSnapshotOutput",
  167    167   
    ),
  168    168   
    ::aws_smithy_schema::ShapeType::Integer,
  169         -
    "block_size",
         169  +
    "BlockSize",
  170    170   
    7,
  171    171   
);
  172    172   
static STARTSNAPSHOTOUTPUT_MEMBER_START_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  173    173   
    ::aws_smithy_schema::ShapeId::from_static(
  174    174   
        "com.amazonaws.ebs.synthetic#StartSnapshotOutput$StartTime",
  175    175   
        "com.amazonaws.ebs.synthetic",
  176    176   
        "StartSnapshotOutput",
  177    177   
    ),
  178    178   
    ::aws_smithy_schema::ShapeType::Timestamp,
  179         -
    "start_time",
         179  +
    "StartTime",
  180    180   
    8,
  181    181   
);
  182    182   
static STARTSNAPSHOTOUTPUT_MEMBER_STATUS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  183    183   
    ::aws_smithy_schema::ShapeId::from_static(
  184    184   
        "com.amazonaws.ebs.synthetic#StartSnapshotOutput$Status",
  185    185   
        "com.amazonaws.ebs.synthetic",
  186    186   
        "StartSnapshotOutput",
  187    187   
    ),
  188    188   
    ::aws_smithy_schema::ShapeType::String,
  189         -
    "status",
         189  +
    "Status",
  190    190   
    9,
  191    191   
);
  192    192   
static STARTSNAPSHOTOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  193    193   
    STARTSNAPSHOTOUTPUT_SCHEMA_ID,
  194    194   
    ::aws_smithy_schema::ShapeType::Structure,
  195    195   
    &[
  196    196   
        &STARTSNAPSHOTOUTPUT_MEMBER_TAGS,
  197    197   
        &STARTSNAPSHOTOUTPUT_MEMBER_KMS_KEY_ARN,
  198    198   
        &STARTSNAPSHOTOUTPUT_MEMBER_OWNER_ID,
  199    199   
        &STARTSNAPSHOTOUTPUT_MEMBER_VOLUME_SIZE,
@@ -231,231 +351,359 @@
  251    251   
            ser.write_timestamp(&STARTSNAPSHOTOUTPUT_MEMBER_START_TIME, val)?;
  252    252   
        }
  253    253   
        if let Some(ref val) = self.status {
  254    254   
            ser.write_string(&STARTSNAPSHOTOUTPUT_MEMBER_STATUS, val.as_str())?;
  255    255   
        }
  256    256   
        Ok(())
  257    257   
    }
  258    258   
}
  259    259   
impl StartSnapshotOutput {
  260    260   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  261         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  262         -
        deserializer: &mut D,
         261  +
    pub fn deserialize(
         262  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  263    263   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  264    264   
        #[allow(unused_variables, unused_mut)]
  265    265   
        let mut builder = Self::builder();
  266    266   
        #[allow(
  267    267   
            unused_variables,
  268    268   
            unreachable_code,
  269    269   
            clippy::single_match,
  270    270   
            clippy::match_single_binding,
  271    271   
            clippy::diverging_sub_expression
  272    272   
        )]
  273         -
        deserializer.read_struct(&STARTSNAPSHOTOUTPUT_SCHEMA, (), |_, member, deser| {
         273  +
        deserializer.read_struct(&STARTSNAPSHOTOUTPUT_SCHEMA, &mut |member, deser| {
  274    274   
            match member.member_index() {
  275    275   
                Some(0) => {
  276    276   
                    builder.tags = Some({
  277         -
                        let container = if let Some(cap) = deser.container_size() {
  278         -
                            Vec::with_capacity(cap)
  279         -
                        } else {
  280         -
                            Vec::new()
  281         -
                        };
  282         -
                        deser.read_list(member, container, |mut list, deser| {
  283         -
                            list.push(crate::types::Tag::deserialize(deser)?);
  284         -
                            Ok(list)
  285         -
                        })?
         277  +
                        let mut container = Vec::new();
         278  +
                        deser.read_list(member, &mut |deser| {
         279  +
                            container.push(crate::types::Tag::deserialize(deser)?);
         280  +
                            Ok(())
         281  +
                        })?;
         282  +
                        container
  286    283   
                    });
  287    284   
                }
  288    285   
                Some(1) => {
  289    286   
                    builder.kms_key_arn = Some(deser.read_string(member)?);
  290    287   
                }
  291    288   
                Some(2) => {
  292    289   
                    builder.owner_id = Some(deser.read_string(member)?);
  293    290   
                }
  294    291   
                Some(3) => {
  295    292   
                    builder.volume_size = Some(deser.read_long(member)?);
  296    293   
                }
  297    294   
                Some(4) => {
  298    295   
                    builder.parent_snapshot_id = Some(deser.read_string(member)?);
  299    296   
                }
  300    297   
                Some(5) => {
  301    298   
                    builder.description = Some(deser.read_string(member)?);
  302    299   
                }
  303    300   
                Some(6) => {
  304    301   
                    builder.snapshot_id = Some(deser.read_string(member)?);
  305    302   
                }
  306    303   
                Some(7) => {
  307    304   
                    builder.block_size = Some(deser.read_integer(member)?);
  308    305   
                }
  309    306   
                Some(8) => {
  310    307   
                    builder.start_time = Some(deser.read_timestamp(member)?);
  311    308   
                }
  312    309   
                Some(9) => {
  313    310   
                    builder.status = Some(crate::types::Status::from(deser.read_string(member)?.as_str()));
  314    311   
                }
  315    312   
                _ => {}
  316    313   
            }
  317    314   
            Ok(())
  318    315   
        })?;
  319    316   
        Ok(builder.build())
  320    317   
    }
  321    318   
}
         319  +
impl StartSnapshotOutput {
         320  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         321  +
    pub fn deserialize_with_response(
         322  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         323  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         324  +
        _status: u16,
         325  +
        _body: &[u8],
         326  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         327  +
        Self::deserialize(deserializer)
         328  +
    }
         329  +
}
  322    330   
impl StartSnapshotOutput {
  323    331   
    /// Creates a new builder-style object to manufacture [`StartSnapshotOutput`](crate::operation::start_snapshot::StartSnapshotOutput).
  324    332   
    pub fn builder() -> crate::operation::start_snapshot::builders::StartSnapshotOutputBuilder {
  325    333   
        crate::operation::start_snapshot::builders::StartSnapshotOutputBuilder::default()
  326    334   
    }
  327    335   
}
  328    336   
  329    337   
/// A builder for [`StartSnapshotOutput`](crate::operation::start_snapshot::StartSnapshotOutput).
  330    338   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
  331    339   
#[non_exhaustive]

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

@@ -1,1 +80,0 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn parse_http_error_metadata(
           3  +
    _response_status: u16,
           4  +
    response_headers: &::aws_smithy_runtime_api::http::Headers,
           5  +
    response_body: &[u8],
           6  +
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
           7  +
    crate::json_errors::parse_error_metadata(response_body, response_headers)
           8  +
}
           9  +
    2     10   
pub(crate) fn type_erase_result<O, E>(
    3     11   
    result: ::std::result::Result<O, E>,
    4     12   
) -> ::std::result::Result<
    5     13   
    ::aws_smithy_runtime_api::client::interceptors::context::Output,
    6     14   
    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>,
    7     15   
>
    8     16   
where
    9     17   
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10     18   
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11     19   
{
   12     20   
    result
   13     21   
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14     22   
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15     23   
        .map_err(::std::convert::Into::into)
   16     24   
}
   17     25   
   18         -
pub fn parse_http_error_metadata(
   19         -
    _response_status: u16,
   20         -
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21         -
    response_body: &[u8],
   22         -
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23         -
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   24         -
}
   25         -
   26         -
pub(crate) mod shape_complete_snapshot;
   27         -
   28     26   
pub(crate) mod shape_get_snapshot_block;
   29     27   
   30         -
pub(crate) mod shape_list_changed_blocks;
   31         -
   32         -
pub(crate) mod shape_list_snapshot_blocks;
   33         -
   34         -
pub(crate) mod shape_put_snapshot_block;
   35         -
   36         -
pub(crate) mod shape_put_snapshot_block_input;
   37         -
   38         -
pub(crate) mod shape_start_snapshot;
   39         -
   40         -
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   41         -
    if data.is_empty() {
   42         -
        b"{}"
   43         -
    } else {
   44         -
        data
   45         -
    }
   46         -
}
   47         -
   48         -
pub(crate) mod shape_access_denied_exception;
   49         -
   50         -
pub(crate) mod shape_concurrent_limit_exceeded_exception;
   51         -
   52         -
pub(crate) mod shape_conflict_exception;
   53         -
   54     28   
pub(crate) mod shape_get_snapshot_block_output;
   55         -
   56         -
pub(crate) mod shape_internal_server_exception;
   57         -
   58         -
pub(crate) mod shape_put_snapshot_block_output;
   59         -
   60         -
pub(crate) mod shape_request_throttled_exception;
   61         -
   62         -
pub(crate) mod shape_resource_not_found_exception;
   63         -
   64         -
pub(crate) mod shape_service_quota_exceeded_exception;
   65         -
   66         -
pub(crate) mod shape_start_snapshot_input;
   67         -
   68         -
pub(crate) mod shape_validation_exception;
   69         -
   70         -
pub(crate) mod shape_blocks;
   71         -
   72         -
pub(crate) mod shape_changed_blocks;
   73         -
   74         -
pub(crate) mod shape_tag;
   75         -
   76         -
pub(crate) mod shape_tags;
   77         -
   78         -
pub(crate) mod shape_block;
   79         -
   80         -
pub(crate) mod shape_changed_block;

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

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

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

@@ -1,0 +47,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_block<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::Block>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   12         -
            #[allow(unused_mut)]
   13         -
            let mut builder = crate::types::builders::BlockBuilder::default();
   14         -
            loop {
   15         -
                match tokens.next().transpose()? {
   16         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   17         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   18         -
                        "BlockToken" => {
   19         -
                            builder = builder.set_block_token(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        "BlockIndex" => {
   26         -
                            builder = builder.set_block_index(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   28         -
                                    .map(i32::try_from)
   29         -
                                    .transpose()?,
   30         -
                            );
   31         -
                        }
   32         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   33         -
                    },
   34         -
                    other => {
   35         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   36         -
                            "expected object key or end object, found: {other:?}"
   37         -
                        )))
   38         -
                    }
   39         -
                }
   40         -
            }
   41         -
            Ok(Some(builder.build()))
   42         -
        }
   43         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44         -
            "expected start object or null",
   45         -
        )),
   46         -
    }
   47         -
}

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

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

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

@@ -1,0 +54,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_changed_block<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::ChangedBlock>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   12         -
            #[allow(unused_mut)]
   13         -
            let mut builder = crate::types::builders::ChangedBlockBuilder::default();
   14         -
            loop {
   15         -
                match tokens.next().transpose()? {
   16         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   17         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   18         -
                        "FirstBlockToken" => {
   19         -
                            builder = builder.set_first_block_token(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        "BlockIndex" => {
   26         -
                            builder = builder.set_block_index(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   28         -
                                    .map(i32::try_from)
   29         -
                                    .transpose()?,
   30         -
                            );
   31         -
                        }
   32         -
                        "SecondBlockToken" => {
   33         -
                            builder = builder.set_second_block_token(
   34         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   35         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   36         -
                                    .transpose()?,
   37         -
                            );
   38         -
                        }
   39         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   40         -
                    },
   41         -
                    other => {
   42         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   43         -
                            "expected object key or end object, found: {other:?}"
   44         -
                        )))
   45         -
                    }
   46         -
                }
   47         -
            }
   48         -
            Ok(Some(builder.build()))
   49         -
        }
   50         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   51         -
            "expected start object or null",
   52         -
        )),
   53         -
    }
   54         -
}

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

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

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

@@ -1,0 +221,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_complete_snapshot_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::complete_snapshot::CompleteSnapshotOutput, crate::operation::complete_snapshot::CompleteSnapshotError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    let error_code = match generic.code() {
   13         -
        Some(code) => code,
   14         -
        None => return Err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled(generic)),
   15         -
    };
   16         -
   17         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   18         -
    Err(match error_code {
   19         -
        "AccessDeniedException" => crate::operation::complete_snapshot::CompleteSnapshotError::AccessDeniedError({
   20         -
            #[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         -
            };
   31         -
            if tmp.message.is_none() {
   32         -
                tmp.message = _error_message;
   33         -
            }
   34         -
            tmp
   35         -
        }),
   36         -
        "InternalServerException" => crate::operation::complete_snapshot::CompleteSnapshotError::InternalServerError({
   37         -
            #[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         -
            };
   46         -
            if tmp.message.is_none() {
   47         -
                tmp.message = _error_message;
   48         -
            }
   49         -
            tmp
   50         -
        }),
   51         -
        "RequestThrottledException" => crate::operation::complete_snapshot::CompleteSnapshotError::RequestThrottledError({
   52         -
            #[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         -
            };
   61         -
            if tmp.message.is_none() {
   62         -
                tmp.message = _error_message;
   63         -
            }
   64         -
            tmp
   65         -
        }),
   66         -
        "ResourceNotFoundException" => crate::operation::complete_snapshot::CompleteSnapshotError::ResourceNotFoundError({
   67         -
            #[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         -
            };
   76         -
            if tmp.message.is_none() {
   77         -
                tmp.message = _error_message;
   78         -
            }
   79         -
            tmp
   80         -
        }),
   81         -
        "ServiceQuotaExceededException" => crate::operation::complete_snapshot::CompleteSnapshotError::ServiceQuotaExceededError({
   82         -
            #[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         -
            };
   94         -
            if tmp.message.is_none() {
   95         -
                tmp.message = _error_message;
   96         -
            }
   97         -
            tmp
   98         -
        }),
   99         -
        "ValidationException" => crate::operation::complete_snapshot::CompleteSnapshotError::ValidationError({
  100         -
            #[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         -
            };
  109         -
            if tmp.message.is_none() {
  110         -
                tmp.message = _error_message;
  111         -
            }
  112         -
            tmp
  113         -
        }),
  114         -
        _ => crate::operation::complete_snapshot::CompleteSnapshotError::generic(generic),
  115         -
    })
  116         -
}
  117         -
  118         -
#[allow(clippy::unnecessary_wraps)]
  119         -
pub fn de_complete_snapshot_http_response(
  120         -
    _response_status: u16,
  121         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  122         -
    _response_body: &[u8],
  123         -
) -> std::result::Result<crate::operation::complete_snapshot::CompleteSnapshotOutput, crate::operation::complete_snapshot::CompleteSnapshotError> {
  124         -
    Ok({
  125         -
        #[allow(unused_mut)]
  126         -
        let mut output = crate::operation::complete_snapshot::builders::CompleteSnapshotOutputBuilder::default();
  127         -
        output = crate::protocol_serde::shape_complete_snapshot::de_complete_snapshot(_response_body, output)
  128         -
            .map_err(crate::operation::complete_snapshot::CompleteSnapshotError::unhandled)?;
  129         -
        output.build()
  130         -
    })
  131         -
}
  132         -
  133         -
pub fn ser_complete_snapshot_headers(
  134         -
    input: &crate::operation::complete_snapshot::CompleteSnapshotInput,
  135         -
    mut builder: ::http_1x::request::Builder,
  136         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  137         -
    if let ::std::option::Option::Some(inner_1) = &input.changed_blocks_count {
  138         -
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_1);
  139         -
        let formatted_2 = encoder.encode();
  140         -
        let header_value = formatted_2;
  141         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  142         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  143         -
                "changed_blocks_count",
  144         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  145         -
            )
  146         -
        })?;
  147         -
        builder = builder.header("x-amz-ChangedBlocksCount", header_value);
  148         -
    }
  149         -
    if let ::std::option::Option::Some(inner_3) = &input.checksum_aggregation_method {
  150         -
        let formatted_4 = inner_3.as_str();
  151         -
        let header_value = formatted_4;
  152         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  153         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  154         -
                "checksum_aggregation_method",
  155         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  156         -
            )
  157         -
        })?;
  158         -
        builder = builder.header("x-amz-Checksum-Aggregation-Method", header_value);
  159         -
    }
  160         -
    if let ::std::option::Option::Some(inner_5) = &input.checksum_algorithm {
  161         -
        let formatted_6 = inner_5.as_str();
  162         -
        let header_value = formatted_6;
  163         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  164         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  165         -
                "checksum_algorithm",
  166         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  167         -
            )
  168         -
        })?;
  169         -
        builder = builder.header("x-amz-Checksum-Algorithm", header_value);
  170         -
    }
  171         -
    if let ::std::option::Option::Some(inner_7) = &input.checksum {
  172         -
        let formatted_8 = inner_7.as_str();
  173         -
        let header_value = formatted_8;
  174         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  175         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  176         -
                "checksum",
  177         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  178         -
            )
  179         -
        })?;
  180         -
        builder = builder.header("x-amz-Checksum", header_value);
  181         -
    }
  182         -
    Ok(builder)
  183         -
}
  184         -
  185         -
pub(crate) fn de_complete_snapshot(
  186         -
    _value: &[u8],
  187         -
    mut builder: crate::operation::complete_snapshot::builders::CompleteSnapshotOutputBuilder,
  188         -
) -> ::std::result::Result<
  189         -
    crate::operation::complete_snapshot::builders::CompleteSnapshotOutputBuilder,
  190         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  191         -
> {
  192         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  193         -
    let tokens = &mut tokens_owned;
  194         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  195         -
    loop {
  196         -
        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         -
                    );
  205         -
                }
  206         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  207         -
            },
  208         -
            other => {
  209         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  210         -
                    "expected object key or end object, found: {other:?}"
  211         -
                )))
  212         -
            }
  213         -
        }
  214         -
    }
  215         -
    if tokens.next().is_some() {
  216         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  217         -
            "found more JSON tokens after completing parsing",
  218         -
        ));
  219         -
    }
  220         -
    Ok(builder)
  221         -
}

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

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

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

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

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

@@ -8,8 +153,0 @@
   28     28   
            })?,
   29     29   
        );
   30     30   
        output = output.set_data_length(
   31     31   
            crate::protocol_serde::shape_get_snapshot_block_output::de_data_length_header(_response_headers).map_err(|_| {
   32     32   
                crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled("Failed to parse DataLength from header `x-amz-Data-Length")
   33     33   
            })?,
   34     34   
        );
   35     35   
        output.build()
   36     36   
    })
   37     37   
}
   38         -
   39         -
#[allow(clippy::unnecessary_wraps)]
   40         -
pub fn de_get_snapshot_block_http_error(
   41         -
    _response_status: u16,
   42         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   43         -
    _response_body: &[u8],
   44         -
) -> std::result::Result<crate::operation::get_snapshot_block::GetSnapshotBlockOutput, crate::operation::get_snapshot_block::GetSnapshotBlockError> {
   45         -
    #[allow(unused_mut)]
   46         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   47         -
        .map_err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled)?;
   48         -
    let generic = generic_builder.build();
   49         -
    let error_code = match generic.code() {
   50         -
        Some(code) => code,
   51         -
        None => return Err(crate::operation::get_snapshot_block::GetSnapshotBlockError::unhandled(generic)),
   52         -
    };
   53         -
   54         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   55         -
    Err(match error_code {
   56         -
        "AccessDeniedException" => crate::operation::get_snapshot_block::GetSnapshotBlockError::AccessDeniedError({
   57         -
            #[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         -
            };
   68         -
            if tmp.message.is_none() {
   69         -
                tmp.message = _error_message;
   70         -
            }
   71         -
            tmp
   72         -
        }),
   73         -
        "InternalServerException" => crate::operation::get_snapshot_block::GetSnapshotBlockError::InternalServerError({
   74         -
            #[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         -
            };
   83         -
            if tmp.message.is_none() {
   84         -
                tmp.message = _error_message;
   85         -
            }
   86         -
            tmp
   87         -
        }),
   88         -
        "RequestThrottledException" => crate::operation::get_snapshot_block::GetSnapshotBlockError::RequestThrottledError({
   89         -
            #[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         -
            };
   98         -
            if tmp.message.is_none() {
   99         -
                tmp.message = _error_message;
  100         -
            }
  101         -
            tmp
  102         -
        }),
  103         -
        "ResourceNotFoundException" => crate::operation::get_snapshot_block::GetSnapshotBlockError::ResourceNotFoundError({
  104         -
            #[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         -
            };
  113         -
            if tmp.message.is_none() {
  114         -
                tmp.message = _error_message;
  115         -
            }
  116         -
            tmp
  117         -
        }),
  118         -
        "ServiceQuotaExceededException" => crate::operation::get_snapshot_block::GetSnapshotBlockError::ServiceQuotaExceededError({
  119         -
            #[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         -
            };
  131         -
            if tmp.message.is_none() {
  132         -
                tmp.message = _error_message;
  133         -
            }
  134         -
            tmp
  135         -
        }),
  136         -
        "ValidationException" => crate::operation::get_snapshot_block::GetSnapshotBlockError::ValidationError({
  137         -
            #[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         -
            };
  146         -
            if tmp.message.is_none() {
  147         -
                tmp.message = _error_message;
  148         -
            }
  149         -
            tmp
  150         -
        }),
  151         -
        _ => crate::operation::get_snapshot_block::GetSnapshotBlockError::generic(generic),
  152         -
    })
  153         -
}

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

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

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

@@ -1,0 +194,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_list_changed_blocks_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::list_changed_blocks::ListChangedBlocksOutput, crate::operation::list_changed_blocks::ListChangedBlocksError>
    8         -
{
    9         -
    #[allow(unused_mut)]
   10         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   11         -
        .map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "AccessDeniedException" => crate::operation::list_changed_blocks::ListChangedBlocksError::AccessDeniedError({
   21         -
            #[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         -
            };
   32         -
            if tmp.message.is_none() {
   33         -
                tmp.message = _error_message;
   34         -
            }
   35         -
            tmp
   36         -
        }),
   37         -
        "InternalServerException" => crate::operation::list_changed_blocks::ListChangedBlocksError::InternalServerError({
   38         -
            #[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         -
            };
   47         -
            if tmp.message.is_none() {
   48         -
                tmp.message = _error_message;
   49         -
            }
   50         -
            tmp
   51         -
        }),
   52         -
        "RequestThrottledException" => crate::operation::list_changed_blocks::ListChangedBlocksError::RequestThrottledError({
   53         -
            #[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         -
            };
   62         -
            if tmp.message.is_none() {
   63         -
                tmp.message = _error_message;
   64         -
            }
   65         -
            tmp
   66         -
        }),
   67         -
        "ResourceNotFoundException" => crate::operation::list_changed_blocks::ListChangedBlocksError::ResourceNotFoundError({
   68         -
            #[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         -
            };
   77         -
            if tmp.message.is_none() {
   78         -
                tmp.message = _error_message;
   79         -
            }
   80         -
            tmp
   81         -
        }),
   82         -
        "ServiceQuotaExceededException" => crate::operation::list_changed_blocks::ListChangedBlocksError::ServiceQuotaExceededError({
   83         -
            #[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         -
            };
   95         -
            if tmp.message.is_none() {
   96         -
                tmp.message = _error_message;
   97         -
            }
   98         -
            tmp
   99         -
        }),
  100         -
        "ValidationException" => crate::operation::list_changed_blocks::ListChangedBlocksError::ValidationError({
  101         -
            #[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         -
            };
  110         -
            if tmp.message.is_none() {
  111         -
                tmp.message = _error_message;
  112         -
            }
  113         -
            tmp
  114         -
        }),
  115         -
        _ => crate::operation::list_changed_blocks::ListChangedBlocksError::generic(generic),
  116         -
    })
  117         -
}
  118         -
  119         -
#[allow(clippy::unnecessary_wraps)]
  120         -
pub fn de_list_changed_blocks_http_response(
  121         -
    _response_status: u16,
  122         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  123         -
    _response_body: &[u8],
  124         -
) -> std::result::Result<crate::operation::list_changed_blocks::ListChangedBlocksOutput, crate::operation::list_changed_blocks::ListChangedBlocksError>
  125         -
{
  126         -
    Ok({
  127         -
        #[allow(unused_mut)]
  128         -
        let mut output = crate::operation::list_changed_blocks::builders::ListChangedBlocksOutputBuilder::default();
  129         -
        output = crate::protocol_serde::shape_list_changed_blocks::de_list_changed_blocks(_response_body, output)
  130         -
            .map_err(crate::operation::list_changed_blocks::ListChangedBlocksError::unhandled)?;
  131         -
        output.build()
  132         -
    })
  133         -
}
  134         -
  135         -
pub(crate) fn de_list_changed_blocks(
  136         -
    _value: &[u8],
  137         -
    mut builder: crate::operation::list_changed_blocks::builders::ListChangedBlocksOutputBuilder,
  138         -
) -> ::std::result::Result<
  139         -
    crate::operation::list_changed_blocks::builders::ListChangedBlocksOutputBuilder,
  140         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  141         -
> {
  142         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  143         -
    let tokens = &mut tokens_owned;
  144         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  145         -
    loop {
  146         -
        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         -
                    );
  155         -
                }
  156         -
                "ChangedBlocks" => {
  157         -
                    builder = builder.set_changed_blocks(crate::protocol_serde::shape_changed_blocks::de_changed_blocks(tokens, _value)?);
  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         -
            },
  181         -
            other => {
  182         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  183         -
                    "expected object key or end object, found: {other:?}"
  184         -
                )))
  185         -
            }
  186         -
        }
  187         -
    }
  188         -
    if tokens.next().is_some() {
  189         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  190         -
            "found more JSON tokens after completing parsing",
  191         -
        ));
  192         -
    }
  193         -
    Ok(builder)
  194         -
}