AWS SDK

AWS SDK

rev. 96f5a1b4ad139d2f1ad1e8e40f300e1cd1ff574c (ignoring whitespace)

Files changed:

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

@@ -67,67 +177,177 @@
   87     87   
    "com.amazonaws.kms.synthetic",
   88     88   
    "GenerateDataKeyWithoutPlaintextInput",
   89     89   
);
   90     90   
static GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_MEMBER_KEY_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   91     91   
    ::aws_smithy_schema::ShapeId::from_static(
   92     92   
        "com.amazonaws.kms.synthetic#GenerateDataKeyWithoutPlaintextInput$KeyId",
   93     93   
        "com.amazonaws.kms.synthetic",
   94     94   
        "GenerateDataKeyWithoutPlaintextInput",
   95     95   
    ),
   96     96   
    ::aws_smithy_schema::ShapeType::String,
   97         -
    "key_id",
          97  +
    "KeyId",
   98     98   
    0,
   99     99   
);
  100    100   
static GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_MEMBER_ENCRYPTION_CONTEXT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  101    101   
    ::aws_smithy_schema::ShapeId::from_static(
  102    102   
        "com.amazonaws.kms.synthetic#GenerateDataKeyWithoutPlaintextInput$EncryptionContext",
  103    103   
        "com.amazonaws.kms.synthetic",
  104    104   
        "GenerateDataKeyWithoutPlaintextInput",
  105    105   
    ),
  106    106   
    ::aws_smithy_schema::ShapeType::Map,
  107         -
    "encryption_context",
         107  +
    "EncryptionContext",
  108    108   
    1,
  109    109   
);
  110    110   
static GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_MEMBER_KEY_SPEC: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  111    111   
    ::aws_smithy_schema::ShapeId::from_static(
  112    112   
        "com.amazonaws.kms.synthetic#GenerateDataKeyWithoutPlaintextInput$KeySpec",
  113    113   
        "com.amazonaws.kms.synthetic",
  114    114   
        "GenerateDataKeyWithoutPlaintextInput",
  115    115   
    ),
  116    116   
    ::aws_smithy_schema::ShapeType::String,
  117         -
    "key_spec",
         117  +
    "KeySpec",
  118    118   
    2,
  119    119   
);
  120    120   
static GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_MEMBER_NUMBER_OF_BYTES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  121    121   
    ::aws_smithy_schema::ShapeId::from_static(
  122    122   
        "com.amazonaws.kms.synthetic#GenerateDataKeyWithoutPlaintextInput$NumberOfBytes",
  123    123   
        "com.amazonaws.kms.synthetic",
  124    124   
        "GenerateDataKeyWithoutPlaintextInput",
  125    125   
    ),
  126    126   
    ::aws_smithy_schema::ShapeType::Integer,
  127         -
    "number_of_bytes",
         127  +
    "NumberOfBytes",
  128    128   
    3,
  129    129   
);
  130    130   
static GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_MEMBER_GRANT_TOKENS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  131    131   
    ::aws_smithy_schema::ShapeId::from_static(
  132    132   
        "com.amazonaws.kms.synthetic#GenerateDataKeyWithoutPlaintextInput$GrantTokens",
  133    133   
        "com.amazonaws.kms.synthetic",
  134    134   
        "GenerateDataKeyWithoutPlaintextInput",
  135    135   
    ),
  136    136   
    ::aws_smithy_schema::ShapeType::List,
  137         -
    "grant_tokens",
         137  +
    "GrantTokens",
  138    138   
    4,
  139    139   
);
  140    140   
static GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_MEMBER_DRY_RUN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  141    141   
    ::aws_smithy_schema::ShapeId::from_static(
  142    142   
        "com.amazonaws.kms.synthetic#GenerateDataKeyWithoutPlaintextInput$DryRun",
  143    143   
        "com.amazonaws.kms.synthetic",
  144    144   
        "GenerateDataKeyWithoutPlaintextInput",
  145    145   
    ),
  146    146   
    ::aws_smithy_schema::ShapeType::Boolean,
  147         -
    "dry_run",
         147  +
    "DryRun",
  148    148   
    5,
  149    149   
);
  150    150   
static GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  151    151   
    GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_SCHEMA_ID,
  152    152   
    ::aws_smithy_schema::ShapeType::Structure,
  153    153   
    &[
  154    154   
        &GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_MEMBER_KEY_ID,
  155    155   
        &GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_MEMBER_ENCRYPTION_CONTEXT,
  156    156   
        &GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_MEMBER_KEY_SPEC,
  157    157   
        &GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_MEMBER_NUMBER_OF_BYTES,
@@ -182,182 +302,294 @@
  202    202   
            )?;
  203    203   
        }
  204    204   
        if let Some(ref val) = self.dry_run {
  205    205   
            ser.write_boolean(&GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_MEMBER_DRY_RUN, *val)?;
  206    206   
        }
  207    207   
        Ok(())
  208    208   
    }
  209    209   
}
  210    210   
impl GenerateDataKeyWithoutPlaintextInput {
  211    211   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  212         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  213         -
        deserializer: &mut D,
         212  +
    pub fn deserialize(
         213  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  214    214   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  215    215   
        #[allow(unused_variables, unused_mut)]
  216    216   
        let mut builder = Self::builder();
  217    217   
        #[allow(
  218    218   
            unused_variables,
  219    219   
            unreachable_code,
  220    220   
            clippy::single_match,
  221    221   
            clippy::match_single_binding,
  222    222   
            clippy::diverging_sub_expression
  223    223   
        )]
  224         -
        deserializer.read_struct(&GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_SCHEMA, (), |_, member, deser| {
         224  +
        deserializer.read_struct(&GENERATEDATAKEYWITHOUTPLAINTEXTINPUT_SCHEMA, &mut |member, deser| {
  225    225   
            match member.member_index() {
  226    226   
                Some(0) => {
  227    227   
                    builder.key_id = Some(deser.read_string(member)?);
  228    228   
                }
  229    229   
                Some(1) => {
  230         -
                    builder.encryption_context = Some({
  231         -
                        let container = if let Some(cap) = deser.container_size() {
  232         -
                            std::collections::HashMap::with_capacity(cap)
  233         -
                        } else {
  234         -
                            std::collections::HashMap::new()
  235         -
                        };
  236         -
                        deser.read_map(member, container, |mut map, key, deser| {
  237         -
                            map.insert(key, deser.read_string(member)?);
  238         -
                            Ok(map)
  239         -
                        })?
  240         -
                    });
         230  +
                    builder.encryption_context = Some(deser.read_string_string_map(member)?);
  241    231   
                }
  242    232   
                Some(2) => {
  243    233   
                    builder.key_spec = Some(crate::types::DataKeySpec::from(deser.read_string(member)?.as_str()));
  244    234   
                }
  245    235   
                Some(3) => {
  246    236   
                    builder.number_of_bytes = Some(deser.read_integer(member)?);
  247    237   
                }
  248    238   
                Some(4) => {
  249         -
                    builder.grant_tokens = Some({
  250         -
                        let container = if let Some(cap) = deser.container_size() {
  251         -
                            Vec::with_capacity(cap)
  252         -
                        } else {
  253         -
                            Vec::new()
  254         -
                        };
  255         -
                        deser.read_list(member, container, |mut list, deser| {
  256         -
                            list.push(deser.read_string(member)?);
  257         -
                            Ok(list)
  258         -
                        })?
  259         -
                    });
         239  +
                    builder.grant_tokens = Some(deser.read_string_list(member)?);
  260    240   
                }
  261    241   
                Some(5) => {
  262    242   
                    builder.dry_run = Some(deser.read_boolean(member)?);
  263    243   
                }
  264    244   
                _ => {}
  265    245   
            }
  266    246   
            Ok(())
  267    247   
        })?;
         248  +
        builder.key_id = builder.key_id.or(Some(String::new()));
  268    249   
        builder
  269    250   
            .build()
  270    251   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  271    252   
    }
  272    253   
}
         254  +
impl GenerateDataKeyWithoutPlaintextInput {
         255  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         256  +
    pub fn deserialize_with_response(
         257  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         258  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         259  +
        _status: u16,
         260  +
        _body: &[u8],
         261  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         262  +
        Self::deserialize(deserializer)
         263  +
    }
         264  +
}
  273    265   
impl GenerateDataKeyWithoutPlaintextInput {
  274    266   
    /// Creates a new builder-style object to manufacture [`GenerateDataKeyWithoutPlaintextInput`](crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextInput).
  275    267   
    pub fn builder() -> crate::operation::generate_data_key_without_plaintext::builders::GenerateDataKeyWithoutPlaintextInputBuilder {
  276    268   
        crate::operation::generate_data_key_without_plaintext::builders::GenerateDataKeyWithoutPlaintextInputBuilder::default()
  277    269   
    }
  278    270   
}
  279    271   
  280    272   
/// A builder for [`GenerateDataKeyWithoutPlaintextInput`](crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextInput).
  281    273   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  282    274   
#[non_exhaustive]

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

@@ -10,10 +138,189 @@
   30     30   
    "com.amazonaws.kms.synthetic",
   31     31   
    "GenerateDataKeyWithoutPlaintextOutput",
   32     32   
);
   33     33   
static GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_MEMBER_CIPHERTEXT_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   34     34   
    ::aws_smithy_schema::ShapeId::from_static(
   35     35   
        "com.amazonaws.kms.synthetic#GenerateDataKeyWithoutPlaintextOutput$CiphertextBlob",
   36     36   
        "com.amazonaws.kms.synthetic",
   37     37   
        "GenerateDataKeyWithoutPlaintextOutput",
   38     38   
    ),
   39     39   
    ::aws_smithy_schema::ShapeType::Blob,
   40         -
    "ciphertext_blob",
          40  +
    "CiphertextBlob",
   41     41   
    0,
   42     42   
);
   43     43   
static GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_MEMBER_KEY_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   44     44   
    ::aws_smithy_schema::ShapeId::from_static(
   45     45   
        "com.amazonaws.kms.synthetic#GenerateDataKeyWithoutPlaintextOutput$KeyId",
   46     46   
        "com.amazonaws.kms.synthetic",
   47     47   
        "GenerateDataKeyWithoutPlaintextOutput",
   48     48   
    ),
   49     49   
    ::aws_smithy_schema::ShapeType::String,
   50         -
    "key_id",
          50  +
    "KeyId",
   51     51   
    1,
   52     52   
);
   53     53   
static GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_MEMBER_KEY_MATERIAL_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   54     54   
    ::aws_smithy_schema::ShapeId::from_static(
   55     55   
        "com.amazonaws.kms.synthetic#GenerateDataKeyWithoutPlaintextOutput$KeyMaterialId",
   56     56   
        "com.amazonaws.kms.synthetic",
   57     57   
        "GenerateDataKeyWithoutPlaintextOutput",
   58     58   
    ),
   59     59   
    ::aws_smithy_schema::ShapeType::String,
   60         -
    "key_material_id",
          60  +
    "KeyMaterialId",
   61     61   
    2,
   62     62   
);
          63  +
static GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          64  +
    ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
          65  +
    ::aws_smithy_schema::ShapeType::String,
          66  +
    "request_id",
          67  +
    3,
          68  +
)
          69  +
.with_http_header("x-amzn-requestid");
   63     70   
static GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   64     71   
    GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_SCHEMA_ID,
   65     72   
    ::aws_smithy_schema::ShapeType::Structure,
   66     73   
    &[
   67     74   
        &GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_MEMBER_CIPHERTEXT_BLOB,
   68     75   
        &GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_MEMBER_KEY_ID,
   69     76   
        &GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_MEMBER_KEY_MATERIAL_ID,
          77  +
        &GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_MEMBER__REQUEST_ID,
   70     78   
    ],
   71     79   
);
   72     80   
impl GenerateDataKeyWithoutPlaintextOutput {
   73     81   
    /// The schema for this shape.
   74     82   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_SCHEMA;
   75     83   
}
   76     84   
impl ::aws_smithy_schema::serde::SerializableStruct for GenerateDataKeyWithoutPlaintextOutput {
   77     85   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   78     86   
    fn serialize_members(
   79     87   
        &self,
   80     88   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   81     89   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   82     90   
        if let Some(ref val) = self.ciphertext_blob {
   83     91   
            ser.write_blob(&GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_MEMBER_CIPHERTEXT_BLOB, val)?;
   84     92   
        }
   85     93   
        if let Some(ref val) = self.key_id {
   86     94   
            ser.write_string(&GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_MEMBER_KEY_ID, val)?;
   87     95   
        }
   88     96   
        if let Some(ref val) = self.key_material_id {
   89     97   
            ser.write_string(&GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_MEMBER_KEY_MATERIAL_ID, val)?;
   90     98   
        }
   91     99   
        Ok(())
   92    100   
    }
   93    101   
}
   94    102   
impl GenerateDataKeyWithoutPlaintextOutput {
   95    103   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   96         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   97         -
        deserializer: &mut D,
         104  +
    pub fn deserialize(
         105  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   98    106   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   99    107   
        #[allow(unused_variables, unused_mut)]
  100    108   
        let mut builder = Self::builder();
  101    109   
        #[allow(
  102    110   
            unused_variables,
  103    111   
            unreachable_code,
  104    112   
            clippy::single_match,
  105    113   
            clippy::match_single_binding,
  106    114   
            clippy::diverging_sub_expression
  107    115   
        )]
  108         -
        deserializer.read_struct(&GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_SCHEMA, (), |_, member, deser| {
         116  +
        deserializer.read_struct(&GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_SCHEMA, &mut |member, deser| {
         117  +
            match member.member_index() {
         118  +
                Some(0) => {
         119  +
                    builder.ciphertext_blob = Some(deser.read_blob(member)?);
         120  +
                }
         121  +
                Some(1) => {
         122  +
                    builder.key_id = Some(deser.read_string(member)?);
         123  +
                }
         124  +
                Some(2) => {
         125  +
                    builder.key_material_id = Some(deser.read_string(member)?);
         126  +
                }
         127  +
                Some(3) => {
         128  +
                    builder._request_id = Some(deser.read_string(member)?);
         129  +
                }
         130  +
                _ => {}
         131  +
            }
         132  +
            Ok(())
         133  +
        })?;
         134  +
        Ok(builder.build())
         135  +
    }
         136  +
}
         137  +
impl GenerateDataKeyWithoutPlaintextOutput {
         138  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         139  +
    /// Header-bound members are read directly from headers, avoiding runtime
         140  +
    /// member iteration overhead. Body members are read via the deserializer.
         141  +
    pub fn deserialize_with_response(
         142  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         143  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         144  +
        _status: u16,
         145  +
        _body: &[u8],
         146  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         147  +
        #[allow(unused_variables, unused_mut)]
         148  +
        let mut builder = Self::builder();
         149  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         150  +
            builder._request_id = Some(val.to_string());
         151  +
        }
         152  +
        #[allow(
         153  +
            unused_variables,
         154  +
            unreachable_code,
         155  +
            clippy::single_match,
         156  +
            clippy::match_single_binding,
         157  +
            clippy::diverging_sub_expression
         158  +
        )]
         159  +
        deserializer.read_struct(&GENERATEDATAKEYWITHOUTPLAINTEXTOUTPUT_SCHEMA, &mut |member, deser| {
  109    160   
            match member.member_index() {
  110    161   
                Some(0) => {
  111    162   
                    builder.ciphertext_blob = Some(deser.read_blob(member)?);
  112    163   
                }
  113    164   
                Some(1) => {
  114    165   
                    builder.key_id = Some(deser.read_string(member)?);
  115    166   
                }
  116    167   
                Some(2) => {
  117    168   
                    builder.key_material_id = Some(deser.read_string(member)?);
  118    169   
                }

tmp-codegen-diff/aws-sdk/sdk/kms/src/operation/generate_mac.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 `GenerateMac`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct GenerateMac;
    6      6   
impl GenerateMac {
    7      7   
    /// Creates a new `GenerateMac`
    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::generate_mac::GenerateMacInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::generate_mac::GenerateMacOutput::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::generate_mac::GenerateMacInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::generate_mac::GenerateMacOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::generate_mac::GenerateMacError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -115,119 +242,447 @@
  135    139   
                crate::operation::generate_mac::GenerateMacError,
  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 GenerateMacResponseDeserializer;
  144    148   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GenerateMacResponseDeserializer {
  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_generate_mac::de_generate_mac_http_error(status, headers, body)
  157         -
        } else {
  158         -
            crate::protocol_serde::shape_generate_mac::de_generate_mac_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::generate_mac::GenerateMacError::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  +
                "DisabledException" => crate::operation::generate_mac::GenerateMacError::DisabledException({
         181  +
                    let mut tmp = match protocol
         182  +
                        .deserialize_response(response, crate::types::error::DisabledException::SCHEMA, _cfg)
         183  +
                        .and_then(|mut deser| {
         184  +
                            crate::types::error::DisabledException::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  +
                "DryRunOperationException" => crate::operation::generate_mac::GenerateMacError::DryRunOperationException({
         205  +
                    let mut tmp = match protocol
         206  +
                        .deserialize_response(response, crate::types::error::DryRunOperationException::SCHEMA, _cfg)
         207  +
                        .and_then(|mut deser| {
         208  +
                            crate::types::error::DryRunOperationException::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  +
                "InvalidGrantTokenException" => crate::operation::generate_mac::GenerateMacError::InvalidGrantTokenException({
         229  +
                    let mut tmp = match protocol
         230  +
                        .deserialize_response(response, crate::types::error::InvalidGrantTokenException::SCHEMA, _cfg)
         231  +
                        .and_then(|mut deser| {
         232  +
                            crate::types::error::InvalidGrantTokenException::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  +
                        }
  159    245   
                    };
  160         -
        crate::protocol_serde::type_erase_result(parse_result)
         246  +
                    tmp.meta = generic;
         247  +
                    if tmp.message.is_none() {
         248  +
                        tmp.message = _error_message;
         249  +
                    }
         250  +
                    tmp
         251  +
                }),
         252  +
                "InvalidKeyUsageException" => crate::operation::generate_mac::GenerateMacError::InvalidKeyUsageException({
         253  +
                    let mut tmp = match protocol
         254  +
                        .deserialize_response(response, crate::types::error::InvalidKeyUsageException::SCHEMA, _cfg)
         255  +
                        .and_then(|mut deser| {
         256  +
                            crate::types::error::InvalidKeyUsageException::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  +
                "KeyUnavailableException" => crate::operation::generate_mac::GenerateMacError::KeyUnavailableException({
         277  +
                    let mut tmp = match protocol
         278  +
                        .deserialize_response(response, crate::types::error::KeyUnavailableException::SCHEMA, _cfg)
         279  +
                        .and_then(|mut deser| {
         280  +
                            crate::types::error::KeyUnavailableException::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  +
                "KMSInternalException" => crate::operation::generate_mac::GenerateMacError::KmsInternalException({
         301  +
                    let mut tmp = match protocol
         302  +
                        .deserialize_response(response, crate::types::error::KmsInternalException::SCHEMA, _cfg)
         303  +
                        .and_then(|mut deser| {
         304  +
                            crate::types::error::KmsInternalException::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  +
                "KMSInvalidStateException" => crate::operation::generate_mac::GenerateMacError::KmsInvalidStateException({
         325  +
                    let mut tmp = match protocol
         326  +
                        .deserialize_response(response, crate::types::error::KmsInvalidStateException::SCHEMA, _cfg)
         327  +
                        .and_then(|mut deser| {
         328  +
                            crate::types::error::KmsInvalidStateException::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::generate_mac::GenerateMacError::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  +
                _ => crate::operation::generate_mac::GenerateMacError::generic(generic),
         373  +
            };
         374  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         375  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         376  +
            ))
         377  +
        } else {
         378  +
            let protocol = _cfg
         379  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         380  +
                .expect("a SharedClientProtocol is required");
         381  +
            let mut deser = protocol.deserialize_response(response, GenerateMac::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         382  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         383  +
            })?;
         384  +
            let body = response.body().bytes().expect("body loaded");
         385  +
            let output = crate::operation::generate_mac::GenerateMacOutput::deserialize_with_response(
         386  +
                &mut *deser,
         387  +
                response.headers(),
         388  +
                response.status().into(),
         389  +
                body,
         390  +
            )
         391  +
            .map_err(|e| {
         392  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         393  +
            })?;
         394  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         395  +
        }
  161    396   
    }
  162    397   
}
  163    398   
#[derive(Debug)]
  164    399   
struct GenerateMacRequestSerializer;
  165    400   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GenerateMacRequestSerializer {
  166    401   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  167    402   
    fn serialize_input(
  168    403   
        &self,
  169    404   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  170    405   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  171    406   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  172    407   
        let input = input
  173    408   
            .downcast::<crate::operation::generate_mac::GenerateMacInput>()
  174    409   
            .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::generate_mac::GenerateMacInput,
  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::generate_mac::GenerateMacInput,
  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.GenerateMac",
  204         -
            );
  205         -
            builder
  206         -
        };
  207         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_generate_mac::ser_generate_mac_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())
         410  +
        let protocol = _cfg
         411  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         412  +
            .expect("a SharedClientProtocol is required");
         413  +
        let mut request = protocol
         414  +
            .serialize_request(&input, GenerateMac::INPUT_SCHEMA, "", _cfg)
         415  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         416  +
         417  +
        return ::std::result::Result::Ok(request);
  213    418   
    }
  214    419   
}
  215    420   
#[derive(Debug)]
  216    421   
struct GenerateMacEndpointParamsInterceptor;
  217    422   
  218    423   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GenerateMacEndpointParamsInterceptor {
  219    424   
    fn name(&self) -> &'static str {
  220    425   
        "GenerateMacEndpointParamsInterceptor"
  221    426   
    }
  222    427   

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

@@ -44,44 +243,246 @@
   64     64   
    "com.amazonaws.kms.synthetic",
   65     65   
    "GenerateMacInput",
   66     66   
);
   67     67   
static GENERATEMACINPUT_MEMBER_MESSAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   68     68   
    ::aws_smithy_schema::ShapeId::from_static(
   69     69   
        "com.amazonaws.kms.synthetic#GenerateMacInput$Message",
   70     70   
        "com.amazonaws.kms.synthetic",
   71     71   
        "GenerateMacInput",
   72     72   
    ),
   73     73   
    ::aws_smithy_schema::ShapeType::Blob,
   74         -
    "message",
          74  +
    "Message",
   75     75   
    0,
   76     76   
);
   77     77   
static GENERATEMACINPUT_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#GenerateMacInput$KeyId",
   80     80   
        "com.amazonaws.kms.synthetic",
   81     81   
        "GenerateMacInput",
   82     82   
    ),
   83     83   
    ::aws_smithy_schema::ShapeType::String,
   84         -
    "key_id",
          84  +
    "KeyId",
   85     85   
    1,
   86     86   
);
   87     87   
static GENERATEMACINPUT_MEMBER_MAC_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#GenerateMacInput$MacAlgorithm",
   90     90   
        "com.amazonaws.kms.synthetic",
   91     91   
        "GenerateMacInput",
   92     92   
    ),
   93     93   
    ::aws_smithy_schema::ShapeType::String,
   94         -
    "mac_algorithm",
          94  +
    "MacAlgorithm",
   95     95   
    2,
   96     96   
);
   97     97   
static GENERATEMACINPUT_MEMBER_GRANT_TOKENS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   98     98   
    ::aws_smithy_schema::ShapeId::from_static(
   99     99   
        "com.amazonaws.kms.synthetic#GenerateMacInput$GrantTokens",
  100    100   
        "com.amazonaws.kms.synthetic",
  101    101   
        "GenerateMacInput",
  102    102   
    ),
  103    103   
    ::aws_smithy_schema::ShapeType::List,
  104         -
    "grant_tokens",
         104  +
    "GrantTokens",
  105    105   
    3,
  106    106   
);
  107    107   
static GENERATEMACINPUT_MEMBER_DRY_RUN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  108    108   
    ::aws_smithy_schema::ShapeId::from_static(
  109    109   
        "com.amazonaws.kms.synthetic#GenerateMacInput$DryRun",
  110    110   
        "com.amazonaws.kms.synthetic",
  111    111   
        "GenerateMacInput",
  112    112   
    ),
  113    113   
    ::aws_smithy_schema::ShapeType::Boolean,
  114         -
    "dry_run",
         114  +
    "DryRun",
  115    115   
    4,
  116    116   
);
  117    117   
static GENERATEMACINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  118    118   
    GENERATEMACINPUT_SCHEMA_ID,
  119    119   
    ::aws_smithy_schema::ShapeType::Structure,
  120    120   
    &[
  121    121   
        &GENERATEMACINPUT_MEMBER_MESSAGE,
  122    122   
        &GENERATEMACINPUT_MEMBER_KEY_ID,
  123    123   
        &GENERATEMACINPUT_MEMBER_MAC_ALGORITHM,
  124    124   
        &GENERATEMACINPUT_MEMBER_GRANT_TOKENS,
  125    125   
        &GENERATEMACINPUT_MEMBER_DRY_RUN,
  126    126   
    ],
  127    127   
);
  128    128   
impl GenerateMacInput {
  129    129   
    /// The schema for this shape.
  130    130   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GENERATEMACINPUT_SCHEMA;
  131    131   
}
  132    132   
impl ::aws_smithy_schema::serde::SerializableStruct for GenerateMacInput {
  133    133   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  134    134   
    fn serialize_members(
  135    135   
        &self,
  136    136   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  137    137   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  138    138   
        if let Some(ref val) = self.message {
  139    139   
            ser.write_blob(&GENERATEMACINPUT_MEMBER_MESSAGE, val)?;
  140    140   
        }
  141    141   
        if let Some(ref val) = self.key_id {
  142    142   
            ser.write_string(&GENERATEMACINPUT_MEMBER_KEY_ID, val)?;
  143    143   
        }
  144    144   
        if let Some(ref val) = self.mac_algorithm {
  145    145   
            ser.write_string(&GENERATEMACINPUT_MEMBER_MAC_ALGORITHM, val.as_str())?;
  146    146   
        }
  147    147   
        if let Some(ref val) = self.grant_tokens {
  148    148   
            ser.write_list(
  149    149   
                &GENERATEMACINPUT_MEMBER_GRANT_TOKENS,
  150    150   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  151    151   
                    for item in val {
  152    152   
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
  153    153   
                    }
  154    154   
                    Ok(())
  155    155   
                },
  156    156   
            )?;
  157    157   
        }
  158    158   
        if let Some(ref val) = self.dry_run {
  159    159   
            ser.write_boolean(&GENERATEMACINPUT_MEMBER_DRY_RUN, *val)?;
  160    160   
        }
  161    161   
        Ok(())
  162    162   
    }
  163    163   
}
  164    164   
impl GenerateMacInput {
  165    165   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  166         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  167         -
        deserializer: &mut D,
         166  +
    pub fn deserialize(
         167  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  168    168   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  169    169   
        #[allow(unused_variables, unused_mut)]
  170    170   
        let mut builder = Self::builder();
  171    171   
        #[allow(
  172    172   
            unused_variables,
  173    173   
            unreachable_code,
  174    174   
            clippy::single_match,
  175    175   
            clippy::match_single_binding,
  176    176   
            clippy::diverging_sub_expression
  177    177   
        )]
  178         -
        deserializer.read_struct(&GENERATEMACINPUT_SCHEMA, (), |_, member, deser| {
         178  +
        deserializer.read_struct(&GENERATEMACINPUT_SCHEMA, &mut |member, deser| {
  179    179   
            match member.member_index() {
  180    180   
                Some(0) => {
  181    181   
                    builder.message = Some(deser.read_blob(member)?);
  182    182   
                }
  183    183   
                Some(1) => {
  184    184   
                    builder.key_id = Some(deser.read_string(member)?);
  185    185   
                }
  186    186   
                Some(2) => {
  187    187   
                    builder.mac_algorithm = Some(crate::types::MacAlgorithmSpec::from(deser.read_string(member)?.as_str()));
  188    188   
                }
  189    189   
                Some(3) => {
  190         -
                    builder.grant_tokens = Some({
  191         -
                        let container = if let Some(cap) = deser.container_size() {
  192         -
                            Vec::with_capacity(cap)
  193         -
                        } else {
  194         -
                            Vec::new()
  195         -
                        };
  196         -
                        deser.read_list(member, container, |mut list, deser| {
  197         -
                            list.push(deser.read_string(member)?);
  198         -
                            Ok(list)
  199         -
                        })?
  200         -
                    });
         190  +
                    builder.grant_tokens = Some(deser.read_string_list(member)?);
  201    191   
                }
  202    192   
                Some(4) => {
  203    193   
                    builder.dry_run = Some(deser.read_boolean(member)?);
  204    194   
                }
  205    195   
                _ => {}
  206    196   
            }
  207    197   
            Ok(())
  208    198   
        })?;
         199  +
        builder.message = builder.message.or(Some(::aws_smithy_types::Blob::new("")));
         200  +
        builder.key_id = builder.key_id.or(Some(String::new()));
  209    201   
        builder
  210    202   
            .build()
  211    203   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  212    204   
    }
  213    205   
}
         206  +
impl GenerateMacInput {
         207  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         208  +
    pub fn deserialize_with_response(
         209  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         210  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         211  +
        _status: u16,
         212  +
        _body: &[u8],
         213  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         214  +
        Self::deserialize(deserializer)
         215  +
    }
         216  +
}
  214    217   
impl GenerateMacInput {
  215    218   
    /// Creates a new builder-style object to manufacture [`GenerateMacInput`](crate::operation::generate_mac::GenerateMacInput).
  216    219   
    pub fn builder() -> crate::operation::generate_mac::builders::GenerateMacInputBuilder {
  217    220   
        crate::operation::generate_mac::builders::GenerateMacInputBuilder::default()
  218    221   
    }
  219    222   
}
  220    223   
  221    224   
/// A builder for [`GenerateMacInput`](crate::operation::generate_mac::GenerateMacInput).
  222    225   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
  223    226   
#[non_exhaustive]

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

@@ -12,12 +140,191 @@
   32     32   
    "com.amazonaws.kms.synthetic",
   33     33   
    "GenerateMacOutput",
   34     34   
);
   35     35   
static GENERATEMACOUTPUT_MEMBER_MAC: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   36     36   
    ::aws_smithy_schema::ShapeId::from_static(
   37     37   
        "com.amazonaws.kms.synthetic#GenerateMacOutput$Mac",
   38     38   
        "com.amazonaws.kms.synthetic",
   39     39   
        "GenerateMacOutput",
   40     40   
    ),
   41     41   
    ::aws_smithy_schema::ShapeType::Blob,
   42         -
    "mac",
          42  +
    "Mac",
   43     43   
    0,
   44     44   
);
   45     45   
static GENERATEMACOUTPUT_MEMBER_MAC_ALGORITHM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   46     46   
    ::aws_smithy_schema::ShapeId::from_static(
   47     47   
        "com.amazonaws.kms.synthetic#GenerateMacOutput$MacAlgorithm",
   48     48   
        "com.amazonaws.kms.synthetic",
   49     49   
        "GenerateMacOutput",
   50     50   
    ),
   51     51   
    ::aws_smithy_schema::ShapeType::String,
   52         -
    "mac_algorithm",
          52  +
    "MacAlgorithm",
   53     53   
    1,
   54     54   
);
   55     55   
static GENERATEMACOUTPUT_MEMBER_KEY_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   56     56   
    ::aws_smithy_schema::ShapeId::from_static(
   57     57   
        "com.amazonaws.kms.synthetic#GenerateMacOutput$KeyId",
   58     58   
        "com.amazonaws.kms.synthetic",
   59     59   
        "GenerateMacOutput",
   60     60   
    ),
   61     61   
    ::aws_smithy_schema::ShapeType::String,
   62         -
    "key_id",
          62  +
    "KeyId",
   63     63   
    2,
   64     64   
);
          65  +
static GENERATEMACOUTPUT_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 GENERATEMACOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   66     73   
    GENERATEMACOUTPUT_SCHEMA_ID,
   67     74   
    ::aws_smithy_schema::ShapeType::Structure,
   68     75   
    &[
   69     76   
        &GENERATEMACOUTPUT_MEMBER_MAC,
   70     77   
        &GENERATEMACOUTPUT_MEMBER_MAC_ALGORITHM,
   71     78   
        &GENERATEMACOUTPUT_MEMBER_KEY_ID,
          79  +
        &GENERATEMACOUTPUT_MEMBER__REQUEST_ID,
   72     80   
    ],
   73     81   
);
   74     82   
impl GenerateMacOutput {
   75     83   
    /// The schema for this shape.
   76     84   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GENERATEMACOUTPUT_SCHEMA;
   77     85   
}
   78     86   
impl ::aws_smithy_schema::serde::SerializableStruct for GenerateMacOutput {
   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.mac {
   85     93   
            ser.write_blob(&GENERATEMACOUTPUT_MEMBER_MAC, val)?;
   86     94   
        }
   87     95   
        if let Some(ref val) = self.mac_algorithm {
   88     96   
            ser.write_string(&GENERATEMACOUTPUT_MEMBER_MAC_ALGORITHM, val.as_str())?;
   89     97   
        }
   90     98   
        if let Some(ref val) = self.key_id {
   91     99   
            ser.write_string(&GENERATEMACOUTPUT_MEMBER_KEY_ID, val)?;
   92    100   
        }
   93    101   
        Ok(())
   94    102   
    }
   95    103   
}
   96    104   
impl GenerateMacOutput {
   97    105   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   98         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   99         -
        deserializer: &mut D,
         106  +
    pub fn deserialize(
         107  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  100    108   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  101    109   
        #[allow(unused_variables, unused_mut)]
  102    110   
        let mut builder = Self::builder();
  103    111   
        #[allow(
  104    112   
            unused_variables,
  105    113   
            unreachable_code,
  106    114   
            clippy::single_match,
  107    115   
            clippy::match_single_binding,
  108    116   
            clippy::diverging_sub_expression
  109    117   
        )]
  110         -
        deserializer.read_struct(&GENERATEMACOUTPUT_SCHEMA, (), |_, member, deser| {
         118  +
        deserializer.read_struct(&GENERATEMACOUTPUT_SCHEMA, &mut |member, deser| {
         119  +
            match member.member_index() {
         120  +
                Some(0) => {
         121  +
                    builder.mac = Some(deser.read_blob(member)?);
         122  +
                }
         123  +
                Some(1) => {
         124  +
                    builder.mac_algorithm = Some(crate::types::MacAlgorithmSpec::from(deser.read_string(member)?.as_str()));
         125  +
                }
         126  +
                Some(2) => {
         127  +
                    builder.key_id = Some(deser.read_string(member)?);
         128  +
                }
         129  +
                Some(3) => {
         130  +
                    builder._request_id = Some(deser.read_string(member)?);
         131  +
                }
         132  +
                _ => {}
         133  +
            }
         134  +
            Ok(())
         135  +
        })?;
         136  +
        Ok(builder.build())
         137  +
    }
         138  +
}
         139  +
impl GenerateMacOutput {
         140  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         141  +
    /// Header-bound members are read directly from headers, avoiding runtime
         142  +
    /// member iteration overhead. Body members are read via the deserializer.
         143  +
    pub fn deserialize_with_response(
         144  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         145  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         146  +
        _status: u16,
         147  +
        _body: &[u8],
         148  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         149  +
        #[allow(unused_variables, unused_mut)]
         150  +
        let mut builder = Self::builder();
         151  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         152  +
            builder._request_id = Some(val.to_string());
         153  +
        }
         154  +
        #[allow(
         155  +
            unused_variables,
         156  +
            unreachable_code,
         157  +
            clippy::single_match,
         158  +
            clippy::match_single_binding,
         159  +
            clippy::diverging_sub_expression
         160  +
        )]
         161  +
        deserializer.read_struct(&GENERATEMACOUTPUT_SCHEMA, &mut |member, deser| {
  111    162   
            match member.member_index() {
  112    163   
                Some(0) => {
  113    164   
                    builder.mac = Some(deser.read_blob(member)?);
  114    165   
                }
  115    166   
                Some(1) => {
  116    167   
                    builder.mac_algorithm = Some(crate::types::MacAlgorithmSpec::from(deser.read_string(member)?.as_str()));
  117    168   
                }
  118    169   
                Some(2) => {
  119    170   
                    builder.key_id = Some(deser.read_string(member)?);
  120    171   
                }

tmp-codegen-diff/aws-sdk/sdk/kms/src/operation/generate_random.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 `GenerateRandom`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct GenerateRandom;
    6      6   
impl GenerateRandom {
    7      7   
    /// Creates a new `GenerateRandom`
    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::generate_random::GenerateRandomInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::generate_random::GenerateRandomOutput::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::generate_random::GenerateRandomInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::generate_random::GenerateRandomOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::generate_random::GenerateRandomError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -116,120 +243,382 @@
  136    140   
                crate::operation::generate_random::GenerateRandomError,
  137    141   
            >::new());
  138    142   
  139    143   
        ::std::borrow::Cow::Owned(rcb)
  140    144   
    }
  141    145   
}
  142    146   
  143    147   
#[derive(Debug)]
  144    148   
struct GenerateRandomResponseDeserializer;
  145    149   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GenerateRandomResponseDeserializer {
  146         -
    fn deserialize_nonstreaming(
         150  +
    fn deserialize_nonstreaming_with_config(
  147    151   
        &self,
  148    152   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         153  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  149    154   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  150    155   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  151         -
        let headers = response.headers();
  152         -
        let body = response.body().bytes().expect("body loaded");
  153    156   
        #[allow(unused_mut)]
  154    157   
        let mut force_error = false;
  155    158   
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
  156         -
        let parse_result = if !success && status != 200 || force_error {
  157         -
            crate::protocol_serde::shape_generate_random::de_generate_random_http_error(status, headers, body)
  158         -
        } else {
  159         -
            crate::protocol_serde::shape_generate_random::de_generate_random_http_response(status, headers, body)
         159  +
        if !success && status != 200 || force_error {
         160  +
            let headers = response.headers();
         161  +
            let body = response.body().bytes().expect("body loaded");
         162  +
            #[allow(unused_mut)]
         163  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         164  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         165  +
            })?;
         166  +
            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
         167  +
            let generic = generic_builder.build();
         168  +
            let error_code = match generic.code() {
         169  +
                ::std::option::Option::Some(code) => code,
         170  +
                ::std::option::Option::None => {
         171  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         172  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::generate_random::GenerateRandomError::unhandled(
         173  +
                            generic,
         174  +
                        )),
         175  +
                    ))
         176  +
                }
         177  +
            };
         178  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         179  +
            let protocol = _cfg
         180  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         181  +
                .expect("a SharedClientProtocol is required");
         182  +
            let err = match error_code {
         183  +
                "CustomKeyStoreInvalidStateException" => {
         184  +
                    crate::operation::generate_random::GenerateRandomError::CustomKeyStoreInvalidStateException({
         185  +
                        let mut tmp = match protocol
         186  +
                            .deserialize_response(response, crate::types::error::CustomKeyStoreInvalidStateException::SCHEMA, _cfg)
         187  +
                            .and_then(|mut deser| {
         188  +
                                crate::types::error::CustomKeyStoreInvalidStateException::deserialize_with_response(
         189  +
                                    &mut *deser,
         190  +
                                    response.headers(),
         191  +
                                    response.status().into(),
         192  +
                                    body,
         193  +
                                )
         194  +
                            }) {
         195  +
                            ::std::result::Result::Ok(val) => val,
         196  +
                            ::std::result::Result::Err(e) => {
         197  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         198  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         199  +
                                ))
         200  +
                            }
         201  +
                        };
         202  +
                        tmp.meta = generic;
         203  +
                        if tmp.message.is_none() {
         204  +
                            tmp.message = _error_message;
         205  +
                        }
         206  +
                        tmp
         207  +
                    })
         208  +
                }
         209  +
                "CustomKeyStoreNotFoundException" => crate::operation::generate_random::GenerateRandomError::CustomKeyStoreNotFoundException({
         210  +
                    let mut tmp = match protocol
         211  +
                        .deserialize_response(response, crate::types::error::CustomKeyStoreNotFoundException::SCHEMA, _cfg)
         212  +
                        .and_then(|mut deser| {
         213  +
                            crate::types::error::CustomKeyStoreNotFoundException::deserialize_with_response(
         214  +
                                &mut *deser,
         215  +
                                response.headers(),
         216  +
                                response.status().into(),
         217  +
                                body,
         218  +
                            )
         219  +
                        }) {
         220  +
                        ::std::result::Result::Ok(val) => val,
         221  +
                        ::std::result::Result::Err(e) => {
         222  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         223  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         224  +
                            ))
         225  +
                        }
         226  +
                    };
         227  +
                    tmp.meta = generic;
         228  +
                    if tmp.message.is_none() {
         229  +
                        tmp.message = _error_message;
         230  +
                    }
         231  +
                    tmp
         232  +
                }),
         233  +
                "DependencyTimeoutException" => crate::operation::generate_random::GenerateRandomError::DependencyTimeoutException({
         234  +
                    let mut tmp = match protocol
         235  +
                        .deserialize_response(response, crate::types::error::DependencyTimeoutException::SCHEMA, _cfg)
         236  +
                        .and_then(|mut deser| {
         237  +
                            crate::types::error::DependencyTimeoutException::deserialize_with_response(
         238  +
                                &mut *deser,
         239  +
                                response.headers(),
         240  +
                                response.status().into(),
         241  +
                                body,
         242  +
                            )
         243  +
                        }) {
         244  +
                        ::std::result::Result::Ok(val) => val,
         245  +
                        ::std::result::Result::Err(e) => {
         246  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         247  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         248  +
                            ))
         249  +
                        }
         250  +
                    };
         251  +
                    tmp.meta = generic;
         252  +
                    if tmp.message.is_none() {
         253  +
                        tmp.message = _error_message;
         254  +
                    }
         255  +
                    tmp
         256  +
                }),
         257  +
                "KMSInternalException" => crate::operation::generate_random::GenerateRandomError::KmsInternalException({
         258  +
                    let mut tmp = match protocol
         259  +
                        .deserialize_response(response, crate::types::error::KmsInternalException::SCHEMA, _cfg)
         260  +
                        .and_then(|mut deser| {
         261  +
                            crate::types::error::KmsInternalException::deserialize_with_response(
         262  +
                                &mut *deser,
         263  +
                                response.headers(),
         264  +
                                response.status().into(),
         265  +
                                body,
         266  +
                            )
         267  +
                        }) {
         268  +
                        ::std::result::Result::Ok(val) => val,
         269  +
                        ::std::result::Result::Err(e) => {
         270  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         271  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         272  +
                            ))
         273  +
                        }
         274  +
                    };
         275  +
                    tmp.meta = generic;
         276  +
                    if tmp.message.is_none() {
         277  +
                        tmp.message = _error_message;
         278  +
                    }
         279  +
                    tmp
         280  +
                }),
         281  +
                "UnsupportedOperationException" => crate::operation::generate_random::GenerateRandomError::UnsupportedOperationException({
         282  +
                    let mut tmp = match protocol
         283  +
                        .deserialize_response(response, crate::types::error::UnsupportedOperationException::SCHEMA, _cfg)
         284  +
                        .and_then(|mut deser| {
         285  +
                            crate::types::error::UnsupportedOperationException::deserialize_with_response(
         286  +
                                &mut *deser,
         287  +
                                response.headers(),
         288  +
                                response.status().into(),
         289  +
                                body,
         290  +
                            )
         291  +
                        }) {
         292  +
                        ::std::result::Result::Ok(val) => val,
         293  +
                        ::std::result::Result::Err(e) => {
         294  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         295  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         296  +
                            ))
         297  +
                        }
  160    298   
                    };
  161         -
        crate::protocol_serde::type_erase_result(parse_result)
         299  +
                    tmp.meta = generic;
         300  +
                    if tmp.message.is_none() {
         301  +
                        tmp.message = _error_message;
         302  +
                    }
         303  +
                    tmp
         304  +
                }),
         305  +
                _ => crate::operation::generate_random::GenerateRandomError::generic(generic),
         306  +
            };
         307  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         308  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         309  +
            ))
         310  +
        } else {
         311  +
            let protocol = _cfg
         312  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         313  +
                .expect("a SharedClientProtocol is required");
         314  +
            let mut deser = protocol
         315  +
                .deserialize_response(response, GenerateRandom::OUTPUT_SCHEMA, _cfg)
         316  +
                .map_err(|e| {
         317  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         318  +
                })?;
         319  +
            let body = response.body().bytes().expect("body loaded");
         320  +
            let output = crate::operation::generate_random::GenerateRandomOutput::deserialize_with_response(
         321  +
                &mut *deser,
         322  +
                response.headers(),
         323  +
                response.status().into(),
         324  +
                body,
         325  +
            )
         326  +
            .map_err(|e| {
         327  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         328  +
            })?;
         329  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         330  +
        }
  162    331   
    }
  163    332   
}
  164    333   
#[derive(Debug)]
  165    334   
struct GenerateRandomRequestSerializer;
  166    335   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GenerateRandomRequestSerializer {
  167    336   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  168    337   
    fn serialize_input(
  169    338   
        &self,
  170    339   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  171    340   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  172    341   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  173    342   
        let input = input
  174    343   
            .downcast::<crate::operation::generate_random::GenerateRandomInput>()
  175    344   
            .expect("correct type");
  176         -
        let _header_serialization_settings = _cfg
  177         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  178         -
            .cloned()
  179         -
            .unwrap_or_default();
  180         -
        let mut request_builder = {
  181         -
            #[allow(clippy::uninlined_format_args)]
  182         -
            fn uri_base(
  183         -
                _input: &crate::operation::generate_random::GenerateRandomInput,
  184         -
                output: &mut ::std::string::String,
  185         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  186         -
                use ::std::fmt::Write as _;
  187         -
                ::std::write!(output, "/").expect("formatting should succeed");
  188         -
                ::std::result::Result::Ok(())
  189         -
            }
  190         -
            #[allow(clippy::unnecessary_wraps)]
  191         -
            fn update_http_builder(
  192         -
                input: &crate::operation::generate_random::GenerateRandomInput,
  193         -
                builder: ::http_1x::request::Builder,
  194         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  195         -
                let mut uri = ::std::string::String::new();
  196         -
                uri_base(input, &mut uri)?;
  197         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  198         -
            }
  199         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  200         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
  201         -
            builder = _header_serialization_settings.set_default_header(
  202         -
                builder,
  203         -
                ::http_1x::header::HeaderName::from_static("x-amz-target"),
  204         -
                "TrentService.GenerateRandom",
  205         -
            );
  206         -
            builder
  207         -
        };
  208         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_generate_random::ser_generate_random_input(&input)?);
  209         -
        if let Some(content_length) = body.content_length() {
  210         -
            let content_length = content_length.to_string();
  211         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  212         -
        }
  213         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         345  +
        let protocol = _cfg
         346  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         347  +
            .expect("a SharedClientProtocol is required");
         348  +
        let mut request = protocol
         349  +
            .serialize_request(&input, GenerateRandom::INPUT_SCHEMA, "", _cfg)
         350  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         351  +
         352  +
        return ::std::result::Result::Ok(request);
  214    353   
    }
  215    354   
}
  216    355   
#[derive(Debug)]
  217    356   
struct GenerateRandomEndpointParamsInterceptor;
  218    357   
  219    358   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GenerateRandomEndpointParamsInterceptor {
  220    359   
    fn name(&self) -> &'static str {
  221    360   
        "GenerateRandomEndpointParamsInterceptor"
  222    361   
    }
  223    362   

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

@@ -17,17 +164,175 @@
   37     37   
    "com.amazonaws.kms.synthetic",
   38     38   
    "GenerateRandomInput",
   39     39   
);
   40     40   
static GENERATERANDOMINPUT_MEMBER_NUMBER_OF_BYTES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   41     41   
    ::aws_smithy_schema::ShapeId::from_static(
   42     42   
        "com.amazonaws.kms.synthetic#GenerateRandomInput$NumberOfBytes",
   43     43   
        "com.amazonaws.kms.synthetic",
   44     44   
        "GenerateRandomInput",
   45     45   
    ),
   46     46   
    ::aws_smithy_schema::ShapeType::Integer,
   47         -
    "number_of_bytes",
          47  +
    "NumberOfBytes",
   48     48   
    0,
   49     49   
);
   50     50   
static GENERATERANDOMINPUT_MEMBER_CUSTOM_KEY_STORE_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   51     51   
    ::aws_smithy_schema::ShapeId::from_static(
   52     52   
        "com.amazonaws.kms.synthetic#GenerateRandomInput$CustomKeyStoreId",
   53     53   
        "com.amazonaws.kms.synthetic",
   54     54   
        "GenerateRandomInput",
   55     55   
    ),
   56     56   
    ::aws_smithy_schema::ShapeType::String,
   57         -
    "custom_key_store_id",
          57  +
    "CustomKeyStoreId",
   58     58   
    1,
   59     59   
);
   60     60   
static GENERATERANDOMINPUT_MEMBER_RECIPIENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   61     61   
    ::aws_smithy_schema::ShapeId::from_static(
   62     62   
        "com.amazonaws.kms.synthetic#GenerateRandomInput$Recipient",
   63     63   
        "com.amazonaws.kms.synthetic",
   64     64   
        "GenerateRandomInput",
   65     65   
    ),
   66     66   
    ::aws_smithy_schema::ShapeType::Structure,
   67         -
    "recipient",
          67  +
    "Recipient",
   68     68   
    2,
   69     69   
);
   70     70   
static GENERATERANDOMINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   71     71   
    GENERATERANDOMINPUT_SCHEMA_ID,
   72     72   
    ::aws_smithy_schema::ShapeType::Structure,
   73     73   
    &[
   74     74   
        &GENERATERANDOMINPUT_MEMBER_NUMBER_OF_BYTES,
   75     75   
        &GENERATERANDOMINPUT_MEMBER_CUSTOM_KEY_STORE_ID,
   76     76   
        &GENERATERANDOMINPUT_MEMBER_RECIPIENT,
   77     77   
    ],
   78     78   
);
   79     79   
impl GenerateRandomInput {
   80     80   
    /// The schema for this shape.
   81     81   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GENERATERANDOMINPUT_SCHEMA;
   82     82   
}
   83     83   
impl ::aws_smithy_schema::serde::SerializableStruct for GenerateRandomInput {
   84     84   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   85     85   
    fn serialize_members(
   86     86   
        &self,
   87     87   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   88     88   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   89     89   
        if let Some(ref val) = self.number_of_bytes {
   90     90   
            ser.write_integer(&GENERATERANDOMINPUT_MEMBER_NUMBER_OF_BYTES, *val)?;
   91     91   
        }
   92     92   
        if let Some(ref val) = self.custom_key_store_id {
   93     93   
            ser.write_string(&GENERATERANDOMINPUT_MEMBER_CUSTOM_KEY_STORE_ID, val)?;
   94     94   
        }
   95     95   
        if let Some(ref val) = self.recipient {
   96     96   
            ser.write_struct(&GENERATERANDOMINPUT_MEMBER_RECIPIENT, val)?;
   97     97   
        }
   98     98   
        Ok(())
   99     99   
    }
  100    100   
}
  101    101   
impl GenerateRandomInput {
  102    102   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  103         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  104         -
        deserializer: &mut D,
         103  +
    pub fn deserialize(
         104  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  105    105   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  106    106   
        #[allow(unused_variables, unused_mut)]
  107    107   
        let mut builder = Self::builder();
  108    108   
        #[allow(
  109    109   
            unused_variables,
  110    110   
            unreachable_code,
  111    111   
            clippy::single_match,
  112    112   
            clippy::match_single_binding,
  113    113   
            clippy::diverging_sub_expression
  114    114   
        )]
  115         -
        deserializer.read_struct(&GENERATERANDOMINPUT_SCHEMA, (), |_, member, deser| {
         115  +
        deserializer.read_struct(&GENERATERANDOMINPUT_SCHEMA, &mut |member, deser| {
  116    116   
            match member.member_index() {
  117    117   
                Some(0) => {
  118    118   
                    builder.number_of_bytes = Some(deser.read_integer(member)?);
  119    119   
                }
  120    120   
                Some(1) => {
  121    121   
                    builder.custom_key_store_id = Some(deser.read_string(member)?);
  122    122   
                }
  123    123   
                Some(2) => {
  124    124   
                    builder.recipient = Some(crate::types::RecipientInfo::deserialize(deser)?);
  125    125   
                }
  126    126   
                _ => {}
  127    127   
            }
  128    128   
            Ok(())
  129    129   
        })?;
  130    130   
        builder
  131    131   
            .build()
  132    132   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  133    133   
    }
  134    134   
}
         135  +
impl GenerateRandomInput {
         136  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         137  +
    pub fn deserialize_with_response(
         138  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         139  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         140  +
        _status: u16,
         141  +
        _body: &[u8],
         142  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         143  +
        Self::deserialize(deserializer)
         144  +
    }
         145  +
}
  135    146   
impl GenerateRandomInput {
  136    147   
    /// Creates a new builder-style object to manufacture [`GenerateRandomInput`](crate::operation::generate_random::GenerateRandomInput).
  137    148   
    pub fn builder() -> crate::operation::generate_random::builders::GenerateRandomInputBuilder {
  138    149   
        crate::operation::generate_random::builders::GenerateRandomInputBuilder::default()
  139    150   
    }
  140    151   
}
  141    152   
  142    153   
/// A builder for [`GenerateRandomInput`](crate::operation::generate_random::GenerateRandomInput).
  143    154   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  144    155   
#[non_exhaustive]

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

@@ -17,17 +131,179 @@
   37     37   
    "com.amazonaws.kms.synthetic",
   38     38   
    "GenerateRandomOutput",
   39     39   
);
   40     40   
static GENERATERANDOMOUTPUT_MEMBER_PLAINTEXT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   41     41   
    ::aws_smithy_schema::ShapeId::from_static(
   42     42   
        "com.amazonaws.kms.synthetic#GenerateRandomOutput$Plaintext",
   43     43   
        "com.amazonaws.kms.synthetic",
   44     44   
        "GenerateRandomOutput",
   45     45   
    ),
   46     46   
    ::aws_smithy_schema::ShapeType::Blob,
   47         -
    "plaintext",
          47  +
    "Plaintext",
   48     48   
    0,
   49     49   
);
   50     50   
static GENERATERANDOMOUTPUT_MEMBER_CIPHERTEXT_FOR_RECIPIENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   51     51   
    ::aws_smithy_schema::ShapeId::from_static(
   52     52   
        "com.amazonaws.kms.synthetic#GenerateRandomOutput$CiphertextForRecipient",
   53     53   
        "com.amazonaws.kms.synthetic",
   54     54   
        "GenerateRandomOutput",
   55     55   
    ),
   56     56   
    ::aws_smithy_schema::ShapeType::Blob,
   57         -
    "ciphertext_for_recipient",
          57  +
    "CiphertextForRecipient",
   58     58   
    1,
   59     59   
);
          60  +
static GENERATERANDOMOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          61  +
    ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
          62  +
    ::aws_smithy_schema::ShapeType::String,
          63  +
    "request_id",
          64  +
    2,
          65  +
)
          66  +
.with_http_header("x-amzn-requestid");
   60     67   
static GENERATERANDOMOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   61     68   
    GENERATERANDOMOUTPUT_SCHEMA_ID,
   62     69   
    ::aws_smithy_schema::ShapeType::Structure,
   63     70   
    &[
   64     71   
        &GENERATERANDOMOUTPUT_MEMBER_PLAINTEXT,
   65     72   
        &GENERATERANDOMOUTPUT_MEMBER_CIPHERTEXT_FOR_RECIPIENT,
          73  +
        &GENERATERANDOMOUTPUT_MEMBER__REQUEST_ID,
   66     74   
    ],
   67     75   
);
   68     76   
impl GenerateRandomOutput {
   69     77   
    /// The schema for this shape.
   70     78   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GENERATERANDOMOUTPUT_SCHEMA;
   71     79   
}
   72     80   
impl ::aws_smithy_schema::serde::SerializableStruct for GenerateRandomOutput {
   73     81   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   74     82   
    fn serialize_members(
   75     83   
        &self,
   76     84   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   77     85   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   78     86   
        if let Some(ref val) = self.plaintext {
   79     87   
            ser.write_blob(&GENERATERANDOMOUTPUT_MEMBER_PLAINTEXT, val)?;
   80     88   
        }
   81     89   
        if let Some(ref val) = self.ciphertext_for_recipient {
   82     90   
            ser.write_blob(&GENERATERANDOMOUTPUT_MEMBER_CIPHERTEXT_FOR_RECIPIENT, val)?;
   83     91   
        }
   84     92   
        Ok(())
   85     93   
    }
   86     94   
}
   87     95   
impl GenerateRandomOutput {
   88     96   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   89         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   90         -
        deserializer: &mut D,
          97  +
    pub fn deserialize(
          98  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   91     99   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   92    100   
        #[allow(unused_variables, unused_mut)]
   93    101   
        let mut builder = Self::builder();
   94    102   
        #[allow(
   95    103   
            unused_variables,
   96    104   
            unreachable_code,
   97    105   
            clippy::single_match,
   98    106   
            clippy::match_single_binding,
   99    107   
            clippy::diverging_sub_expression
  100    108   
        )]
  101         -
        deserializer.read_struct(&GENERATERANDOMOUTPUT_SCHEMA, (), |_, member, deser| {
         109  +
        deserializer.read_struct(&GENERATERANDOMOUTPUT_SCHEMA, &mut |member, deser| {
         110  +
            match member.member_index() {
         111  +
                Some(0) => {
         112  +
                    builder.plaintext = Some(deser.read_blob(member)?);
         113  +
                }
         114  +
                Some(1) => {
         115  +
                    builder.ciphertext_for_recipient = Some(deser.read_blob(member)?);
         116  +
                }
         117  +
                Some(2) => {
         118  +
                    builder._request_id = Some(deser.read_string(member)?);
         119  +
                }
         120  +
                _ => {}
         121  +
            }
         122  +
            Ok(())
         123  +
        })?;
         124  +
        Ok(builder.build())
         125  +
    }
         126  +
}
         127  +
impl GenerateRandomOutput {
         128  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         129  +
    /// Header-bound members are read directly from headers, avoiding runtime
         130  +
    /// member iteration overhead. Body members are read via the deserializer.
         131  +
    pub fn deserialize_with_response(
         132  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         133  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         134  +
        _status: u16,
         135  +
        _body: &[u8],
         136  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         137  +
        #[allow(unused_variables, unused_mut)]
         138  +
        let mut builder = Self::builder();
         139  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         140  +
            builder._request_id = Some(val.to_string());
         141  +
        }
         142  +
        #[allow(
         143  +
            unused_variables,
         144  +
            unreachable_code,
         145  +
            clippy::single_match,
         146  +
            clippy::match_single_binding,
         147  +
            clippy::diverging_sub_expression
         148  +
        )]
         149  +
        deserializer.read_struct(&GENERATERANDOMOUTPUT_SCHEMA, &mut |member, deser| {
  102    150   
            match member.member_index() {
  103    151   
                Some(0) => {
  104    152   
                    builder.plaintext = Some(deser.read_blob(member)?);
  105    153   
                }
  106    154   
                Some(1) => {
  107    155   
                    builder.ciphertext_for_recipient = Some(deser.read_blob(member)?);
  108    156   
                }
  109    157   
                _ => {}
  110    158   
            }
  111    159   
            Ok(())

tmp-codegen-diff/aws-sdk/sdk/kms/src/operation/get_key_policy.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 `GetKeyPolicy`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct GetKeyPolicy;
    6      6   
impl GetKeyPolicy {
    7      7   
    /// Creates a new `GetKeyPolicy`
    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::get_key_policy::GetKeyPolicyInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::get_key_policy::GetKeyPolicyOutput::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::get_key_policy::GetKeyPolicyInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::get_key_policy::GetKeyPolicyOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::get_key_policy::GetKeyPolicyError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -115,119 +242,375 @@
  135    139   
                crate::operation::get_key_policy::GetKeyPolicyError,
  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 GetKeyPolicyResponseDeserializer;
  144    148   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetKeyPolicyResponseDeserializer {
  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_get_key_policy::de_get_key_policy_http_error(status, headers, body)
  157         -
        } else {
  158         -
            crate::protocol_serde::shape_get_key_policy::de_get_key_policy_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::get_key_policy::GetKeyPolicyError::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::get_key_policy::GetKeyPolicyError::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  +
                        }
  159    197   
                    };
  160         -
        crate::protocol_serde::type_erase_result(parse_result)
         198  +
                    tmp.meta = generic;
         199  +
                    if tmp.message.is_none() {
         200  +
                        tmp.message = _error_message;
         201  +
                    }
         202  +
                    tmp
         203  +
                }),
         204  +
                "InvalidArnException" => crate::operation::get_key_policy::GetKeyPolicyError::InvalidArnException({
         205  +
                    let mut tmp = match protocol
         206  +
                        .deserialize_response(response, crate::types::error::InvalidArnException::SCHEMA, _cfg)
         207  +
                        .and_then(|mut deser| {
         208  +
                            crate::types::error::InvalidArnException::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  +
                "KMSInternalException" => crate::operation::get_key_policy::GetKeyPolicyError::KmsInternalException({
         229  +
                    let mut tmp = match protocol
         230  +
                        .deserialize_response(response, crate::types::error::KmsInternalException::SCHEMA, _cfg)
         231  +
                        .and_then(|mut deser| {
         232  +
                            crate::types::error::KmsInternalException::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  +
                "KMSInvalidStateException" => crate::operation::get_key_policy::GetKeyPolicyError::KmsInvalidStateException({
         253  +
                    let mut tmp = match protocol
         254  +
                        .deserialize_response(response, crate::types::error::KmsInvalidStateException::SCHEMA, _cfg)
         255  +
                        .and_then(|mut deser| {
         256  +
                            crate::types::error::KmsInvalidStateException::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  +
                "NotFoundException" => crate::operation::get_key_policy::GetKeyPolicyError::NotFoundException({
         277  +
                    let mut tmp = match protocol
         278  +
                        .deserialize_response(response, crate::types::error::NotFoundException::SCHEMA, _cfg)
         279  +
                        .and_then(|mut deser| {
         280  +
                            crate::types::error::NotFoundException::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  +
                _ => crate::operation::get_key_policy::GetKeyPolicyError::generic(generic),
         301  +
            };
         302  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         303  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         304  +
            ))
         305  +
        } else {
         306  +
            let protocol = _cfg
         307  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         308  +
                .expect("a SharedClientProtocol is required");
         309  +
            let mut deser = protocol.deserialize_response(response, GetKeyPolicy::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         310  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         311  +
            })?;
         312  +
            let body = response.body().bytes().expect("body loaded");
         313  +
            let output = crate::operation::get_key_policy::GetKeyPolicyOutput::deserialize_with_response(
         314  +
                &mut *deser,
         315  +
                response.headers(),
         316  +
                response.status().into(),
         317  +
                body,
         318  +
            )
         319  +
            .map_err(|e| {
         320  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         321  +
            })?;
         322  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         323  +
        }
  161    324   
    }
  162    325   
}
  163    326   
#[derive(Debug)]
  164    327   
struct GetKeyPolicyRequestSerializer;
  165    328   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetKeyPolicyRequestSerializer {
  166    329   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  167    330   
    fn serialize_input(
  168    331   
        &self,
  169    332   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  170    333   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  171    334   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  172    335   
        let input = input
  173    336   
            .downcast::<crate::operation::get_key_policy::GetKeyPolicyInput>()
  174    337   
            .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::get_key_policy::GetKeyPolicyInput,
  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::get_key_policy::GetKeyPolicyInput,
  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.GetKeyPolicy",
  204         -
            );
  205         -
            builder
  206         -
        };
  207         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_get_key_policy::ser_get_key_policy_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())
         338  +
        let protocol = _cfg
         339  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         340  +
            .expect("a SharedClientProtocol is required");
         341  +
        let mut request = protocol
         342  +
            .serialize_request(&input, GetKeyPolicy::INPUT_SCHEMA, "", _cfg)
         343  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         344  +
         345  +
        return ::std::result::Result::Ok(request);
  213    346   
    }
  214    347   
}
  215    348   
#[derive(Debug)]
  216    349   
struct GetKeyPolicyEndpointParamsInterceptor;
  217    350   
  218    351   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetKeyPolicyEndpointParamsInterceptor {
  219    352   
    fn name(&self) -> &'static str {
  220    353   
        "GetKeyPolicyEndpointParamsInterceptor"
  221    354   
    }
  222    355