AWS SDK

AWS SDK

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406 (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/kms/src/operation/put_key_policy/_put_key_policy_input.rs

@@ -85,85 +249,262 @@
  105    105   
    "com.amazonaws.kms.synthetic",
  106    106   
    "PutKeyPolicyInput",
  107    107   
);
  108    108   
static PUTKEYPOLICYINPUT_MEMBER_KEY_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  109    109   
    ::aws_smithy_schema::ShapeId::from_static(
  110    110   
        "com.amazonaws.kms.synthetic#PutKeyPolicyInput$KeyId",
  111    111   
        "com.amazonaws.kms.synthetic",
  112    112   
        "PutKeyPolicyInput",
  113    113   
    ),
  114    114   
    ::aws_smithy_schema::ShapeType::String,
  115         -
    "key_id",
         115  +
    "KeyId",
  116    116   
    0,
  117    117   
);
  118    118   
static PUTKEYPOLICYINPUT_MEMBER_POLICY_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  119    119   
    ::aws_smithy_schema::ShapeId::from_static(
  120    120   
        "com.amazonaws.kms.synthetic#PutKeyPolicyInput$PolicyName",
  121    121   
        "com.amazonaws.kms.synthetic",
  122    122   
        "PutKeyPolicyInput",
  123    123   
    ),
  124    124   
    ::aws_smithy_schema::ShapeType::String,
  125         -
    "policy_name",
         125  +
    "PolicyName",
  126    126   
    1,
  127    127   
);
  128    128   
static PUTKEYPOLICYINPUT_MEMBER_POLICY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  129    129   
    ::aws_smithy_schema::ShapeId::from_static(
  130    130   
        "com.amazonaws.kms.synthetic#PutKeyPolicyInput$Policy",
  131    131   
        "com.amazonaws.kms.synthetic",
  132    132   
        "PutKeyPolicyInput",
  133    133   
    ),
  134    134   
    ::aws_smithy_schema::ShapeType::String,
  135         -
    "policy",
         135  +
    "Policy",
  136    136   
    2,
  137    137   
);
  138    138   
static PUTKEYPOLICYINPUT_MEMBER_BYPASS_POLICY_LOCKOUT_SAFETY_CHECK: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  139    139   
    ::aws_smithy_schema::ShapeId::from_static(
  140    140   
        "com.amazonaws.kms.synthetic#PutKeyPolicyInput$BypassPolicyLockoutSafetyCheck",
  141    141   
        "com.amazonaws.kms.synthetic",
  142    142   
        "PutKeyPolicyInput",
  143    143   
    ),
  144    144   
    ::aws_smithy_schema::ShapeType::Boolean,
  145         -
    "bypass_policy_lockout_safety_check",
         145  +
    "BypassPolicyLockoutSafetyCheck",
  146    146   
    3,
  147    147   
);
  148    148   
static PUTKEYPOLICYINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  149    149   
    PUTKEYPOLICYINPUT_SCHEMA_ID,
  150    150   
    ::aws_smithy_schema::ShapeType::Structure,
  151    151   
    &[
  152    152   
        &PUTKEYPOLICYINPUT_MEMBER_KEY_ID,
  153    153   
        &PUTKEYPOLICYINPUT_MEMBER_POLICY_NAME,
  154    154   
        &PUTKEYPOLICYINPUT_MEMBER_POLICY,
  155    155   
        &PUTKEYPOLICYINPUT_MEMBER_BYPASS_POLICY_LOCKOUT_SAFETY_CHECK,
  156    156   
    ],
  157    157   
);
  158    158   
impl PutKeyPolicyInput {
  159    159   
    /// The schema for this shape.
  160    160   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &PUTKEYPOLICYINPUT_SCHEMA;
  161    161   
}
  162    162   
impl ::aws_smithy_schema::serde::SerializableStruct for PutKeyPolicyInput {
  163    163   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  164    164   
    fn serialize_members(
  165    165   
        &self,
  166    166   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  167    167   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  168    168   
        if let Some(ref val) = self.key_id {
  169    169   
            ser.write_string(&PUTKEYPOLICYINPUT_MEMBER_KEY_ID, val)?;
  170    170   
        }
  171    171   
        if let Some(ref val) = self.policy_name {
  172    172   
            ser.write_string(&PUTKEYPOLICYINPUT_MEMBER_POLICY_NAME, val)?;
  173    173   
        }
  174    174   
        if let Some(ref val) = self.policy {
  175    175   
            ser.write_string(&PUTKEYPOLICYINPUT_MEMBER_POLICY, val)?;
  176    176   
        }
  177    177   
        if let Some(ref val) = self.bypass_policy_lockout_safety_check {
  178    178   
            ser.write_boolean(&PUTKEYPOLICYINPUT_MEMBER_BYPASS_POLICY_LOCKOUT_SAFETY_CHECK, *val)?;
  179    179   
        }
  180    180   
        Ok(())
  181    181   
    }
  182    182   
}
  183    183   
impl PutKeyPolicyInput {
  184    184   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  185         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  186         -
        deserializer: &mut D,
         185  +
    pub fn deserialize(
         186  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  187    187   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  188    188   
        #[allow(unused_variables, unused_mut)]
  189    189   
        let mut builder = Self::builder();
  190    190   
        #[allow(
  191    191   
            unused_variables,
  192    192   
            unreachable_code,
  193    193   
            clippy::single_match,
  194    194   
            clippy::match_single_binding,
  195    195   
            clippy::diverging_sub_expression
  196    196   
        )]
  197         -
        deserializer.read_struct(&PUTKEYPOLICYINPUT_SCHEMA, (), |_, member, deser| {
         197  +
        deserializer.read_struct(&PUTKEYPOLICYINPUT_SCHEMA, &mut |member, deser| {
  198    198   
            match member.member_index() {
  199    199   
                Some(0) => {
  200    200   
                    builder.key_id = Some(deser.read_string(member)?);
  201    201   
                }
  202    202   
                Some(1) => {
  203    203   
                    builder.policy_name = Some(deser.read_string(member)?);
  204    204   
                }
  205    205   
                Some(2) => {
  206    206   
                    builder.policy = Some(deser.read_string(member)?);
  207    207   
                }
  208    208   
                Some(3) => {
  209    209   
                    builder.bypass_policy_lockout_safety_check = Some(deser.read_boolean(member)?);
  210    210   
                }
  211    211   
                _ => {}
  212    212   
            }
  213    213   
            Ok(())
  214    214   
        })?;
         215  +
        builder.key_id = builder.key_id.or(Some(String::new()));
         216  +
        builder.policy = builder.policy.or(Some(String::new()));
  215    217   
        builder
  216    218   
            .build()
  217    219   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  218    220   
    }
  219    221   
}
         222  +
impl PutKeyPolicyInput {
         223  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         224  +
    pub fn deserialize_with_response(
         225  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         226  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         227  +
        _status: u16,
         228  +
        _body: &[u8],
         229  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         230  +
        Self::deserialize(deserializer)
         231  +
    }
         232  +
}
  220    233   
impl PutKeyPolicyInput {
  221    234   
    /// Creates a new builder-style object to manufacture [`PutKeyPolicyInput`](crate::operation::put_key_policy::PutKeyPolicyInput).
  222    235   
    pub fn builder() -> crate::operation::put_key_policy::builders::PutKeyPolicyInputBuilder {
  223    236   
        crate::operation::put_key_policy::builders::PutKeyPolicyInputBuilder::default()
  224    237   
    }
  225    238   
}
  226    239   
  227    240   
/// A builder for [`PutKeyPolicyInput`](crate::operation::put_key_policy::PutKeyPolicyInput).
  228    241   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  229    242   
#[non_exhaustive]

tmp-codegen-diff/aws-sdk/sdk/kms/src/operation/put_key_policy/_put_key_policy_output.rs

@@ -1,1 +80,111 @@
    3      3   
#[non_exhaustive]
    4      4   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5      5   
pub struct PutKeyPolicyOutput {
    6      6   
    _request_id: Option<String>,
    7      7   
}
    8      8   
static PUTKEYPOLICYOUTPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
    9      9   
    "com.amazonaws.kms.synthetic#PutKeyPolicyOutput",
   10     10   
    "com.amazonaws.kms.synthetic",
   11     11   
    "PutKeyPolicyOutput",
   12     12   
);
   13         -
static PUTKEYPOLICYOUTPUT_SCHEMA: ::aws_smithy_schema::Schema =
   14         -
    ::aws_smithy_schema::Schema::new_struct(PUTKEYPOLICYOUTPUT_SCHEMA_ID, ::aws_smithy_schema::ShapeType::Structure, &[]);
          13  +
static PUTKEYPOLICYOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          14  +
    ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
          15  +
    ::aws_smithy_schema::ShapeType::String,
          16  +
    "request_id",
          17  +
    0,
          18  +
)
          19  +
.with_http_header("x-amzn-requestid");
          20  +
static PUTKEYPOLICYOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
          21  +
    PUTKEYPOLICYOUTPUT_SCHEMA_ID,
          22  +
    ::aws_smithy_schema::ShapeType::Structure,
          23  +
    &[&PUTKEYPOLICYOUTPUT_MEMBER__REQUEST_ID],
          24  +
);
   15     25   
impl PutKeyPolicyOutput {
   16     26   
    /// The schema for this shape.
   17     27   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &PUTKEYPOLICYOUTPUT_SCHEMA;
   18     28   
}
   19     29   
impl ::aws_smithy_schema::serde::SerializableStruct for PutKeyPolicyOutput {
   20     30   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   21     31   
    fn serialize_members(
   22     32   
        &self,
   23     33   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   24     34   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   25     35   
        Ok(())
   26     36   
    }
   27     37   
}
   28     38   
impl PutKeyPolicyOutput {
   29     39   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   30         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   31         -
        deserializer: &mut D,
          40  +
    pub fn deserialize(
          41  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   32     42   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   33     43   
        #[allow(unused_variables, unused_mut)]
   34     44   
        let mut builder = Self::builder();
   35     45   
        #[allow(
   36     46   
            unused_variables,
   37     47   
            unreachable_code,
   38     48   
            clippy::single_match,
   39     49   
            clippy::match_single_binding,
   40     50   
            clippy::diverging_sub_expression
   41     51   
        )]
   42         -
        deserializer.read_struct(&PUTKEYPOLICYOUTPUT_SCHEMA, (), |_, member, deser| {
          52  +
        deserializer.read_struct(&PUTKEYPOLICYOUTPUT_SCHEMA, &mut |member, deser| {
   43     53   
            match member.member_index() {
          54  +
                Some(0) => {
          55  +
                    builder._request_id = Some(deser.read_string(member)?);
          56  +
                }
   44     57   
                _ => {}
   45     58   
            }
   46     59   
            Ok(())
   47     60   
        })?;
   48     61   
        Ok(builder.build())
   49     62   
    }
   50     63   
}
          64  +
impl PutKeyPolicyOutput {
          65  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          66  +
    /// Header-bound members are read directly from headers, avoiding runtime
          67  +
    /// member iteration overhead. Body members are read via the deserializer.
          68  +
    pub fn deserialize_with_response(
          69  +
        _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          70  +
        headers: &::aws_smithy_runtime_api::http::Headers,
          71  +
        _status: u16,
          72  +
        _body: &[u8],
          73  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          74  +
        #[allow(unused_variables, unused_mut)]
          75  +
        let mut builder = Self::builder();
          76  +
        if let Some(val) = headers.get("x-amzn-requestid") {
          77  +
            builder._request_id = Some(val.to_string());
          78  +
        }
          79  +
        Ok(builder.build())
          80  +
    }
          81  +
}
   51     82   
impl ::aws_types::request_id::RequestId for PutKeyPolicyOutput {
   52     83   
    fn request_id(&self) -> Option<&str> {
   53     84   
        self._request_id.as_deref()
   54     85   
    }
   55     86   
}
   56     87   
impl PutKeyPolicyOutput {
   57     88   
    /// Creates a new builder-style object to manufacture [`PutKeyPolicyOutput`](crate::operation::put_key_policy::PutKeyPolicyOutput).
   58     89   
    pub fn builder() -> crate::operation::put_key_policy::builders::PutKeyPolicyOutputBuilder {
   59     90   
        crate::operation::put_key_policy::builders::PutKeyPolicyOutputBuilder::default()
   60     91   
    }

tmp-codegen-diff/aws-sdk/sdk/kms/src/operation/re_encrypt.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `ReEncrypt`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ReEncrypt;
    6      6   
impl ReEncrypt {
    7      7   
    /// Creates a new `ReEncrypt`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::re_encrypt::ReEncryptInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::re_encrypt::ReEncryptOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::re_encrypt::ReEncryptInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::re_encrypt::ReEncryptOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::re_encrypt::ReEncryptError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -115,119 +240,517 @@
  135    139   
                crate::operation::re_encrypt::ReEncryptError,
  136    140   
            >::new());
  137    141   
  138    142   
        ::std::borrow::Cow::Owned(rcb)
  139    143   
    }
  140    144   
}
  141    145   
  142    146   
#[derive(Debug)]
  143    147   
struct ReEncryptResponseDeserializer;
  144    148   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ReEncryptResponseDeserializer {
  145         -
    fn deserialize_nonstreaming(
         149  +
    fn deserialize_nonstreaming_with_config(
  146    150   
        &self,
  147    151   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         152  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  148    153   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  149    154   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  150         -
        let headers = response.headers();
  151         -
        let body = response.body().bytes().expect("body loaded");
  152    155   
        #[allow(unused_mut)]
  153    156   
        let mut force_error = false;
  154    157   
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
  155         -
        let parse_result = if !success && status != 200 || force_error {
  156         -
            crate::protocol_serde::shape_re_encrypt::de_re_encrypt_http_error(status, headers, body)
  157         -
        } else {
  158         -
            crate::protocol_serde::shape_re_encrypt::de_re_encrypt_http_response(status, headers, body)
         158  +
        if !success && status != 200 || force_error {
         159  +
            let headers = response.headers();
         160  +
            let body = response.body().bytes().expect("body loaded");
         161  +
            #[allow(unused_mut)]
         162  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         163  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         164  +
            })?;
         165  +
            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
         166  +
            let generic = generic_builder.build();
         167  +
            let error_code = match generic.code() {
         168  +
                ::std::option::Option::Some(code) => code,
         169  +
                ::std::option::Option::None => {
         170  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         171  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::re_encrypt::ReEncryptError::unhandled(generic)),
         172  +
                    ))
         173  +
                }
         174  +
            };
         175  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         176  +
            let protocol = _cfg
         177  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         178  +
                .expect("a SharedClientProtocol is required");
         179  +
            let err = match error_code {
         180  +
                "DependencyTimeoutException" => crate::operation::re_encrypt::ReEncryptError::DependencyTimeoutException({
         181  +
                    let mut tmp = match protocol
         182  +
                        .deserialize_response(response, crate::types::error::DependencyTimeoutException::SCHEMA, _cfg)
         183  +
                        .and_then(|mut deser| {
         184  +
                            crate::types::error::DependencyTimeoutException::deserialize_with_response(
         185  +
                                &mut *deser,
         186  +
                                response.headers(),
         187  +
                                response.status().into(),
         188  +
                                body,
         189  +
                            )
         190  +
                        }) {
         191  +
                        ::std::result::Result::Ok(val) => val,
         192  +
                        ::std::result::Result::Err(e) => {
         193  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         194  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         195  +
                            ))
         196  +
                        }
         197  +
                    };
         198  +
                    tmp.meta = generic;
         199  +
                    if tmp.message.is_none() {
         200  +
                        tmp.message = _error_message;
         201  +
                    }
         202  +
                    tmp
         203  +
                }),
         204  +
                "DisabledException" => crate::operation::re_encrypt::ReEncryptError::DisabledException({
         205  +
                    let mut tmp = match protocol
         206  +
                        .deserialize_response(response, crate::types::error::DisabledException::SCHEMA, _cfg)
         207  +
                        .and_then(|mut deser| {
         208  +
                            crate::types::error::DisabledException::deserialize_with_response(
         209  +
                                &mut *deser,
         210  +
                                response.headers(),
         211  +
                                response.status().into(),
         212  +
                                body,
         213  +
                            )
         214  +
                        }) {
         215  +
                        ::std::result::Result::Ok(val) => val,
         216  +
                        ::std::result::Result::Err(e) => {
         217  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         218  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         219  +
                            ))
         220  +
                        }
  159    221   
                    };
  160         -
        crate::protocol_serde::type_erase_result(parse_result)
         222  +
                    tmp.meta = generic;
         223  +
                    if tmp.message.is_none() {
         224  +
                        tmp.message = _error_message;
         225  +
                    }
         226  +
                    tmp
         227  +
                }),
         228  +
                "DryRunOperationException" => crate::operation::re_encrypt::ReEncryptError::DryRunOperationException({
         229  +
                    let mut tmp = match protocol
         230  +
                        .deserialize_response(response, crate::types::error::DryRunOperationException::SCHEMA, _cfg)
         231  +
                        .and_then(|mut deser| {
         232  +
                            crate::types::error::DryRunOperationException::deserialize_with_response(
         233  +
                                &mut *deser,
         234  +
                                response.headers(),
         235  +
                                response.status().into(),
         236  +
                                body,
         237  +
                            )
         238  +
                        }) {
         239  +
                        ::std::result::Result::Ok(val) => val,
         240  +
                        ::std::result::Result::Err(e) => {
         241  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         242  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         243  +
                            ))
         244  +
                        }
         245  +
                    };
         246  +
                    tmp.meta = generic;
         247  +
                    if tmp.message.is_none() {
         248  +
                        tmp.message = _error_message;
         249  +
                    }
         250  +
                    tmp
         251  +
                }),
         252  +
                "IncorrectKeyException" => crate::operation::re_encrypt::ReEncryptError::IncorrectKeyException({
         253  +
                    let mut tmp = match protocol
         254  +
                        .deserialize_response(response, crate::types::error::IncorrectKeyException::SCHEMA, _cfg)
         255  +
                        .and_then(|mut deser| {
         256  +
                            crate::types::error::IncorrectKeyException::deserialize_with_response(
         257  +
                                &mut *deser,
         258  +
                                response.headers(),
         259  +
                                response.status().into(),
         260  +
                                body,
         261  +
                            )
         262  +
                        }) {
         263  +
                        ::std::result::Result::Ok(val) => val,
         264  +
                        ::std::result::Result::Err(e) => {
         265  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         266  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         267  +
                            ))
         268  +
                        }
         269  +
                    };
         270  +
                    tmp.meta = generic;
         271  +
                    if tmp.message.is_none() {
         272  +
                        tmp.message = _error_message;
         273  +
                    }
         274  +
                    tmp
         275  +
                }),
         276  +
                "InvalidCiphertextException" => crate::operation::re_encrypt::ReEncryptError::InvalidCiphertextException({
         277  +
                    let mut tmp = match protocol
         278  +
                        .deserialize_response(response, crate::types::error::InvalidCiphertextException::SCHEMA, _cfg)
         279  +
                        .and_then(|mut deser| {
         280  +
                            crate::types::error::InvalidCiphertextException::deserialize_with_response(
         281  +
                                &mut *deser,
         282  +
                                response.headers(),
         283  +
                                response.status().into(),
         284  +
                                body,
         285  +
                            )
         286  +
                        }) {
         287  +
                        ::std::result::Result::Ok(val) => val,
         288  +
                        ::std::result::Result::Err(e) => {
         289  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         290  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         291  +
                            ))
         292  +
                        }
         293  +
                    };
         294  +
                    tmp.meta = generic;
         295  +
                    if tmp.message.is_none() {
         296  +
                        tmp.message = _error_message;
         297  +
                    }
         298  +
                    tmp
         299  +
                }),
         300  +
                "InvalidGrantTokenException" => crate::operation::re_encrypt::ReEncryptError::InvalidGrantTokenException({
         301  +
                    let mut tmp = match protocol
         302  +
                        .deserialize_response(response, crate::types::error::InvalidGrantTokenException::SCHEMA, _cfg)
         303  +
                        .and_then(|mut deser| {
         304  +
                            crate::types::error::InvalidGrantTokenException::deserialize_with_response(
         305  +
                                &mut *deser,
         306  +
                                response.headers(),
         307  +
                                response.status().into(),
         308  +
                                body,
         309  +
                            )
         310  +
                        }) {
         311  +
                        ::std::result::Result::Ok(val) => val,
         312  +
                        ::std::result::Result::Err(e) => {
         313  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         314  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         315  +
                            ))
         316  +
                        }
         317  +
                    };
         318  +
                    tmp.meta = generic;
         319  +
                    if tmp.message.is_none() {
         320  +
                        tmp.message = _error_message;
         321  +
                    }
         322  +
                    tmp
         323  +
                }),
         324  +
                "InvalidKeyUsageException" => crate::operation::re_encrypt::ReEncryptError::InvalidKeyUsageException({
         325  +
                    let mut tmp = match protocol
         326  +
                        .deserialize_response(response, crate::types::error::InvalidKeyUsageException::SCHEMA, _cfg)
         327  +
                        .and_then(|mut deser| {
         328  +
                            crate::types::error::InvalidKeyUsageException::deserialize_with_response(
         329  +
                                &mut *deser,
         330  +
                                response.headers(),
         331  +
                                response.status().into(),
         332  +
                                body,
         333  +
                            )
         334  +
                        }) {
         335  +
                        ::std::result::Result::Ok(val) => val,
         336  +
                        ::std::result::Result::Err(e) => {
         337  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         338  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         339  +
                            ))
         340  +
                        }
         341  +
                    };
         342  +
                    tmp.meta = generic;
         343  +
                    if tmp.message.is_none() {
         344  +
                        tmp.message = _error_message;
         345  +
                    }
         346  +
                    tmp
         347  +
                }),
         348  +
                "KeyUnavailableException" => crate::operation::re_encrypt::ReEncryptError::KeyUnavailableException({
         349  +
                    let mut tmp = match protocol
         350  +
                        .deserialize_response(response, crate::types::error::KeyUnavailableException::SCHEMA, _cfg)
         351  +
                        .and_then(|mut deser| {
         352  +
                            crate::types::error::KeyUnavailableException::deserialize_with_response(
         353  +
                                &mut *deser,
         354  +
                                response.headers(),
         355  +
                                response.status().into(),
         356  +
                                body,
         357  +
                            )
         358  +
                        }) {
         359  +
                        ::std::result::Result::Ok(val) => val,
         360  +
                        ::std::result::Result::Err(e) => {
         361  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         362  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         363  +
                            ))
         364  +
                        }
         365  +
                    };
         366  +
                    tmp.meta = generic;
         367  +
                    if tmp.message.is_none() {
         368  +
                        tmp.message = _error_message;
         369  +
                    }
         370  +
                    tmp
         371  +
                }),
         372  +
                "KMSInternalException" => crate::operation::re_encrypt::ReEncryptError::KmsInternalException({
         373  +
                    let mut tmp = match protocol
         374  +
                        .deserialize_response(response, crate::types::error::KmsInternalException::SCHEMA, _cfg)
         375  +
                        .and_then(|mut deser| {
         376  +
                            crate::types::error::KmsInternalException::deserialize_with_response(
         377  +
                                &mut *deser,
         378  +
                                response.headers(),
         379  +
                                response.status().into(),
         380  +
                                body,
         381  +
                            )
         382  +
                        }) {
         383  +
                        ::std::result::Result::Ok(val) => val,
         384  +
                        ::std::result::Result::Err(e) => {
         385  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         386  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         387  +
                            ))
         388  +
                        }
         389  +
                    };
         390  +
                    tmp.meta = generic;
         391  +
                    if tmp.message.is_none() {
         392  +
                        tmp.message = _error_message;
         393  +
                    }
         394  +
                    tmp
         395  +
                }),
         396  +
                "KMSInvalidStateException" => crate::operation::re_encrypt::ReEncryptError::KmsInvalidStateException({
         397  +
                    let mut tmp = match protocol
         398  +
                        .deserialize_response(response, crate::types::error::KmsInvalidStateException::SCHEMA, _cfg)
         399  +
                        .and_then(|mut deser| {
         400  +
                            crate::types::error::KmsInvalidStateException::deserialize_with_response(
         401  +
                                &mut *deser,
         402  +
                                response.headers(),
         403  +
                                response.status().into(),
         404  +
                                body,
         405  +
                            )
         406  +
                        }) {
         407  +
                        ::std::result::Result::Ok(val) => val,
         408  +
                        ::std::result::Result::Err(e) => {
         409  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         410  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         411  +
                            ))
         412  +
                        }
         413  +
                    };
         414  +
                    tmp.meta = generic;
         415  +
                    if tmp.message.is_none() {
         416  +
                        tmp.message = _error_message;
         417  +
                    }
         418  +
                    tmp
         419  +
                }),
         420  +
                "NotFoundException" => crate::operation::re_encrypt::ReEncryptError::NotFoundException({
         421  +
                    let mut tmp = match protocol
         422  +
                        .deserialize_response(response, crate::types::error::NotFoundException::SCHEMA, _cfg)
         423  +
                        .and_then(|mut deser| {
         424  +
                            crate::types::error::NotFoundException::deserialize_with_response(
         425  +
                                &mut *deser,
         426  +
                                response.headers(),
         427  +
                                response.status().into(),
         428  +
                                body,
         429  +
                            )
         430  +
                        }) {
         431  +
                        ::std::result::Result::Ok(val) => val,
         432  +
                        ::std::result::Result::Err(e) => {
         433  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         434  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         435  +
                            ))
         436  +
                        }
         437  +
                    };
         438  +
                    tmp.meta = generic;
         439  +
                    if tmp.message.is_none() {
         440  +
                        tmp.message = _error_message;
         441  +
                    }
         442  +
                    tmp
         443  +
                }),
         444  +
                _ => crate::operation::re_encrypt::ReEncryptError::generic(generic),
         445  +
            };
         446  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         447  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         448  +
            ))
         449  +
        } else {
         450  +
            let protocol = _cfg
         451  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         452  +
                .expect("a SharedClientProtocol is required");
         453  +
            let mut deser = protocol.deserialize_response(response, ReEncrypt::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         454  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         455  +
            })?;
         456  +
            let body = response.body().bytes().expect("body loaded");
         457  +
            let output = crate::operation::re_encrypt::ReEncryptOutput::deserialize_with_response(
         458  +
                &mut *deser,
         459  +
                response.headers(),
         460  +
                response.status().into(),
         461  +
                body,
         462  +
            )
         463  +
            .map_err(|e| {
         464  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         465  +
            })?;
         466  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         467  +
        }
  161    468   
    }
  162    469   
}
  163    470   
#[derive(Debug)]
  164    471   
struct ReEncryptRequestSerializer;
  165    472   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ReEncryptRequestSerializer {
  166    473   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  167    474   
    fn serialize_input(
  168    475   
        &self,
  169    476   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  170    477   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  171    478   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  172    479   
        let input = input.downcast::<crate::operation::re_encrypt::ReEncryptInput>().expect("correct type");
  173         -
        let _header_serialization_settings = _cfg
  174         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  175         -
            .cloned()
  176         -
            .unwrap_or_default();
  177         -
        let mut request_builder = {
  178         -
            #[allow(clippy::uninlined_format_args)]
  179         -
            fn uri_base(
  180         -
                _input: &crate::operation::re_encrypt::ReEncryptInput,
  181         -
                output: &mut ::std::string::String,
  182         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  183         -
                use ::std::fmt::Write as _;
  184         -
                ::std::write!(output, "/").expect("formatting should succeed");
  185         -
                ::std::result::Result::Ok(())
  186         -
            }
  187         -
            #[allow(clippy::unnecessary_wraps)]
  188         -
            fn update_http_builder(
  189         -
                input: &crate::operation::re_encrypt::ReEncryptInput,
  190         -
                builder: ::http_1x::request::Builder,
  191         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  192         -
                let mut uri = ::std::string::String::new();
  193         -
                uri_base(input, &mut uri)?;
  194         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  195         -
            }
  196         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  197         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
  198         -
            builder = _header_serialization_settings.set_default_header(
  199         -
                builder,
  200         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  201         -
                "TrentService.ReEncrypt",
  202         -
            );
  203         -
            builder
  204         -
        };
  205         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_re_encrypt::ser_re_encrypt_input(&input)?);
  206         -
        if let Some(content_length) = body.content_length() {
  207         -
            let content_length = content_length.to_string();
  208         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  209         -
        }
  210         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         480  +
        let protocol = _cfg
         481  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         482  +
            .expect("a SharedClientProtocol is required");
         483  +
        let mut request = protocol
         484  +
            .serialize_request(&input, ReEncrypt::INPUT_SCHEMA, "", _cfg)
         485  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         486  +
         487  +
        return ::std::result::Result::Ok(request);
  211    488   
    }
  212    489   
}
  213    490   
#[derive(Debug)]
  214    491   
struct ReEncryptEndpointParamsInterceptor;
  215    492   
  216    493   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ReEncryptEndpointParamsInterceptor {
  217    494   
    fn name(&self) -> &'static str {
  218    495   
        "ReEncryptEndpointParamsInterceptor"
  219    496   
    }
  220    497   

tmp-codegen-diff/aws-sdk/sdk/kms/src/operation/re_encrypt/_re_encrypt_input.rs

@@ -129,129 +269,269 @@
  149    149   
    "com.amazonaws.kms.synthetic",
  150    150   
    "ReEncryptInput",
  151    151   
);
  152    152   
static REENCRYPTINPUT_MEMBER_CIPHERTEXT_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  153    153   
    ::aws_smithy_schema::ShapeId::from_static(
  154    154   
        "com.amazonaws.kms.synthetic#ReEncryptInput$CiphertextBlob",
  155    155   
        "com.amazonaws.kms.synthetic",
  156    156   
        "ReEncryptInput",
  157    157   
    ),
  158    158   
    ::aws_smithy_schema::ShapeType::Blob,
  159         -
    "ciphertext_blob",
         159  +
    "CiphertextBlob",
  160    160   
    0,
  161    161   
);
  162    162   
static REENCRYPTINPUT_MEMBER_SOURCE_ENCRYPTION_CONTEXT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  163    163   
    ::aws_smithy_schema::ShapeId::from_static(
  164    164   
        "com.amazonaws.kms.synthetic#ReEncryptInput$SourceEncryptionContext",
  165    165   
        "com.amazonaws.kms.synthetic",
  166    166   
        "ReEncryptInput",
  167    167   
    ),
  168    168   
    ::aws_smithy_schema::ShapeType::Map,
  169         -
    "source_encryption_context",
         169  +
    "SourceEncryptionContext",
  170    170   
    1,
  171    171   
);
  172    172   
static REENCRYPTINPUT_MEMBER_SOURCE_KEY_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  173    173   
    ::aws_smithy_schema::ShapeId::from_static(
  174    174   
        "com.amazonaws.kms.synthetic#ReEncryptInput$SourceKeyId",
  175    175   
        "com.amazonaws.kms.synthetic",
  176    176   
        "ReEncryptInput",
  177    177   
    ),
  178    178   
    ::aws_smithy_schema::ShapeType::String,
  179         -
    "source_key_id",
         179  +
    "SourceKeyId",
  180    180   
    2,
  181    181   
);
  182    182   
static REENCRYPTINPUT_MEMBER_DESTINATION_KEY_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  183    183   
    ::aws_smithy_schema::ShapeId::from_static(
  184    184   
        "com.amazonaws.kms.synthetic#ReEncryptInput$DestinationKeyId",
  185    185   
        "com.amazonaws.kms.synthetic",
  186    186   
        "ReEncryptInput",
  187    187   
    ),
  188    188   
    ::aws_smithy_schema::ShapeType::String,
  189         -
    "destination_key_id",
         189  +
    "DestinationKeyId",
  190    190   
    3,
  191    191   
);
  192    192   
static REENCRYPTINPUT_MEMBER_DESTINATION_ENCRYPTION_CONTEXT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  193    193   
    ::aws_smithy_schema::ShapeId::from_static(
  194    194   
        "com.amazonaws.kms.synthetic#ReEncryptInput$DestinationEncryptionContext",
  195    195   
        "com.amazonaws.kms.synthetic",
  196    196   
        "ReEncryptInput",
  197    197   
    ),
  198    198   
    ::aws_smithy_schema::ShapeType::Map,
  199         -
    "destination_encryption_context",
         199  +
    "DestinationEncryptionContext",
  200    200   
    4,
  201    201   
);
  202    202   
static REENCRYPTINPUT_MEMBER_SOURCE_ENCRYPTION_ALGORITHM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  203    203   
    ::aws_smithy_schema::ShapeId::from_static(
  204    204   
        "com.amazonaws.kms.synthetic#ReEncryptInput$SourceEncryptionAlgorithm",
  205    205   
        "com.amazonaws.kms.synthetic",
  206    206   
        "ReEncryptInput",
  207    207   
    ),
  208    208   
    ::aws_smithy_schema::ShapeType::String,
  209         -
    "source_encryption_algorithm",
         209  +
    "SourceEncryptionAlgorithm",
  210    210   
    5,
  211    211   
);
  212    212   
static REENCRYPTINPUT_MEMBER_DESTINATION_ENCRYPTION_ALGORITHM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  213    213   
    ::aws_smithy_schema::ShapeId::from_static(
  214    214   
        "com.amazonaws.kms.synthetic#ReEncryptInput$DestinationEncryptionAlgorithm",
  215    215   
        "com.amazonaws.kms.synthetic",
  216    216   
        "ReEncryptInput",
  217    217   
    ),
  218    218   
    ::aws_smithy_schema::ShapeType::String,
  219         -
    "destination_encryption_algorithm",
         219  +
    "DestinationEncryptionAlgorithm",
  220    220   
    6,
  221    221   
);
  222    222   
static REENCRYPTINPUT_MEMBER_GRANT_TOKENS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  223    223   
    ::aws_smithy_schema::ShapeId::from_static(
  224    224   
        "com.amazonaws.kms.synthetic#ReEncryptInput$GrantTokens",
  225    225   
        "com.amazonaws.kms.synthetic",
  226    226   
        "ReEncryptInput",
  227    227   
    ),
  228    228   
    ::aws_smithy_schema::ShapeType::List,
  229         -
    "grant_tokens",
         229  +
    "GrantTokens",
  230    230   
    7,
  231    231   
);
  232    232   
static REENCRYPTINPUT_MEMBER_DRY_RUN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  233    233   
    ::aws_smithy_schema::ShapeId::from_static(
  234    234   
        "com.amazonaws.kms.synthetic#ReEncryptInput$DryRun",
  235    235   
        "com.amazonaws.kms.synthetic",
  236    236   
        "ReEncryptInput",
  237    237   
    ),
  238    238   
    ::aws_smithy_schema::ShapeType::Boolean,
  239         -
    "dry_run",
         239  +
    "DryRun",
  240    240   
    8,
  241    241   
);
  242    242   
static REENCRYPTINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  243    243   
    REENCRYPTINPUT_SCHEMA_ID,
  244    244   
    ::aws_smithy_schema::ShapeType::Structure,
  245    245   
    &[
  246    246   
        &REENCRYPTINPUT_MEMBER_CIPHERTEXT_BLOB,
  247    247   
        &REENCRYPTINPUT_MEMBER_SOURCE_ENCRYPTION_CONTEXT,
  248    248   
        &REENCRYPTINPUT_MEMBER_SOURCE_KEY_ID,
  249    249   
        &REENCRYPTINPUT_MEMBER_DESTINATION_KEY_ID,
@@ -295,295 +434,417 @@
  315    315   
            )?;
  316    316   
        }
  317    317   
        if let Some(ref val) = self.dry_run {
  318    318   
            ser.write_boolean(&REENCRYPTINPUT_MEMBER_DRY_RUN, *val)?;
  319    319   
        }
  320    320   
        Ok(())
  321    321   
    }
  322    322   
}
  323    323   
impl ReEncryptInput {
  324    324   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  325         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  326         -
        deserializer: &mut D,
         325  +
    pub fn deserialize(
         326  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  327    327   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  328    328   
        #[allow(unused_variables, unused_mut)]
  329    329   
        let mut builder = Self::builder();
  330    330   
        #[allow(
  331    331   
            unused_variables,
  332    332   
            unreachable_code,
  333    333   
            clippy::single_match,
  334    334   
            clippy::match_single_binding,
  335    335   
            clippy::diverging_sub_expression
  336    336   
        )]
  337         -
        deserializer.read_struct(&REENCRYPTINPUT_SCHEMA, (), |_, member, deser| {
         337  +
        deserializer.read_struct(&REENCRYPTINPUT_SCHEMA, &mut |member, deser| {
  338    338   
            match member.member_index() {
  339    339   
                Some(0) => {
  340    340   
                    builder.ciphertext_blob = Some(deser.read_blob(member)?);
  341    341   
                }
  342    342   
                Some(1) => {
  343         -
                    builder.source_encryption_context = Some({
  344         -
                        let container = if let Some(cap) = deser.container_size() {
  345         -
                            std::collections::HashMap::with_capacity(cap)
  346         -
                        } else {
  347         -
                            std::collections::HashMap::new()
  348         -
                        };
  349         -
                        deser.read_map(member, container, |mut map, key, deser| {
  350         -
                            map.insert(key, deser.read_string(member)?);
  351         -
                            Ok(map)
  352         -
                        })?
  353         -
                    });
         343  +
                    builder.source_encryption_context = Some(deser.read_string_string_map(member)?);
  354    344   
                }
  355    345   
                Some(2) => {
  356    346   
                    builder.source_key_id = Some(deser.read_string(member)?);
  357    347   
                }
  358    348   
                Some(3) => {
  359    349   
                    builder.destination_key_id = Some(deser.read_string(member)?);
  360    350   
                }
  361    351   
                Some(4) => {
  362         -
                    builder.destination_encryption_context = Some({
  363         -
                        let container = if let Some(cap) = deser.container_size() {
  364         -
                            std::collections::HashMap::with_capacity(cap)
  365         -
                        } else {
  366         -
                            std::collections::HashMap::new()
  367         -
                        };
  368         -
                        deser.read_map(member, container, |mut map, key, deser| {
  369         -
                            map.insert(key, deser.read_string(member)?);
  370         -
                            Ok(map)
  371         -
                        })?
  372         -
                    });
         352  +
                    builder.destination_encryption_context = Some(deser.read_string_string_map(member)?);
  373    353   
                }
  374    354   
                Some(5) => {
  375    355   
                    builder.source_encryption_algorithm = Some(crate::types::EncryptionAlgorithmSpec::from(deser.read_string(member)?.as_str()));
  376    356   
                }
  377    357   
                Some(6) => {
  378    358   
                    builder.destination_encryption_algorithm = Some(crate::types::EncryptionAlgorithmSpec::from(deser.read_string(member)?.as_str()));
  379    359   
                }
  380    360   
                Some(7) => {
  381         -
                    builder.grant_tokens = Some({
  382         -
                        let container = if let Some(cap) = deser.container_size() {
  383         -
                            Vec::with_capacity(cap)
  384         -
                        } else {
  385         -
                            Vec::new()
  386         -
                        };
  387         -
                        deser.read_list(member, container, |mut list, deser| {
  388         -
                            list.push(deser.read_string(member)?);
  389         -
                            Ok(list)
  390         -
                        })?
  391         -
                    });
         361  +
                    builder.grant_tokens = Some(deser.read_string_list(member)?);
  392    362   
                }
  393    363   
                Some(8) => {
  394    364   
                    builder.dry_run = Some(deser.read_boolean(member)?);
  395    365   
                }
  396    366   
                _ => {}
  397    367   
            }
  398    368   
            Ok(())
  399    369   
        })?;
         370  +
        builder.ciphertext_blob = builder.ciphertext_blob.or(Some(::aws_smithy_types::Blob::new("")));
         371  +
        builder.destination_key_id = builder.destination_key_id.or(Some(String::new()));
  400    372   
        builder
  401    373   
            .build()
  402    374   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  403    375   
    }
  404    376   
}
         377  +
impl ReEncryptInput {
         378  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         379  +
    pub fn deserialize_with_response(
         380  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         381  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         382  +
        _status: u16,
         383  +
        _body: &[u8],
         384  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         385  +
        Self::deserialize(deserializer)
         386  +
    }
         387  +
}
  405    388   
impl ReEncryptInput {
  406    389   
    /// Creates a new builder-style object to manufacture [`ReEncryptInput`](crate::operation::re_encrypt::ReEncryptInput).
  407    390   
    pub fn builder() -> crate::operation::re_encrypt::builders::ReEncryptInputBuilder {
  408    391   
        crate::operation::re_encrypt::builders::ReEncryptInputBuilder::default()
  409    392   
    }
  410    393   
}
  411    394   
  412    395   
/// A builder for [`ReEncryptInput`](crate::operation::re_encrypt::ReEncryptInput).
  413    396   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  414    397   
#[non_exhaustive]

tmp-codegen-diff/aws-sdk/sdk/kms/src/operation/re_encrypt/_re_encrypt_output.rs

@@ -34,34 +218,281 @@
   54     54   
    "com.amazonaws.kms.synthetic",
   55     55   
    "ReEncryptOutput",
   56     56   
);
   57     57   
static REENCRYPTOUTPUT_MEMBER_CIPHERTEXT_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   58     58   
    ::aws_smithy_schema::ShapeId::from_static(
   59     59   
        "com.amazonaws.kms.synthetic#ReEncryptOutput$CiphertextBlob",
   60     60   
        "com.amazonaws.kms.synthetic",
   61     61   
        "ReEncryptOutput",
   62     62   
    ),
   63     63   
    ::aws_smithy_schema::ShapeType::Blob,
   64         -
    "ciphertext_blob",
          64  +
    "CiphertextBlob",
   65     65   
    0,
   66     66   
);
   67     67   
static REENCRYPTOUTPUT_MEMBER_SOURCE_KEY_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   68     68   
    ::aws_smithy_schema::ShapeId::from_static(
   69     69   
        "com.amazonaws.kms.synthetic#ReEncryptOutput$SourceKeyId",
   70     70   
        "com.amazonaws.kms.synthetic",
   71     71   
        "ReEncryptOutput",
   72     72   
    ),
   73     73   
    ::aws_smithy_schema::ShapeType::String,
   74         -
    "source_key_id",
          74  +
    "SourceKeyId",
   75     75   
    1,
   76     76   
);
   77     77   
static REENCRYPTOUTPUT_MEMBER_KEY_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   78     78   
    ::aws_smithy_schema::ShapeId::from_static(
   79     79   
        "com.amazonaws.kms.synthetic#ReEncryptOutput$KeyId",
   80     80   
        "com.amazonaws.kms.synthetic",
   81     81   
        "ReEncryptOutput",
   82     82   
    ),
   83     83   
    ::aws_smithy_schema::ShapeType::String,
   84         -
    "key_id",
          84  +
    "KeyId",
   85     85   
    2,
   86     86   
);
   87     87   
static REENCRYPTOUTPUT_MEMBER_SOURCE_ENCRYPTION_ALGORITHM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   88     88   
    ::aws_smithy_schema::ShapeId::from_static(
   89     89   
        "com.amazonaws.kms.synthetic#ReEncryptOutput$SourceEncryptionAlgorithm",
   90     90   
        "com.amazonaws.kms.synthetic",
   91     91   
        "ReEncryptOutput",
   92     92   
    ),
   93     93   
    ::aws_smithy_schema::ShapeType::String,
   94         -
    "source_encryption_algorithm",
          94  +
    "SourceEncryptionAlgorithm",
   95     95   
    3,
   96     96   
);
   97     97   
static REENCRYPTOUTPUT_MEMBER_DESTINATION_ENCRYPTION_ALGORITHM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   98     98   
    ::aws_smithy_schema::ShapeId::from_static(
   99     99   
        "com.amazonaws.kms.synthetic#ReEncryptOutput$DestinationEncryptionAlgorithm",
  100    100   
        "com.amazonaws.kms.synthetic",
  101    101   
        "ReEncryptOutput",
  102    102   
    ),
  103    103   
    ::aws_smithy_schema::ShapeType::String,
  104         -
    "destination_encryption_algorithm",
         104  +
    "DestinationEncryptionAlgorithm",
  105    105   
    4,
  106    106   
);
  107    107   
static REENCRYPTOUTPUT_MEMBER_SOURCE_KEY_MATERIAL_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  108    108   
    ::aws_smithy_schema::ShapeId::from_static(
  109    109   
        "com.amazonaws.kms.synthetic#ReEncryptOutput$SourceKeyMaterialId",
  110    110   
        "com.amazonaws.kms.synthetic",
  111    111   
        "ReEncryptOutput",
  112    112   
    ),
  113    113   
    ::aws_smithy_schema::ShapeType::String,
  114         -
    "source_key_material_id",
         114  +
    "SourceKeyMaterialId",
  115    115   
    5,
  116    116   
);
  117    117   
static REENCRYPTOUTPUT_MEMBER_DESTINATION_KEY_MATERIAL_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  118    118   
    ::aws_smithy_schema::ShapeId::from_static(
  119    119   
        "com.amazonaws.kms.synthetic#ReEncryptOutput$DestinationKeyMaterialId",
  120    120   
        "com.amazonaws.kms.synthetic",
  121    121   
        "ReEncryptOutput",
  122    122   
    ),
  123    123   
    ::aws_smithy_schema::ShapeType::String,
  124         -
    "destination_key_material_id",
         124  +
    "DestinationKeyMaterialId",
  125    125   
    6,
  126    126   
);
         127  +
static REENCRYPTOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         128  +
    ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
         129  +
    ::aws_smithy_schema::ShapeType::String,
         130  +
    "request_id",
         131  +
    7,
         132  +
)
         133  +
.with_http_header("x-amzn-requestid");
  127    134   
static REENCRYPTOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  128    135   
    REENCRYPTOUTPUT_SCHEMA_ID,
  129    136   
    ::aws_smithy_schema::ShapeType::Structure,
  130    137   
    &[
  131    138   
        &REENCRYPTOUTPUT_MEMBER_CIPHERTEXT_BLOB,
  132    139   
        &REENCRYPTOUTPUT_MEMBER_SOURCE_KEY_ID,
  133    140   
        &REENCRYPTOUTPUT_MEMBER_KEY_ID,
  134    141   
        &REENCRYPTOUTPUT_MEMBER_SOURCE_ENCRYPTION_ALGORITHM,
  135    142   
        &REENCRYPTOUTPUT_MEMBER_DESTINATION_ENCRYPTION_ALGORITHM,
  136    143   
        &REENCRYPTOUTPUT_MEMBER_SOURCE_KEY_MATERIAL_ID,
  137    144   
        &REENCRYPTOUTPUT_MEMBER_DESTINATION_KEY_MATERIAL_ID,
         145  +
        &REENCRYPTOUTPUT_MEMBER__REQUEST_ID,
  138    146   
    ],
  139    147   
);
  140    148   
impl ReEncryptOutput {
  141    149   
    /// The schema for this shape.
  142    150   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &REENCRYPTOUTPUT_SCHEMA;
  143    151   
}
  144    152   
impl ::aws_smithy_schema::serde::SerializableStruct for ReEncryptOutput {
  145    153   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  146    154   
    fn serialize_members(
  147    155   
        &self,
  148    156   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  149    157   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  150    158   
        if let Some(ref val) = self.ciphertext_blob {
  151    159   
            ser.write_blob(&REENCRYPTOUTPUT_MEMBER_CIPHERTEXT_BLOB, val)?;
  152    160   
        }
  153    161   
        if let Some(ref val) = self.source_key_id {
  154    162   
            ser.write_string(&REENCRYPTOUTPUT_MEMBER_SOURCE_KEY_ID, val)?;
  155    163   
        }
  156    164   
        if let Some(ref val) = self.key_id {
  157    165   
            ser.write_string(&REENCRYPTOUTPUT_MEMBER_KEY_ID, val)?;
  158    166   
        }
  159    167   
        if let Some(ref val) = self.source_encryption_algorithm {
  160    168   
            ser.write_string(&REENCRYPTOUTPUT_MEMBER_SOURCE_ENCRYPTION_ALGORITHM, val.as_str())?;
  161    169   
        }
  162    170   
        if let Some(ref val) = self.destination_encryption_algorithm {
  163    171   
            ser.write_string(&REENCRYPTOUTPUT_MEMBER_DESTINATION_ENCRYPTION_ALGORITHM, val.as_str())?;
  164    172   
        }
  165    173   
        if let Some(ref val) = self.source_key_material_id {
  166    174   
            ser.write_string(&REENCRYPTOUTPUT_MEMBER_SOURCE_KEY_MATERIAL_ID, val)?;
  167    175   
        }
  168    176   
        if let Some(ref val) = self.destination_key_material_id {
  169    177   
            ser.write_string(&REENCRYPTOUTPUT_MEMBER_DESTINATION_KEY_MATERIAL_ID, val)?;
  170    178   
        }
  171    179   
        Ok(())
  172    180   
    }
  173    181   
}
  174    182   
impl ReEncryptOutput {
  175    183   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  176         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  177         -
        deserializer: &mut D,
         184  +
    pub fn deserialize(
         185  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  178    186   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  179    187   
        #[allow(unused_variables, unused_mut)]
  180    188   
        let mut builder = Self::builder();
  181    189   
        #[allow(
  182    190   
            unused_variables,
  183    191   
            unreachable_code,
  184    192   
            clippy::single_match,
  185    193   
            clippy::match_single_binding,
  186    194   
            clippy::diverging_sub_expression
  187    195   
        )]
  188         -
        deserializer.read_struct(&REENCRYPTOUTPUT_SCHEMA, (), |_, member, deser| {
         196  +
        deserializer.read_struct(&REENCRYPTOUTPUT_SCHEMA, &mut |member, deser| {
         197  +
            match member.member_index() {
         198  +
                Some(0) => {
         199  +
                    builder.ciphertext_blob = Some(deser.read_blob(member)?);
         200  +
                }
         201  +
                Some(1) => {
         202  +
                    builder.source_key_id = Some(deser.read_string(member)?);
         203  +
                }
         204  +
                Some(2) => {
         205  +
                    builder.key_id = Some(deser.read_string(member)?);
         206  +
                }
         207  +
                Some(3) => {
         208  +
                    builder.source_encryption_algorithm = Some(crate::types::EncryptionAlgorithmSpec::from(deser.read_string(member)?.as_str()));
         209  +
                }
         210  +
                Some(4) => {
         211  +
                    builder.destination_encryption_algorithm = Some(crate::types::EncryptionAlgorithmSpec::from(deser.read_string(member)?.as_str()));
         212  +
                }
         213  +
                Some(5) => {
         214  +
                    builder.source_key_material_id = Some(deser.read_string(member)?);
         215  +
                }
         216  +
                Some(6) => {
         217  +
                    builder.destination_key_material_id = Some(deser.read_string(member)?);
         218  +
                }
         219  +
                Some(7) => {
         220  +
                    builder._request_id = Some(deser.read_string(member)?);
         221  +
                }
         222  +
                _ => {}
         223  +
            }
         224  +
            Ok(())
         225  +
        })?;
         226  +
        Ok(builder.build())
         227  +
    }
         228  +
}
         229  +
impl ReEncryptOutput {
         230  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         231  +
    /// Header-bound members are read directly from headers, avoiding runtime
         232  +
    /// member iteration overhead. Body members are read via the deserializer.
         233  +
    pub fn deserialize_with_response(
         234  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         235  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         236  +
        _status: u16,
         237  +
        _body: &[u8],
         238  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         239  +
        #[allow(unused_variables, unused_mut)]
         240  +
        let mut builder = Self::builder();
         241  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         242  +
            builder._request_id = Some(val.to_string());
         243  +
        }
         244  +
        #[allow(
         245  +
            unused_variables,
         246  +
            unreachable_code,
         247  +
            clippy::single_match,
         248  +
            clippy::match_single_binding,
         249  +
            clippy::diverging_sub_expression
         250  +
        )]
         251  +
        deserializer.read_struct(&REENCRYPTOUTPUT_SCHEMA, &mut |member, deser| {
  189    252   
            match member.member_index() {
  190    253   
                Some(0) => {
  191    254   
                    builder.ciphertext_blob = Some(deser.read_blob(member)?);
  192    255   
                }
  193    256   
                Some(1) => {
  194    257   
                    builder.source_key_id = Some(deser.read_string(member)?);
  195    258   
                }
  196    259   
                Some(2) => {
  197    260   
                    builder.key_id = Some(deser.read_string(member)?);
  198    261   
                }

tmp-codegen-diff/aws-sdk/sdk/kms/src/operation/replicate_key.rs

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `ReplicateKey`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct ReplicateKey;
    6      6   
impl ReplicateKey {
    7      7   
    /// Creates a new `ReplicateKey`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::replicate_key::ReplicateKeyInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::replicate_key::ReplicateKeyOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::replicate_key::ReplicateKeyInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::replicate_key::ReplicateKeyOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::replicate_key::ReplicateKeyError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -115,119 +242,495 @@
  135    139   
                crate::operation::replicate_key::ReplicateKeyError,
  136    140   
            >::new());
  137    141   
  138    142   
        ::std::borrow::Cow::Owned(rcb)
  139    143   
    }
  140    144   
}
  141    145   
  142    146   
#[derive(Debug)]
  143    147   
struct ReplicateKeyResponseDeserializer;
  144    148   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ReplicateKeyResponseDeserializer {
  145         -
    fn deserialize_nonstreaming(
         149  +
    fn deserialize_nonstreaming_with_config(
  146    150   
        &self,
  147    151   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         152  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  148    153   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  149    154   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  150         -
        let headers = response.headers();
  151         -
        let body = response.body().bytes().expect("body loaded");
  152    155   
        #[allow(unused_mut)]
  153    156   
        let mut force_error = false;
  154    157   
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
  155         -
        let parse_result = if !success && status != 200 || force_error {
  156         -
            crate::protocol_serde::shape_replicate_key::de_replicate_key_http_error(status, headers, body)
  157         -
        } else {
  158         -
            crate::protocol_serde::shape_replicate_key::de_replicate_key_http_response(status, headers, body)
         158  +
        if !success && status != 200 || force_error {
         159  +
            let headers = response.headers();
         160  +
            let body = response.body().bytes().expect("body loaded");
         161  +
            #[allow(unused_mut)]
         162  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         163  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         164  +
            })?;
         165  +
            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
         166  +
            let generic = generic_builder.build();
         167  +
            let error_code = match generic.code() {
         168  +
                ::std::option::Option::Some(code) => code,
         169  +
                ::std::option::Option::None => {
         170  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         171  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::replicate_key::ReplicateKeyError::unhandled(generic)),
         172  +
                    ))
         173  +
                }
         174  +
            };
         175  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         176  +
            let protocol = _cfg
         177  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         178  +
                .expect("a SharedClientProtocol is required");
         179  +
            let err = match error_code {
         180  +
                "AlreadyExistsException" => crate::operation::replicate_key::ReplicateKeyError::AlreadyExistsException({
         181  +
                    let mut tmp = match protocol
         182  +
                        .deserialize_response(response, crate::types::error::AlreadyExistsException::SCHEMA, _cfg)
         183  +
                        .and_then(|mut deser| {
         184  +
                            crate::types::error::AlreadyExistsException::deserialize_with_response(
         185  +
                                &mut *deser,
         186  +
                                response.headers(),
         187  +
                                response.status().into(),
         188  +
                                body,
         189  +
                            )
         190  +
                        }) {
         191  +
                        ::std::result::Result::Ok(val) => val,
         192  +
                        ::std::result::Result::Err(e) => {
         193  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         194  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         195  +
                            ))
         196  +
                        }
         197  +
                    };
         198  +
                    tmp.meta = generic;
         199  +
                    if tmp.message.is_none() {
         200  +
                        tmp.message = _error_message;
         201  +
                    }
         202  +
                    tmp
         203  +
                }),
         204  +
                "DisabledException" => crate::operation::replicate_key::ReplicateKeyError::DisabledException({
         205  +
                    let mut tmp = match protocol
         206  +
                        .deserialize_response(response, crate::types::error::DisabledException::SCHEMA, _cfg)
         207  +
                        .and_then(|mut deser| {
         208  +
                            crate::types::error::DisabledException::deserialize_with_response(
         209  +
                                &mut *deser,
         210  +
                                response.headers(),
         211  +
                                response.status().into(),
         212  +
                                body,
         213  +
                            )
         214  +
                        }) {
         215  +
                        ::std::result::Result::Ok(val) => val,
         216  +
                        ::std::result::Result::Err(e) => {
         217  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         218  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         219  +
                            ))
         220  +
                        }
         221  +
                    };
         222  +
                    tmp.meta = generic;
         223  +
                    if tmp.message.is_none() {
         224  +
                        tmp.message = _error_message;
         225  +
                    }
         226  +
                    tmp
         227  +
                }),
         228  +
                "InvalidArnException" => crate::operation::replicate_key::ReplicateKeyError::InvalidArnException({
         229  +
                    let mut tmp = match protocol
         230  +
                        .deserialize_response(response, crate::types::error::InvalidArnException::SCHEMA, _cfg)
         231  +
                        .and_then(|mut deser| {
         232  +
                            crate::types::error::InvalidArnException::deserialize_with_response(
         233  +
                                &mut *deser,
         234  +
                                response.headers(),
         235  +
                                response.status().into(),
         236  +
                                body,
         237  +
                            )
         238  +
                        }) {
         239  +
                        ::std::result::Result::Ok(val) => val,
         240  +
                        ::std::result::Result::Err(e) => {
         241  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         242  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         243  +
                            ))
         244  +
                        }
         245  +
                    };
         246  +
                    tmp.meta = generic;
         247  +
                    if tmp.message.is_none() {
         248  +
                        tmp.message = _error_message;
         249  +
                    }
         250  +
                    tmp
         251  +
                }),
         252  +
                "KMSInternalException" => crate::operation::replicate_key::ReplicateKeyError::KmsInternalException({
         253  +
                    let mut tmp = match protocol
         254  +
                        .deserialize_response(response, crate::types::error::KmsInternalException::SCHEMA, _cfg)
         255  +
                        .and_then(|mut deser| {
         256  +
                            crate::types::error::KmsInternalException::deserialize_with_response(
         257  +
                                &mut *deser,
         258  +
                                response.headers(),
         259  +
                                response.status().into(),
         260  +
                                body,
         261  +
                            )
         262  +
                        }) {
         263  +
                        ::std::result::Result::Ok(val) => val,
         264  +
                        ::std::result::Result::Err(e) => {
         265  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         266  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         267  +
                            ))
         268  +
                        }
         269  +
                    };
         270  +
                    tmp.meta = generic;
         271  +
                    if tmp.message.is_none() {
         272  +
                        tmp.message = _error_message;
         273  +
                    }
         274  +
                    tmp
         275  +
                }),
         276  +
                "KMSInvalidStateException" => crate::operation::replicate_key::ReplicateKeyError::KmsInvalidStateException({
         277  +
                    let mut tmp = match protocol
         278  +
                        .deserialize_response(response, crate::types::error::KmsInvalidStateException::SCHEMA, _cfg)
         279  +
                        .and_then(|mut deser| {
         280  +
                            crate::types::error::KmsInvalidStateException::deserialize_with_response(
         281  +
                                &mut *deser,
         282  +
                                response.headers(),
         283  +
                                response.status().into(),
         284  +
                                body,
         285  +
                            )
         286  +
                        }) {
         287  +
                        ::std::result::Result::Ok(val) => val,
         288  +
                        ::std::result::Result::Err(e) => {
         289  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         290  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         291  +
                            ))
         292  +
                        }
  159    293   
                    };
  160         -
        crate::protocol_serde::type_erase_result(parse_result)
         294  +
                    tmp.meta = generic;
         295  +
                    if tmp.message.is_none() {
         296  +
                        tmp.message = _error_message;
         297  +
                    }
         298  +
                    tmp
         299  +
                }),
         300  +
                "LimitExceededException" => crate::operation::replicate_key::ReplicateKeyError::LimitExceededException({
         301  +
                    let mut tmp = match protocol
         302  +
                        .deserialize_response(response, crate::types::error::LimitExceededException::SCHEMA, _cfg)
         303  +
                        .and_then(|mut deser| {
         304  +
                            crate::types::error::LimitExceededException::deserialize_with_response(
         305  +
                                &mut *deser,
         306  +
                                response.headers(),
         307  +
                                response.status().into(),
         308  +
                                body,
         309  +
                            )
         310  +
                        }) {
         311  +
                        ::std::result::Result::Ok(val) => val,
         312  +
                        ::std::result::Result::Err(e) => {
         313  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         314  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         315  +
                            ))
         316  +
                        }
         317  +
                    };
         318  +
                    tmp.meta = generic;
         319  +
                    if tmp.message.is_none() {
         320  +
                        tmp.message = _error_message;
         321  +
                    }
         322  +
                    tmp
         323  +
                }),
         324  +
                "MalformedPolicyDocumentException" => crate::operation::replicate_key::ReplicateKeyError::MalformedPolicyDocumentException({
         325  +
                    let mut tmp = match protocol
         326  +
                        .deserialize_response(response, crate::types::error::MalformedPolicyDocumentException::SCHEMA, _cfg)
         327  +
                        .and_then(|mut deser| {
         328  +
                            crate::types::error::MalformedPolicyDocumentException::deserialize_with_response(
         329  +
                                &mut *deser,
         330  +
                                response.headers(),
         331  +
                                response.status().into(),
         332  +
                                body,
         333  +
                            )
         334  +
                        }) {
         335  +
                        ::std::result::Result::Ok(val) => val,
         336  +
                        ::std::result::Result::Err(e) => {
         337  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         338  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         339  +
                            ))
         340  +
                        }
         341  +
                    };
         342  +
                    tmp.meta = generic;
         343  +
                    if tmp.message.is_none() {
         344  +
                        tmp.message = _error_message;
         345  +
                    }
         346  +
                    tmp
         347  +
                }),
         348  +
                "NotFoundException" => crate::operation::replicate_key::ReplicateKeyError::NotFoundException({
         349  +
                    let mut tmp = match protocol
         350  +
                        .deserialize_response(response, crate::types::error::NotFoundException::SCHEMA, _cfg)
         351  +
                        .and_then(|mut deser| {
         352  +
                            crate::types::error::NotFoundException::deserialize_with_response(
         353  +
                                &mut *deser,
         354  +
                                response.headers(),
         355  +
                                response.status().into(),
         356  +
                                body,
         357  +
                            )
         358  +
                        }) {
         359  +
                        ::std::result::Result::Ok(val) => val,
         360  +
                        ::std::result::Result::Err(e) => {
         361  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         362  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         363  +
                            ))
         364  +
                        }
         365  +
                    };
         366  +
                    tmp.meta = generic;
         367  +
                    if tmp.message.is_none() {
         368  +
                        tmp.message = _error_message;
         369  +
                    }
         370  +
                    tmp
         371  +
                }),
         372  +
                "TagException" => crate::operation::replicate_key::ReplicateKeyError::TagException({
         373  +
                    let mut tmp = match protocol
         374  +
                        .deserialize_response(response, crate::types::error::TagException::SCHEMA, _cfg)
         375  +
                        .and_then(|mut deser| {
         376  +
                            crate::types::error::TagException::deserialize_with_response(
         377  +
                                &mut *deser,
         378  +
                                response.headers(),
         379  +
                                response.status().into(),
         380  +
                                body,
         381  +
                            )
         382  +
                        }) {
         383  +
                        ::std::result::Result::Ok(val) => val,
         384  +
                        ::std::result::Result::Err(e) => {
         385  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         386  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         387  +
                            ))
         388  +
                        }
         389  +
                    };
         390  +
                    tmp.meta = generic;
         391  +
                    if tmp.message.is_none() {
         392  +
                        tmp.message = _error_message;
         393  +
                    }
         394  +
                    tmp
         395  +
                }),
         396  +
                "UnsupportedOperationException" => crate::operation::replicate_key::ReplicateKeyError::UnsupportedOperationException({
         397  +
                    let mut tmp = match protocol
         398  +
                        .deserialize_response(response, crate::types::error::UnsupportedOperationException::SCHEMA, _cfg)
         399  +
                        .and_then(|mut deser| {
         400  +
                            crate::types::error::UnsupportedOperationException::deserialize_with_response(
         401  +
                                &mut *deser,
         402  +
                                response.headers(),
         403  +
                                response.status().into(),
         404  +
                                body,
         405  +
                            )
         406  +
                        }) {
         407  +
                        ::std::result::Result::Ok(val) => val,
         408  +
                        ::std::result::Result::Err(e) => {
         409  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         410  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         411  +
                            ))
         412  +
                        }
         413  +
                    };
         414  +
                    tmp.meta = generic;
         415  +
                    if tmp.message.is_none() {
         416  +
                        tmp.message = _error_message;
         417  +
                    }
         418  +
                    tmp
         419  +
                }),
         420  +
                _ => crate::operation::replicate_key::ReplicateKeyError::generic(generic),
         421  +
            };
         422  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         423  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         424  +
            ))
         425  +
        } else {
         426  +
            let protocol = _cfg
         427  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         428  +
                .expect("a SharedClientProtocol is required");
         429  +
            let mut deser = protocol.deserialize_response(response, ReplicateKey::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         430  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         431  +
            })?;
         432  +
            let body = response.body().bytes().expect("body loaded");
         433  +
            let output = crate::operation::replicate_key::ReplicateKeyOutput::deserialize_with_response(
         434  +
                &mut *deser,
         435  +
                response.headers(),
         436  +
                response.status().into(),
         437  +
                body,
         438  +
            )
         439  +
            .map_err(|e| {
         440  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         441  +
            })?;
         442  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         443  +
        }
  161    444   
    }
  162    445   
}
  163    446   
#[derive(Debug)]
  164    447   
struct ReplicateKeyRequestSerializer;
  165    448   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ReplicateKeyRequestSerializer {
  166    449   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  167    450   
    fn serialize_input(
  168    451   
        &self,
  169    452   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  170    453   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  171    454   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  172    455   
        let input = input
  173    456   
            .downcast::<crate::operation::replicate_key::ReplicateKeyInput>()
  174    457   
            .expect("correct type");
  175         -
        let _header_serialization_settings = _cfg
  176         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  177         -
            .cloned()
  178         -
            .unwrap_or_default();
  179         -
        let mut request_builder = {
  180         -
            #[allow(clippy::uninlined_format_args)]
  181         -
            fn uri_base(
  182         -
                _input: &crate::operation::replicate_key::ReplicateKeyInput,
  183         -
                output: &mut ::std::string::String,
  184         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  185         -
                use ::std::fmt::Write as _;
  186         -
                ::std::write!(output, "/").expect("formatting should succeed");
  187         -
                ::std::result::Result::Ok(())
  188         -
            }
  189         -
            #[allow(clippy::unnecessary_wraps)]
  190         -
            fn update_http_builder(
  191         -
                input: &crate::operation::replicate_key::ReplicateKeyInput,
  192         -
                builder: ::http_1x::request::Builder,
  193         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  194         -
                let mut uri = ::std::string::String::new();
  195         -
                uri_base(input, &mut uri)?;
  196         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  197         -
            }
  198         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  199         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
  200         -
            builder = _header_serialization_settings.set_default_header(
  201         -
                builder,
  202         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  203         -
                "TrentService.ReplicateKey",
  204         -
            );
  205         -
            builder
  206         -
        };
  207         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_replicate_key::ser_replicate_key_input(&input)?);
  208         -
        if let Some(content_length) = body.content_length() {
  209         -
            let content_length = content_length.to_string();
  210         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  211         -
        }
  212         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         458  +
        let protocol = _cfg
         459  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         460  +
            .expect("a SharedClientProtocol is required");
         461  +
        let mut request = protocol
         462  +
            .serialize_request(&input, ReplicateKey::INPUT_SCHEMA, "", _cfg)
         463  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         464  +
         465  +
        return ::std::result::Result::Ok(request);
  213    466   
    }
  214    467   
}
  215    468   
#[derive(Debug)]
  216    469   
struct ReplicateKeyEndpointParamsInterceptor;
  217    470   
  218    471   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ReplicateKeyEndpointParamsInterceptor {
  219    472   
    fn name(&self) -> &'static str {
  220    473   
        "ReplicateKeyEndpointParamsInterceptor"
  221    474   
    }
  222    475   

tmp-codegen-diff/aws-sdk/sdk/kms/src/operation/replicate_key/_replicate_key_input.rs

@@ -117,117 +333,343 @@
  137    137   
    "com.amazonaws.kms.synthetic",
  138    138   
    "ReplicateKeyInput",
  139    139   
);
  140    140   
static REPLICATEKEYINPUT_MEMBER_KEY_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  141    141   
    ::aws_smithy_schema::ShapeId::from_static(
  142    142   
        "com.amazonaws.kms.synthetic#ReplicateKeyInput$KeyId",
  143    143   
        "com.amazonaws.kms.synthetic",
  144    144   
        "ReplicateKeyInput",
  145    145   
    ),
  146    146   
    ::aws_smithy_schema::ShapeType::String,
  147         -
    "key_id",
         147  +
    "KeyId",
  148    148   
    0,
  149    149   
);
  150    150   
static REPLICATEKEYINPUT_MEMBER_REPLICA_REGION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  151    151   
    ::aws_smithy_schema::ShapeId::from_static(
  152    152   
        "com.amazonaws.kms.synthetic#ReplicateKeyInput$ReplicaRegion",
  153    153   
        "com.amazonaws.kms.synthetic",
  154    154   
        "ReplicateKeyInput",
  155    155   
    ),
  156    156   
    ::aws_smithy_schema::ShapeType::String,
  157         -
    "replica_region",
         157  +
    "ReplicaRegion",
  158    158   
    1,
  159    159   
);
  160    160   
static REPLICATEKEYINPUT_MEMBER_POLICY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  161    161   
    ::aws_smithy_schema::ShapeId::from_static(
  162    162   
        "com.amazonaws.kms.synthetic#ReplicateKeyInput$Policy",
  163    163   
        "com.amazonaws.kms.synthetic",
  164    164   
        "ReplicateKeyInput",
  165    165   
    ),
  166    166   
    ::aws_smithy_schema::ShapeType::String,
  167         -
    "policy",
         167  +
    "Policy",
  168    168   
    2,
  169    169   
);
  170    170   
static REPLICATEKEYINPUT_MEMBER_BYPASS_POLICY_LOCKOUT_SAFETY_CHECK: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  171    171   
    ::aws_smithy_schema::ShapeId::from_static(
  172    172   
        "com.amazonaws.kms.synthetic#ReplicateKeyInput$BypassPolicyLockoutSafetyCheck",
  173    173   
        "com.amazonaws.kms.synthetic",
  174    174   
        "ReplicateKeyInput",
  175    175   
    ),
  176    176   
    ::aws_smithy_schema::ShapeType::Boolean,
  177         -
    "bypass_policy_lockout_safety_check",
         177  +
    "BypassPolicyLockoutSafetyCheck",
  178    178   
    3,
  179    179   
);
  180    180   
static REPLICATEKEYINPUT_MEMBER_DESCRIPTION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  181    181   
    ::aws_smithy_schema::ShapeId::from_static(
  182    182   
        "com.amazonaws.kms.synthetic#ReplicateKeyInput$Description",
  183    183   
        "com.amazonaws.kms.synthetic",
  184    184   
        "ReplicateKeyInput",
  185    185   
    ),
  186    186   
    ::aws_smithy_schema::ShapeType::String,
  187         -
    "description",
         187  +
    "Description",
  188    188   
    4,
  189    189   
);
  190    190   
static REPLICATEKEYINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  191    191   
    ::aws_smithy_schema::ShapeId::from_static(
  192    192   
        "com.amazonaws.kms.synthetic#ReplicateKeyInput$Tags",
  193    193   
        "com.amazonaws.kms.synthetic",
  194    194   
        "ReplicateKeyInput",
  195    195   
    ),
  196    196   
    ::aws_smithy_schema::ShapeType::List,
  197         -
    "tags",
         197  +
    "Tags",
  198    198   
    5,
  199    199   
);
  200    200   
static REPLICATEKEYINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  201    201   
    REPLICATEKEYINPUT_SCHEMA_ID,
  202    202   
    ::aws_smithy_schema::ShapeType::Structure,
  203    203   
    &[
  204    204   
        &REPLICATEKEYINPUT_MEMBER_KEY_ID,
  205    205   
        &REPLICATEKEYINPUT_MEMBER_REPLICA_REGION,
  206    206   
        &REPLICATEKEYINPUT_MEMBER_POLICY,
  207    207   
        &REPLICATEKEYINPUT_MEMBER_BYPASS_POLICY_LOCKOUT_SAFETY_CHECK,
  208    208   
        &REPLICATEKEYINPUT_MEMBER_DESCRIPTION,
  209    209   
        &REPLICATEKEYINPUT_MEMBER_TAGS,
  210    210   
    ],
  211    211   
);
  212    212   
impl ReplicateKeyInput {
  213    213   
    /// The schema for this shape.
  214    214   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &REPLICATEKEYINPUT_SCHEMA;
  215    215   
}
  216    216   
impl ::aws_smithy_schema::serde::SerializableStruct for ReplicateKeyInput {
  217    217   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  218    218   
    fn serialize_members(
  219    219   
        &self,
  220    220   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  221    221   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  222    222   
        if let Some(ref val) = self.key_id {
  223    223   
            ser.write_string(&REPLICATEKEYINPUT_MEMBER_KEY_ID, val)?;
  224    224   
        }
  225    225   
        if let Some(ref val) = self.replica_region {
  226    226   
            ser.write_string(&REPLICATEKEYINPUT_MEMBER_REPLICA_REGION, val)?;
  227    227   
        }
  228    228   
        if let Some(ref val) = self.policy {
  229    229   
            ser.write_string(&REPLICATEKEYINPUT_MEMBER_POLICY, val)?;
  230    230   
        }
  231    231   
        if let Some(ref val) = self.bypass_policy_lockout_safety_check {
  232    232   
            ser.write_boolean(&REPLICATEKEYINPUT_MEMBER_BYPASS_POLICY_LOCKOUT_SAFETY_CHECK, *val)?;
  233    233   
        }
  234    234   
        if let Some(ref val) = self.description {
  235    235   
            ser.write_string(&REPLICATEKEYINPUT_MEMBER_DESCRIPTION, val)?;
  236    236   
        }
  237    237   
        if let Some(ref val) = self.tags {
  238    238   
            ser.write_list(
  239    239   
                &REPLICATEKEYINPUT_MEMBER_TAGS,
  240    240   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  241    241   
                    for item in val {
  242    242   
                        ser.write_struct(crate::types::Tag::SCHEMA, item)?;
  243    243   
                    }
  244    244   
                    Ok(())
  245    245   
                },
  246    246   
            )?;
  247    247   
        }
  248    248   
        Ok(())
  249    249   
    }
  250    250   
}
  251    251   
impl ReplicateKeyInput {
  252    252   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  253         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  254         -
        deserializer: &mut D,
         253  +
    pub fn deserialize(
         254  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  255    255   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  256    256   
        #[allow(unused_variables, unused_mut)]
  257    257   
        let mut builder = Self::builder();
  258    258   
        #[allow(
  259    259   
            unused_variables,
  260    260   
            unreachable_code,
  261    261   
            clippy::single_match,
  262    262   
            clippy::match_single_binding,
  263    263   
            clippy::diverging_sub_expression
  264    264   
        )]
  265         -
        deserializer.read_struct(&REPLICATEKEYINPUT_SCHEMA, (), |_, member, deser| {
         265  +
        deserializer.read_struct(&REPLICATEKEYINPUT_SCHEMA, &mut |member, deser| {
  266    266   
            match member.member_index() {
  267    267   
                Some(0) => {
  268    268   
                    builder.key_id = Some(deser.read_string(member)?);
  269    269   
                }
  270    270   
                Some(1) => {
  271    271   
                    builder.replica_region = Some(deser.read_string(member)?);
  272    272   
                }
  273    273   
                Some(2) => {
  274    274   
                    builder.policy = Some(deser.read_string(member)?);
  275    275   
                }
  276    276   
                Some(3) => {
  277    277   
                    builder.bypass_policy_lockout_safety_check = Some(deser.read_boolean(member)?);
  278    278   
                }
  279    279   
                Some(4) => {
  280    280   
                    builder.description = Some(deser.read_string(member)?);
  281    281   
                }
  282    282   
                Some(5) => {
  283    283   
                    builder.tags = Some({
  284         -
                        let container = if let Some(cap) = deser.container_size() {
  285         -
                            Vec::with_capacity(cap)
  286         -
                        } else {
  287         -
                            Vec::new()
  288         -
                        };
  289         -
                        deser.read_list(member, container, |mut list, deser| {
  290         -
                            list.push(crate::types::Tag::deserialize(deser)?);
  291         -
                            Ok(list)
  292         -
                        })?
         284  +
                        let mut container = Vec::new();
         285  +
                        deser.read_list(member, &mut |deser| {
         286  +
                            container.push(crate::types::Tag::deserialize(deser)?);
         287  +
                            Ok(())
         288  +
                        })?;
         289  +
                        container
  293    290   
                    });
  294    291   
                }
  295    292   
                _ => {}
  296    293   
            }
  297    294   
            Ok(())
  298    295   
        })?;
         296  +
        builder.key_id = builder.key_id.or(Some(String::new()));
         297  +
        builder.replica_region = builder.replica_region.or(Some(String::new()));
  299    298   
        builder
  300    299   
            .build()
  301    300   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  302    301   
    }
  303    302   
}
         303  +
impl ReplicateKeyInput {
         304  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         305  +
    pub fn deserialize_with_response(
         306  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         307  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         308  +
        _status: u16,
         309  +
        _body: &[u8],
         310  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         311  +
        Self::deserialize(deserializer)
         312  +
    }
         313  +
}
  304    314   
impl ReplicateKeyInput {
  305    315   
    /// Creates a new builder-style object to manufacture [`ReplicateKeyInput`](crate::operation::replicate_key::ReplicateKeyInput).
  306    316   
    pub fn builder() -> crate::operation::replicate_key::builders::ReplicateKeyInputBuilder {
  307    317   
        crate::operation::replicate_key::builders::ReplicateKeyInputBuilder::default()
  308    318   
    }
  309    319   
}
  310    320   
  311    321   
/// A builder for [`ReplicateKeyInput`](crate::operation::replicate_key::ReplicateKeyInput).
  312    322   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  313    323   
#[non_exhaustive]

tmp-codegen-diff/aws-sdk/sdk/kms/src/operation/replicate_key/_replicate_key_output.rs

@@ -12,12 +166,221 @@
   32     32   
    "com.amazonaws.kms.synthetic",
   33     33   
    "ReplicateKeyOutput",
   34     34   
);
   35     35   
static REPLICATEKEYOUTPUT_MEMBER_REPLICA_KEY_METADATA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   36     36   
    ::aws_smithy_schema::ShapeId::from_static(
   37     37   
        "com.amazonaws.kms.synthetic#ReplicateKeyOutput$ReplicaKeyMetadata",
   38     38   
        "com.amazonaws.kms.synthetic",
   39     39   
        "ReplicateKeyOutput",
   40     40   
    ),
   41     41   
    ::aws_smithy_schema::ShapeType::Structure,
   42         -
    "replica_key_metadata",
          42  +
    "ReplicaKeyMetadata",
   43     43   
    0,
   44     44   
);
   45     45   
static REPLICATEKEYOUTPUT_MEMBER_REPLICA_POLICY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   46     46   
    ::aws_smithy_schema::ShapeId::from_static(
   47     47   
        "com.amazonaws.kms.synthetic#ReplicateKeyOutput$ReplicaPolicy",
   48     48   
        "com.amazonaws.kms.synthetic",
   49     49   
        "ReplicateKeyOutput",
   50     50   
    ),
   51     51   
    ::aws_smithy_schema::ShapeType::String,
   52         -
    "replica_policy",
          52  +
    "ReplicaPolicy",
   53     53   
    1,
   54     54   
);
   55     55   
static REPLICATEKEYOUTPUT_MEMBER_REPLICA_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   56     56   
    ::aws_smithy_schema::ShapeId::from_static(
   57     57   
        "com.amazonaws.kms.synthetic#ReplicateKeyOutput$ReplicaTags",
   58     58   
        "com.amazonaws.kms.synthetic",
   59     59   
        "ReplicateKeyOutput",
   60     60   
    ),
   61     61   
    ::aws_smithy_schema::ShapeType::List,
   62         -
    "replica_tags",
          62  +
    "ReplicaTags",
   63     63   
    2,
   64     64   
);
          65  +
static REPLICATEKEYOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          66  +
    ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
          67  +
    ::aws_smithy_schema::ShapeType::String,
          68  +
    "request_id",
          69  +
    3,
          70  +
)
          71  +
.with_http_header("x-amzn-requestid");
   65     72   
static REPLICATEKEYOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   66     73   
    REPLICATEKEYOUTPUT_SCHEMA_ID,
   67     74   
    ::aws_smithy_schema::ShapeType::Structure,
   68     75   
    &[
   69     76   
        &REPLICATEKEYOUTPUT_MEMBER_REPLICA_KEY_METADATA,
   70     77   
        &REPLICATEKEYOUTPUT_MEMBER_REPLICA_POLICY,
   71     78   
        &REPLICATEKEYOUTPUT_MEMBER_REPLICA_TAGS,
          79  +
        &REPLICATEKEYOUTPUT_MEMBER__REQUEST_ID,
   72     80   
    ],
   73     81   
);
   74     82   
impl ReplicateKeyOutput {
   75     83   
    /// The schema for this shape.
   76     84   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &REPLICATEKEYOUTPUT_SCHEMA;
   77     85   
}
   78     86   
impl ::aws_smithy_schema::serde::SerializableStruct for ReplicateKeyOutput {
   79     87   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   80     88   
    fn serialize_members(
   81     89   
        &self,
   82     90   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   83     91   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   84     92   
        if let Some(ref val) = self.replica_key_metadata {
   85     93   
            ser.write_struct(&REPLICATEKEYOUTPUT_MEMBER_REPLICA_KEY_METADATA, val)?;
   86     94   
        }
   87     95   
        if let Some(ref val) = self.replica_policy {
   88     96   
            ser.write_string(&REPLICATEKEYOUTPUT_MEMBER_REPLICA_POLICY, val)?;
   89     97   
        }
   90     98   
        if let Some(ref val) = self.replica_tags {
   91     99   
            ser.write_list(
   92    100   
                &REPLICATEKEYOUTPUT_MEMBER_REPLICA_TAGS,
   93    101   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
   94    102   
                    for item in val {
   95    103   
                        ser.write_struct(crate::types::Tag::SCHEMA, item)?;
   96    104   
                    }
   97    105   
                    Ok(())
   98    106   
                },
   99    107   
            )?;
  100    108   
        }
  101    109   
        Ok(())
  102    110   
    }
  103    111   
}
  104    112   
impl ReplicateKeyOutput {
  105    113   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  106         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  107         -
        deserializer: &mut D,
         114  +
    pub fn deserialize(
         115  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         116  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         117  +
        #[allow(unused_variables, unused_mut)]
         118  +
        let mut builder = Self::builder();
         119  +
        #[allow(
         120  +
            unused_variables,
         121  +
            unreachable_code,
         122  +
            clippy::single_match,
         123  +
            clippy::match_single_binding,
         124  +
            clippy::diverging_sub_expression
         125  +
        )]
         126  +
        deserializer.read_struct(&REPLICATEKEYOUTPUT_SCHEMA, &mut |member, deser| {
         127  +
            match member.member_index() {
         128  +
                Some(0) => {
         129  +
                    builder.replica_key_metadata = Some(crate::types::KeyMetadata::deserialize(deser)?);
         130  +
                }
         131  +
                Some(1) => {
         132  +
                    builder.replica_policy = Some(deser.read_string(member)?);
         133  +
                }
         134  +
                Some(2) => {
         135  +
                    builder.replica_tags = Some({
         136  +
                        let mut container = Vec::new();
         137  +
                        deser.read_list(member, &mut |deser| {
         138  +
                            container.push(crate::types::Tag::deserialize(deser)?);
         139  +
                            Ok(())
         140  +
                        })?;
         141  +
                        container
         142  +
                    });
         143  +
                }
         144  +
                Some(3) => {
         145  +
                    builder._request_id = Some(deser.read_string(member)?);
         146  +
                }
         147  +
                _ => {}
         148  +
            }
         149  +
            Ok(())
         150  +
        })?;
         151  +
        Ok(builder.build())
         152  +
    }
         153  +
}
         154  +
impl ReplicateKeyOutput {
         155  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         156  +
    /// Header-bound members are read directly from headers, avoiding runtime
         157  +
    /// member iteration overhead. Body members are read via the deserializer.
         158  +
    pub fn deserialize_with_response(
         159  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         160  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         161  +
        _status: u16,
         162  +
        _body: &[u8],
  108    163   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  109    164   
        #[allow(unused_variables, unused_mut)]
  110    165   
        let mut builder = Self::builder();
         166  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         167  +
            builder._request_id = Some(val.to_string());
         168  +
        }
  111    169   
        #[allow(
  112    170   
            unused_variables,
  113    171   
            unreachable_code,
  114    172   
            clippy::single_match,
  115    173   
            clippy::match_single_binding,
  116    174   
            clippy::diverging_sub_expression
  117    175   
        )]
  118         -
        deserializer.read_struct(&REPLICATEKEYOUTPUT_SCHEMA, (), |_, member, deser| {
         176  +
        deserializer.read_struct(&REPLICATEKEYOUTPUT_SCHEMA, &mut |member, deser| {
  119    177   
            match member.member_index() {
  120    178   
                Some(0) => {
  121    179   
                    builder.replica_key_metadata = Some(crate::types::KeyMetadata::deserialize(deser)?);
  122    180   
                }
  123    181   
                Some(1) => {
  124    182   
                    builder.replica_policy = Some(deser.read_string(member)?);
  125    183   
                }
  126    184   
                Some(2) => {
  127    185   
                    builder.replica_tags = Some({
  128         -
                        let container = if let Some(cap) = deser.container_size() {
  129         -
                            Vec::with_capacity(cap)
  130         -
                        } else {
  131         -
                            Vec::new()
  132         -
                        };
  133         -
                        deser.read_list(member, container, |mut list, deser| {
  134         -
                            list.push(crate::types::Tag::deserialize(deser)?);
  135         -
                            Ok(list)
  136         -
                        })?
         186  +
                        let mut container = Vec::new();
         187  +
                        deser.read_list(member, &mut |deser| {
         188  +
                            container.push(crate::types::Tag::deserialize(deser)?);
         189  +
                            Ok(())
         190  +
                        })?;
         191  +
                        container
  137    192   
                    });
  138    193   
                }
  139    194   
                _ => {}
  140    195   
            }
  141    196   
            Ok(())
  142    197   
        })?;
  143    198   
        Ok(builder.build())
  144    199   
    }
  145    200   
}
  146    201   
impl ::aws_types::request_id::RequestId for ReplicateKeyOutput {