AWS SDK

AWS SDK

rev. 163d4d6410694aaf071424777ecbecd050925f36

Files changed:

tmp-codegen-diff/aws-sdk/sdk/lambda/Cargo.toml

@@ -21,21 +86,86 @@
   41     41   
path = "../aws-smithy-json"
   42     42   
version = "0.62.6"
   43     43   
   44     44   
[dependencies.aws-smithy-observability]
   45     45   
path = "../aws-smithy-observability"
   46     46   
version = "0.2.6"
   47     47   
   48     48   
[dependencies.aws-smithy-runtime]
   49     49   
path = "../aws-smithy-runtime"
   50     50   
features = ["client"]
   51         -
version = "1.10.3"
          51  +
version = "1.10.4"
   52     52   
   53     53   
[dependencies.aws-smithy-runtime-api]
   54     54   
path = "../aws-smithy-runtime-api"
   55     55   
features = ["client", "http-1x"]
   56         -
version = "1.11.6"
          56  +
version = "1.11.7"
   57     57   
   58     58   
[dependencies.aws-smithy-schema]
   59     59   
path = "../aws-smithy-schema"
   60     60   
version = "1.0.0"
   61     61   
   62     62   
[dependencies.aws-smithy-types]
   63     63   
path = "../aws-smithy-types"
   64     64   
features = ["http-body-1-x"]
   65     65   
version = "1.4.7"
   66     66   
@@ -95,95 +160,160 @@
  115    115   
features = ["test-util", "wire-mock"]
  116    116   
version = "1.1.12"
  117    117   
  118    118   
[dev-dependencies.aws-smithy-protocol-test]
  119    119   
path = "../aws-smithy-protocol-test"
  120    120   
version = "0.63.14"
  121    121   
  122    122   
[dev-dependencies.aws-smithy-runtime]
  123    123   
path = "../aws-smithy-runtime"
  124    124   
features = ["test-util"]
  125         -
version = "1.10.3"
         125  +
version = "1.10.4"
  126    126   
  127    127   
[dev-dependencies.aws-smithy-runtime-api]
  128    128   
path = "../aws-smithy-runtime-api"
  129    129   
features = ["test-util"]
  130         -
version = "1.11.6"
         130  +
version = "1.11.7"
  131    131   
  132    132   
[dev-dependencies.aws-smithy-types]
  133    133   
path = "../aws-smithy-types"
  134    134   
features = ["http-body-1-x", "test-util"]
  135    135   
version = "1.4.7"
  136    136   
  137    137   
[dev-dependencies.futures-util]
  138    138   
version = "0.3.25"
  139    139   
features = ["alloc"]
  140    140   
default-features = false

tmp-codegen-diff/aws-sdk/sdk/lambda/src/config.rs

@@ -23,23 +82,86 @@
   43     43   
            config: self.cloneable.clone(),
   44     44   
            runtime_components: self.runtime_components.clone(),
   45     45   
            runtime_plugins: self.runtime_plugins.clone(),
   46     46   
            behavior_version: self.behavior_version,
   47     47   
        }
   48     48   
    }
   49     49   
    /// Return a reference to the stalled stream protection configuration contained in this config, if any.
   50     50   
    pub fn stalled_stream_protection(&self) -> ::std::option::Option<&crate::config::StalledStreamProtectionConfig> {
   51     51   
        self.config.load::<crate::config::StalledStreamProtectionConfig>()
   52     52   
    }
          53  +
    /// Returns the client protocol used for serialization and deserialization.
          54  +
    pub fn protocol(&self) -> ::std::option::Option<&::aws_smithy_schema::protocol::SharedClientProtocol> {
          55  +
        self.config.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
          56  +
    }
   53     57   
    /// Return the [`SharedHttpClient`](crate::config::SharedHttpClient) to use when making requests, if any.
   54     58   
    pub fn http_client(&self) -> Option<crate::config::SharedHttpClient> {
   55     59   
        self.runtime_components.http_client()
   56     60   
    }
   57     61   
    /// Return the auth schemes configured on this service config
   58     62   
    pub fn auth_schemes(&self) -> impl Iterator<Item = ::aws_smithy_runtime_api::client::auth::SharedAuthScheme> + '_ {
   59     63   
        self.runtime_components.auth_schemes()
   60     64   
    }
   61     65   
   62     66   
    /// Return the auth scheme resolver configured on this service config
@@ -153,157 +238,261 @@
  173    177   
    ///
  174    178   
    pub fn new() -> Self {
  175    179   
        Self::default()
  176    180   
    }
  177    181   
    /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag,
  178    182   
    /// but not those in runtime components.
  179    183   
    #[allow(unused)]
  180    184   
    pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self {
  181    185   
        let mut builder = Self::new();
  182    186   
        builder.set_stalled_stream_protection(config_bag.load::<crate::config::StalledStreamProtectionConfig>().cloned());
         187  +
        if let ::std::option::Option::Some(protocol) = config_bag.load::<::aws_smithy_schema::protocol::SharedClientProtocol>().cloned() {
         188  +
            builder.set_protocol(::std::option::Option::Some(protocol));
         189  +
        }
  183    190   
        builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned());
  184    191   
        builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned());
  185    192   
        builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned());
  186    193   
        builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned());
  187    194   
        builder.set_app_name(config_bag.load::<::aws_types::app_name::AppName>().cloned());
  188    195   
        builder.set_endpoint_url(config_bag.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()));
  189    196   
        builder.set_use_dual_stack(config_bag.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0));
  190    197   
        builder.set_use_fips(config_bag.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0));
  191    198   
        builder.set_region(config_bag.load::<crate::config::Region>().cloned());
  192    199   
        builder
  193    200   
    }
  194    201   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  195    202   
    /// to configure protection for stalled streams.
  196    203   
    pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self {
  197    204   
        self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config));
  198    205   
        self
  199    206   
    }
  200    207   
    /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig)
  201    208   
    /// to configure protection for stalled streams.
  202    209   
    pub fn set_stalled_stream_protection(
  203    210   
        &mut self,
  204    211   
        stalled_stream_protection_config: ::std::option::Option<crate::config::StalledStreamProtectionConfig>,
  205    212   
    ) -> &mut Self {
  206    213   
        self.config.store_or_unset(stalled_stream_protection_config);
  207    214   
        self
  208    215   
    }
         216  +
    /// Sets the client protocol to use for serialization and deserialization.
         217  +
    ///
         218  +
    /// This overrides the default protocol determined by the service model,
         219  +
    /// enabling runtime protocol selection.
         220  +
    pub fn protocol(mut self, protocol: impl ::aws_smithy_schema::protocol::ClientProtocol + 'static) -> Self {
         221  +
        self.set_protocol(::std::option::Option::Some(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         222  +
            protocol,
         223  +
        )));
         224  +
        self
         225  +
    }
         226  +
         227  +
    /// Sets the client protocol to use for serialization and deserialization.
         228  +
    pub fn set_protocol(&mut self, protocol: ::std::option::Option<::aws_smithy_schema::protocol::SharedClientProtocol>) -> &mut Self {
         229  +
        self.config.store_or_unset(protocol);
         230  +
        self
         231  +
    }
  209    232   
    /// Sets the HTTP client to use when making requests.
  210    233   
    ///
  211    234   
    /// # Examples
  212    235   
    /// ```no_run
  213    236   
    /// # #[cfg(test)]
  214    237   
    /// # mod tests {
  215    238   
    /// # #[test]
  216    239   
    /// # fn example() {
  217    240   
    /// use std::time::Duration;
  218    241   
    /// use aws_sdk_lambda::config::Config;
@@ -1272,1295 +1331,1359 @@
 1292   1315   
#[derive(::std::fmt::Debug)]
 1293   1316   
pub(crate) struct ServiceRuntimePlugin {
 1294   1317   
    config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
 1295   1318   
    runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
 1296   1319   
}
 1297   1320   
 1298   1321   
impl ServiceRuntimePlugin {
 1299   1322   
    pub fn new(_service_config: crate::config::Config) -> Self {
 1300   1323   
        let config = {
 1301   1324   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AWSGirApiService");
        1325  +
            if _service_config.protocol().is_none() {
        1326  +
                cfg.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1327  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1328  +
                ));
        1329  +
            }
 1302   1330   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1303   1331   
            ::std::option::Option::Some(cfg.freeze())
 1304   1332   
        };
 1305   1333   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1306   1334   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1307   1335   
            use crate::config::auth::ResolveAuthScheme;
 1308   1336   
            crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
 1309   1337   
        }));
 1310   1338   
        runtime_components.set_endpoint_resolver(::std::option::Option::Some({
 1311   1339   
            use crate::config::endpoint::ResolveEndpoint;
@@ -1407,1435 +1466,1497 @@
 1427   1455   
        }
 1428   1456   
        // resiliency
 1429   1457   
        builder.set_retry_config(input.retry_config().cloned());
 1430   1458   
        builder.set_timeout_config(input.timeout_config().cloned());
 1431   1459   
        builder.set_sleep_impl(input.sleep_impl());
 1432   1460   
 1433   1461   
        builder.set_http_client(input.http_client());
 1434   1462   
        builder.set_time_source(input.time_source());
 1435   1463   
        builder.set_behavior_version(input.behavior_version());
 1436   1464   
        builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
        1465  +
        if let Some(protocol) = input.protocol() {
        1466  +
            builder.set_protocol(Some(protocol.clone()));
        1467  +
        }
 1437   1468   
        // setting `None` here removes the default
 1438   1469   
        if let Some(config) = input.stalled_stream_protection() {
 1439   1470   
            builder.set_stalled_stream_protection(Some(config));
 1440   1471   
        }
 1441   1472   
 1442   1473   
        if let Some(cache) = input.identity_cache() {
 1443   1474   
            builder.set_identity_cache(cache);
 1444   1475   
        }
 1445   1476   
        builder.set_app_name(input.app_name().cloned());
 1446   1477   

tmp-codegen-diff/aws-sdk/sdk/lambda/src/lib.rs

@@ -209,209 +257,253 @@
  229    229   
pub mod types;
  230    230   
  231    231   
mod event_receiver;
  232    232   
  233    233   
mod observability_feature;
  234    234   
  235    235   
pub(crate) mod protocol_serde;
  236    236   
  237    237   
mod sdk_feature_tracker;
  238    238   
  239         -
mod serialization_settings;
  240         -
  241    239   
mod endpoint_lib;
  242    240   
  243         -
mod lens;
         241  +
mod json_errors;
  244    242   
  245         -
mod serde_util;
         243  +
mod lens;
  246    244   
  247    245   
/// Supporting types for waiters.
  248    246   
///
  249    247   
/// Note: to use waiters, import the [`Waiters`](crate::client::Waiters) trait, which adds methods prefixed with `wait_until` to the client.
  250    248   
pub mod waiters;
  251    249   
  252    250   
mod event_stream_serde;
  253    251   
  254         -
mod json_errors;
  255         -
  256    252   
#[doc(inline)]
  257    253   
pub use client::Client;

tmp-codegen-diff/aws-sdk/sdk/lambda/src/operation/add_layer_version_permission.rs

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

tmp-codegen-diff/aws-sdk/sdk/lambda/src/operation/add_layer_version_permission/_add_layer_version_permission_input.rs

@@ -33,33 +251,272 @@
   53     53   
    "com.amazonaws.lambda.synthetic",
   54     54   
    "AddLayerVersionPermissionInput",
   55     55   
);
   56     56   
static ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_LAYER_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   57     57   
    ::aws_smithy_schema::ShapeId::from_static(
   58     58   
        "com.amazonaws.lambda.synthetic#AddLayerVersionPermissionInput$LayerName",
   59     59   
        "com.amazonaws.lambda.synthetic",
   60     60   
        "AddLayerVersionPermissionInput",
   61     61   
    ),
   62     62   
    ::aws_smithy_schema::ShapeType::String,
   63         -
    "layer_name",
          63  +
    "LayerName",
   64     64   
    0,
   65     65   
)
   66     66   
.with_http_label();
   67     67   
static ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_VERSION_NUMBER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   68     68   
    ::aws_smithy_schema::ShapeId::from_static(
   69     69   
        "com.amazonaws.lambda.synthetic#AddLayerVersionPermissionInput$VersionNumber",
   70     70   
        "com.amazonaws.lambda.synthetic",
   71     71   
        "AddLayerVersionPermissionInput",
   72     72   
    ),
   73     73   
    ::aws_smithy_schema::ShapeType::Long,
   74         -
    "version_number",
          74  +
    "VersionNumber",
   75     75   
    1,
   76     76   
)
   77     77   
.with_http_label();
   78     78   
static ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_STATEMENT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   79     79   
    ::aws_smithy_schema::ShapeId::from_static(
   80     80   
        "com.amazonaws.lambda.synthetic#AddLayerVersionPermissionInput$StatementId",
   81     81   
        "com.amazonaws.lambda.synthetic",
   82     82   
        "AddLayerVersionPermissionInput",
   83     83   
    ),
   84     84   
    ::aws_smithy_schema::ShapeType::String,
   85         -
    "statement_id",
          85  +
    "StatementId",
   86     86   
    2,
   87     87   
);
   88     88   
static ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_ACTION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   89     89   
    ::aws_smithy_schema::ShapeId::from_static(
   90     90   
        "com.amazonaws.lambda.synthetic#AddLayerVersionPermissionInput$Action",
   91     91   
        "com.amazonaws.lambda.synthetic",
   92     92   
        "AddLayerVersionPermissionInput",
   93     93   
    ),
   94     94   
    ::aws_smithy_schema::ShapeType::String,
   95         -
    "action",
          95  +
    "Action",
   96     96   
    3,
   97     97   
);
   98     98   
static ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_PRINCIPAL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   99     99   
    ::aws_smithy_schema::ShapeId::from_static(
  100    100   
        "com.amazonaws.lambda.synthetic#AddLayerVersionPermissionInput$Principal",
  101    101   
        "com.amazonaws.lambda.synthetic",
  102    102   
        "AddLayerVersionPermissionInput",
  103    103   
    ),
  104    104   
    ::aws_smithy_schema::ShapeType::String,
  105         -
    "principal",
         105  +
    "Principal",
  106    106   
    4,
  107    107   
);
  108    108   
static ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_ORGANIZATION_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  109    109   
    ::aws_smithy_schema::ShapeId::from_static(
  110    110   
        "com.amazonaws.lambda.synthetic#AddLayerVersionPermissionInput$OrganizationId",
  111    111   
        "com.amazonaws.lambda.synthetic",
  112    112   
        "AddLayerVersionPermissionInput",
  113    113   
    ),
  114    114   
    ::aws_smithy_schema::ShapeType::String,
  115         -
    "organization_id",
         115  +
    "OrganizationId",
  116    116   
    5,
  117    117   
);
  118    118   
static ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_REVISION_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  119    119   
    ::aws_smithy_schema::ShapeId::from_static(
  120    120   
        "com.amazonaws.lambda.synthetic#AddLayerVersionPermissionInput$RevisionId",
  121    121   
        "com.amazonaws.lambda.synthetic",
  122    122   
        "AddLayerVersionPermissionInput",
  123    123   
    ),
  124    124   
    ::aws_smithy_schema::ShapeType::String,
  125         -
    "revision_id",
         125  +
    "RevisionId",
  126    126   
    6,
  127    127   
)
  128    128   
.with_http_query("RevisionId");
  129    129   
static ADDLAYERVERSIONPERMISSIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  130    130   
    ADDLAYERVERSIONPERMISSIONINPUT_SCHEMA_ID,
  131    131   
    ::aws_smithy_schema::ShapeType::Structure,
  132    132   
    &[
  133    133   
        &ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_LAYER_NAME,
  134    134   
        &ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_VERSION_NUMBER,
  135    135   
        &ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_STATEMENT_ID,
  136    136   
        &ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_ACTION,
  137    137   
        &ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_PRINCIPAL,
  138    138   
        &ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_ORGANIZATION_ID,
  139    139   
        &ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_REVISION_ID,
  140    140   
    ],
  141         -
);
         141  +
)
         142  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
         143  +
    "POST",
         144  +
    "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy",
         145  +
    Some(201),
         146  +
));
  142    147   
impl AddLayerVersionPermissionInput {
  143    148   
    /// The schema for this shape.
  144    149   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ADDLAYERVERSIONPERMISSIONINPUT_SCHEMA;
  145    150   
}
  146    151   
impl ::aws_smithy_schema::serde::SerializableStruct for AddLayerVersionPermissionInput {
  147    152   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  148    153   
    fn serialize_members(
  149    154   
        &self,
  150    155   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  151    156   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  152    157   
        if let Some(ref val) = self.layer_name {
  153    158   
            ser.write_string(&ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_LAYER_NAME, val)?;
  154    159   
        }
  155    160   
        if let Some(ref val) = self.version_number {
  156    161   
            ser.write_long(&ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_VERSION_NUMBER, *val)?;
  157    162   
        }
  158    163   
        if let Some(ref val) = self.statement_id {
  159    164   
            ser.write_string(&ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_STATEMENT_ID, val)?;
  160    165   
        }
  161    166   
        if let Some(ref val) = self.action {
  162    167   
            ser.write_string(&ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_ACTION, val)?;
  163    168   
        }
  164    169   
        if let Some(ref val) = self.principal {
  165    170   
            ser.write_string(&ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_PRINCIPAL, val)?;
  166    171   
        }
  167    172   
        if let Some(ref val) = self.organization_id {
  168    173   
            ser.write_string(&ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_ORGANIZATION_ID, val)?;
  169    174   
        }
  170    175   
        if let Some(ref val) = self.revision_id {
  171    176   
            ser.write_string(&ADDLAYERVERSIONPERMISSIONINPUT_MEMBER_REVISION_ID, val)?;
  172    177   
        }
  173    178   
        Ok(())
  174    179   
    }
  175    180   
}
  176    181   
impl AddLayerVersionPermissionInput {
  177    182   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  178         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  179         -
        deserializer: &mut D,
         183  +
    pub fn deserialize(
         184  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  180    185   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  181    186   
        #[allow(unused_variables, unused_mut)]
  182    187   
        let mut builder = Self::builder();
  183    188   
        #[allow(
  184    189   
            unused_variables,
  185    190   
            unreachable_code,
  186    191   
            clippy::single_match,
  187    192   
            clippy::match_single_binding,
  188    193   
            clippy::diverging_sub_expression
  189    194   
        )]
  190         -
        deserializer.read_struct(&ADDLAYERVERSIONPERMISSIONINPUT_SCHEMA, (), |_, member, deser| {
         195  +
        deserializer.read_struct(&ADDLAYERVERSIONPERMISSIONINPUT_SCHEMA, &mut |member, deser| {
  191    196   
            match member.member_index() {
  192    197   
                Some(0) => {
  193    198   
                    builder.layer_name = Some(deser.read_string(member)?);
  194    199   
                }
  195    200   
                Some(1) => {
  196    201   
                    builder.version_number = Some(deser.read_long(member)?);
  197    202   
                }
  198    203   
                Some(2) => {
  199    204   
                    builder.statement_id = Some(deser.read_string(member)?);
  200    205   
                }
  201    206   
                Some(3) => {
  202    207   
                    builder.action = Some(deser.read_string(member)?);
  203    208   
                }
  204    209   
                Some(4) => {
  205    210   
                    builder.principal = Some(deser.read_string(member)?);
  206    211   
                }
  207    212   
                Some(5) => {
  208    213   
                    builder.organization_id = Some(deser.read_string(member)?);
  209    214   
                }
  210    215   
                Some(6) => {
  211    216   
                    builder.revision_id = Some(deser.read_string(member)?);
  212    217   
                }
  213    218   
                _ => {}
  214    219   
            }
  215    220   
            Ok(())
  216    221   
        })?;
         222  +
        builder.layer_name = builder.layer_name.or(Some(String::new()));
         223  +
        builder.version_number = builder.version_number.or(Some(0i64));
         224  +
        builder.statement_id = builder.statement_id.or(Some(String::new()));
         225  +
        builder.action = builder.action.or(Some(String::new()));
         226  +
        builder.principal = builder.principal.or(Some(String::new()));
  217    227   
        builder
  218    228   
            .build()
  219    229   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  220    230   
    }
  221    231   
}
         232  +
impl AddLayerVersionPermissionInput {
         233  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         234  +
    pub fn deserialize_with_response(
         235  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         236  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         237  +
        _status: u16,
         238  +
        _body: &[u8],
         239  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         240  +
        Self::deserialize(deserializer)
         241  +
    }
         242  +
}
  222    243   
impl AddLayerVersionPermissionInput {
  223    244   
    /// Creates a new builder-style object to manufacture [`AddLayerVersionPermissionInput`](crate::operation::add_layer_version_permission::AddLayerVersionPermissionInput).
  224    245   
    pub fn builder() -> crate::operation::add_layer_version_permission::builders::AddLayerVersionPermissionInputBuilder {
  225    246   
        crate::operation::add_layer_version_permission::builders::AddLayerVersionPermissionInputBuilder::default()
  226    247   
    }
  227    248   
}
  228    249   
  229    250   
/// A builder for [`AddLayerVersionPermissionInput`](crate::operation::add_layer_version_permission::AddLayerVersionPermissionInput).
  230    251   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  231    252   
#[non_exhaustive]

tmp-codegen-diff/aws-sdk/sdk/lambda/src/operation/add_layer_version_permission/_add_layer_version_permission_output.rs

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

tmp-codegen-diff/aws-sdk/sdk/lambda/src/operation/add_permission.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 `AddPermission`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct AddPermission;
    6      6   
impl AddPermission {
    7      7   
    /// Creates a new `AddPermission`
    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::add_permission::AddPermissionInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::add_permission::AddPermissionOutput::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::add_permission::AddPermissionInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::add_permission::AddPermissionOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::add_permission::AddPermissionError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -118,122 +262,456 @@
  138    142   
        ::std::borrow::Cow::Owned(rcb)
  139    143   
    }
  140    144   
}
  141    145   
  142    146   
#[derive(Debug)]
  143    147   
struct AddPermissionResponseDeserializer;
  144    148   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for AddPermissionResponseDeserializer {
  145    149   
    fn deserialize_nonstreaming(
  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 != 201 || force_error {
  156         -
            crate::protocol_serde::shape_add_permission::de_add_permission_http_error(status, headers, body)
         158  +
        if !success && status != 201 || 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::add_permission::AddPermissionError::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  +
                "InvalidParameterValueException" => crate::operation::add_permission::AddPermissionError::InvalidParameterValueException({
         181  +
                    let mut tmp = match protocol
         182  +
                        .deserialize_response(response, crate::types::error::InvalidParameterValueException::SCHEMA, _cfg)
         183  +
                        .and_then(|mut deser| {
         184  +
                            crate::types::error::InvalidParameterValueException::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  +
                "PolicyLengthExceededException" => crate::operation::add_permission::AddPermissionError::PolicyLengthExceededException({
         205  +
                    let mut tmp = match protocol
         206  +
                        .deserialize_response(response, crate::types::error::PolicyLengthExceededException::SCHEMA, _cfg)
         207  +
                        .and_then(|mut deser| {
         208  +
                            crate::types::error::PolicyLengthExceededException::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  +
                "PreconditionFailedException" => crate::operation::add_permission::AddPermissionError::PreconditionFailedException({
         229  +
                    let mut tmp = match protocol
         230  +
                        .deserialize_response(response, crate::types::error::PreconditionFailedException::SCHEMA, _cfg)
         231  +
                        .and_then(|mut deser| {
         232  +
                            crate::types::error::PreconditionFailedException::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  +
                "ResourceConflictException" => crate::operation::add_permission::AddPermissionError::ResourceConflictException({
         253  +
                    let mut tmp = match protocol
         254  +
                        .deserialize_response(response, crate::types::error::ResourceConflictException::SCHEMA, _cfg)
         255  +
                        .and_then(|mut deser| {
         256  +
                            crate::types::error::ResourceConflictException::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  +
                "ResourceNotFoundException" => crate::operation::add_permission::AddPermissionError::ResourceNotFoundException({
         277  +
                    let mut tmp = match protocol
         278  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundException::SCHEMA, _cfg)
         279  +
                        .and_then(|mut deser| {
         280  +
                            crate::types::error::ResourceNotFoundException::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  +
                "ServiceException" => crate::operation::add_permission::AddPermissionError::ServiceException({
         301  +
                    let mut tmp = match protocol
         302  +
                        .deserialize_response(response, crate::types::error::ServiceException::SCHEMA, _cfg)
         303  +
                        .and_then(|mut deser| {
         304  +
                            crate::types::error::ServiceException::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  +
                "TooManyRequestsException" => crate::operation::add_permission::AddPermissionError::TooManyRequestsException({
         325  +
                    let mut tmp = match protocol
         326  +
                        .deserialize_response(response, crate::types::error::TooManyRequestsException::SCHEMA, _cfg)
         327  +
                        .and_then(|mut deser| {
         328  +
                            crate::types::error::TooManyRequestsException::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  +
                _ => crate::operation::add_permission::AddPermissionError::generic(generic),
         349  +
            };
         350  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         351  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         352  +
            ))
  157    353   
        } else {
  158         -
            crate::protocol_serde::shape_add_permission::de_add_permission_http_response(status, headers, body)
  159         -
        };
  160         -
        crate::protocol_serde::type_erase_result(parse_result)
         354  +
            let protocol = _cfg
         355  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         356  +
                .expect("a SharedClientProtocol is required");
         357  +
            let mut deser = protocol.deserialize_response(response, AddPermission::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         358  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         359  +
            })?;
         360  +
            let body = response.body().bytes().expect("body loaded");
         361  +
            let output = crate::operation::add_permission::AddPermissionOutput::deserialize_with_response(
         362  +
                &mut *deser,
         363  +
                response.headers(),
         364  +
                response.status().into(),
         365  +
                body,
         366  +
            )
         367  +
            .map_err(|e| {
         368  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         369  +
            })?;
         370  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         371  +
        }
  161    372   
    }
  162    373   
}
  163    374   
#[derive(Debug)]
  164    375   
struct AddPermissionRequestSerializer;
  165    376   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for AddPermissionRequestSerializer {
  166    377   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  167    378   
    fn serialize_input(
  168    379   
        &self,
  169    380   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  170    381   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  171    382   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  172    383   
        let input = input
  173    384   
            .downcast::<crate::operation::add_permission::AddPermissionInput>()
  174    385   
            .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::add_permission::AddPermissionInput,
  183         -
                output: &mut ::std::string::String,
  184         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  185         -
                use ::std::fmt::Write as _;
  186         -
                let input_1 = &_input.function_name;
  187         -
                let input_1 = input_1
  188         -
                    .as_ref()
  189         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?;
  190         -
                let function_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  191         -
                if function_name.is_empty() {
  192         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  193         -
                        "function_name",
  194         -
                        "cannot be empty or unset",
  195         -
                    ));
         386  +
        let protocol = _cfg
         387  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         388  +
            .expect("a SharedClientProtocol is required");
         389  +
        if protocol.supports_http_bindings() {
         390  +
            let mut request = protocol
         391  +
                .serialize_body(&input, AddPermission::INPUT_SCHEMA, "", _cfg)
         392  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         393  +
            {
         394  +
                let mut uri = "/2015-03-31/functions/{FunctionName}/policy".to_string();
         395  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         396  +
                if let Some(ref val) = input.function_name {
         397  +
                    uri = uri.replace("{FunctionName}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
  196    398   
                }
  197         -
                ::std::write!(output, "/2015-03-31/functions/{FunctionName}/policy", FunctionName = function_name)
  198         -
                    .expect("formatting should succeed");
  199         -
                ::std::result::Result::Ok(())
  200         -
            }
  201         -
            fn uri_query(
  202         -
                _input: &crate::operation::add_permission::AddPermissionInput,
  203         -
                mut output: &mut ::std::string::String,
  204         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  205         -
                let mut query = ::aws_smithy_http::query::Writer::new(output);
  206         -
                if let ::std::option::Option::Some(inner_2) = &_input.qualifier {
  207         -
                    {
  208         -
                        query.push_kv("Qualifier", &::aws_smithy_http::query::fmt_string(inner_2));
  209         -
                    }
         399  +
                if let Some(ref val) = input.qualifier {
         400  +
                    query_params.push(("Qualifier".to_string(), val.to_string()));
  210    401   
                }
  211         -
                ::std::result::Result::Ok(())
  212         -
            }
  213         -
            #[allow(clippy::unnecessary_wraps)]
  214         -
            fn update_http_builder(
  215         -
                input: &crate::operation::add_permission::AddPermissionInput,
  216         -
                builder: ::http_1x::request::Builder,
  217         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  218         -
                let mut uri = ::std::string::String::new();
  219         -
                uri_base(input, &mut uri)?;
  220         -
                uri_query(input, &mut uri)?;
  221         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
         402  +
                if !query_params.is_empty() {
         403  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         404  +
                    let pairs: Vec<String> = query_params
         405  +
                        .iter()
         406  +
                        .map(|(k, v)| {
         407  +
                            format!(
         408  +
                                "{}={}",
         409  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         410  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         411  +
                            )
         412  +
                        })
         413  +
                        .collect();
         414  +
                    uri.push_str(&pairs.join("&"));
         415  +
                }
         416  +
                request.set_uri(uri.as_str()).expect("valid URI");
  222    417   
            }
  223         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  224         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  225         -
            builder
  226         -
        };
  227         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_add_permission::ser_add_permission_input(&input)?);
  228         -
        if let Some(content_length) = body.content_length() {
  229         -
            let content_length = content_length.to_string();
  230         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
         418  +
         419  +
            return ::std::result::Result::Ok(request);
         420  +
        } else {
         421  +
            let mut request = protocol
         422  +
                .serialize_request(&input, AddPermission::INPUT_SCHEMA, "", _cfg)
         423  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         424  +
         425  +
            return ::std::result::Result::Ok(request);
  231    426   
        }
  232         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  233    427   
    }
  234    428   
}
  235    429   
#[derive(Debug)]
  236    430   
struct AddPermissionEndpointParamsInterceptor;
  237    431   
  238    432   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for AddPermissionEndpointParamsInterceptor {
  239    433   
    fn name(&self) -> &'static str {
  240    434   
        "AddPermissionEndpointParamsInterceptor"
  241    435   
    }
  242    436   

tmp-codegen-diff/aws-sdk/sdk/lambda/src/operation/add_permission/_add_permission_input.rs

@@ -79,79 +364,384 @@
   99     99   
    "com.amazonaws.lambda.synthetic",
  100    100   
    "AddPermissionInput",
  101    101   
);
  102    102   
static ADDPERMISSIONINPUT_MEMBER_FUNCTION_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  103    103   
    ::aws_smithy_schema::ShapeId::from_static(
  104    104   
        "com.amazonaws.lambda.synthetic#AddPermissionInput$FunctionName",
  105    105   
        "com.amazonaws.lambda.synthetic",
  106    106   
        "AddPermissionInput",
  107    107   
    ),
  108    108   
    ::aws_smithy_schema::ShapeType::String,
  109         -
    "function_name",
         109  +
    "FunctionName",
  110    110   
    0,
  111    111   
)
  112    112   
.with_http_label();
  113    113   
static ADDPERMISSIONINPUT_MEMBER_STATEMENT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  114    114   
    ::aws_smithy_schema::ShapeId::from_static(
  115    115   
        "com.amazonaws.lambda.synthetic#AddPermissionInput$StatementId",
  116    116   
        "com.amazonaws.lambda.synthetic",
  117    117   
        "AddPermissionInput",
  118    118   
    ),
  119    119   
    ::aws_smithy_schema::ShapeType::String,
  120         -
    "statement_id",
         120  +
    "StatementId",
  121    121   
    1,
  122    122   
);
  123    123   
static ADDPERMISSIONINPUT_MEMBER_ACTION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  124    124   
    ::aws_smithy_schema::ShapeId::from_static(
  125    125   
        "com.amazonaws.lambda.synthetic#AddPermissionInput$Action",
  126    126   
        "com.amazonaws.lambda.synthetic",
  127    127   
        "AddPermissionInput",
  128    128   
    ),
  129    129   
    ::aws_smithy_schema::ShapeType::String,
  130         -
    "action",
         130  +
    "Action",
  131    131   
    2,
  132    132   
);
  133    133   
static ADDPERMISSIONINPUT_MEMBER_PRINCIPAL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  134    134   
    ::aws_smithy_schema::ShapeId::from_static(
  135    135   
        "com.amazonaws.lambda.synthetic#AddPermissionInput$Principal",
  136    136   
        "com.amazonaws.lambda.synthetic",
  137    137   
        "AddPermissionInput",
  138    138   
    ),
  139    139   
    ::aws_smithy_schema::ShapeType::String,
  140         -
    "principal",
         140  +
    "Principal",
  141    141   
    3,
  142    142   
);
  143    143   
static ADDPERMISSIONINPUT_MEMBER_SOURCE_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  144    144   
    ::aws_smithy_schema::ShapeId::from_static(
  145    145   
        "com.amazonaws.lambda.synthetic#AddPermissionInput$SourceArn",
  146    146   
        "com.amazonaws.lambda.synthetic",
  147    147   
        "AddPermissionInput",
  148    148   
    ),
  149    149   
    ::aws_smithy_schema::ShapeType::String,
  150         -
    "source_arn",
         150  +
    "SourceArn",
  151    151   
    4,
  152    152   
);
  153    153   
static ADDPERMISSIONINPUT_MEMBER_SOURCE_ACCOUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  154    154   
    ::aws_smithy_schema::ShapeId::from_static(
  155    155   
        "com.amazonaws.lambda.synthetic#AddPermissionInput$SourceAccount",
  156    156   
        "com.amazonaws.lambda.synthetic",
  157    157   
        "AddPermissionInput",
  158    158   
    ),
  159    159   
    ::aws_smithy_schema::ShapeType::String,
  160         -
    "source_account",
         160  +
    "SourceAccount",
  161    161   
    5,
  162    162   
);
  163    163   
static ADDPERMISSIONINPUT_MEMBER_EVENT_SOURCE_TOKEN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  164    164   
    ::aws_smithy_schema::ShapeId::from_static(
  165    165   
        "com.amazonaws.lambda.synthetic#AddPermissionInput$EventSourceToken",
  166    166   
        "com.amazonaws.lambda.synthetic",
  167    167   
        "AddPermissionInput",
  168    168   
    ),
  169    169   
    ::aws_smithy_schema::ShapeType::String,
  170         -
    "event_source_token",
         170  +
    "EventSourceToken",
  171    171   
    6,
  172    172   
);
  173    173   
static ADDPERMISSIONINPUT_MEMBER_QUALIFIER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  174    174   
    ::aws_smithy_schema::ShapeId::from_static(
  175    175   
        "com.amazonaws.lambda.synthetic#AddPermissionInput$Qualifier",
  176    176   
        "com.amazonaws.lambda.synthetic",
  177    177   
        "AddPermissionInput",
  178    178   
    ),
  179    179   
    ::aws_smithy_schema::ShapeType::String,
  180         -
    "qualifier",
         180  +
    "Qualifier",
  181    181   
    7,
  182    182   
)
  183    183   
.with_http_query("Qualifier");
  184    184   
static ADDPERMISSIONINPUT_MEMBER_REVISION_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  185    185   
    ::aws_smithy_schema::ShapeId::from_static(
  186    186   
        "com.amazonaws.lambda.synthetic#AddPermissionInput$RevisionId",
  187    187   
        "com.amazonaws.lambda.synthetic",
  188    188   
        "AddPermissionInput",
  189    189   
    ),
  190    190   
    ::aws_smithy_schema::ShapeType::String,
  191         -
    "revision_id",
         191  +
    "RevisionId",
  192    192   
    8,
  193    193   
);
  194    194   
static ADDPERMISSIONINPUT_MEMBER_PRINCIPAL_ORG_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  195    195   
    ::aws_smithy_schema::ShapeId::from_static(
  196    196   
        "com.amazonaws.lambda.synthetic#AddPermissionInput$PrincipalOrgID",
  197    197   
        "com.amazonaws.lambda.synthetic",
  198    198   
        "AddPermissionInput",
  199    199   
    ),
  200    200   
    ::aws_smithy_schema::ShapeType::String,
  201         -
    "principal_org_id",
         201  +
    "PrincipalOrgID",
  202    202   
    9,
  203    203   
);
  204    204   
static ADDPERMISSIONINPUT_MEMBER_FUNCTION_URL_AUTH_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  205    205   
    ::aws_smithy_schema::ShapeId::from_static(
  206    206   
        "com.amazonaws.lambda.synthetic#AddPermissionInput$FunctionUrlAuthType",
  207    207   
        "com.amazonaws.lambda.synthetic",
  208    208   
        "AddPermissionInput",
  209    209   
    ),
  210    210   
    ::aws_smithy_schema::ShapeType::String,
  211         -
    "function_url_auth_type",
         211  +
    "FunctionUrlAuthType",
  212    212   
    10,
  213    213   
);
  214    214   
static ADDPERMISSIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  215    215   
    ADDPERMISSIONINPUT_SCHEMA_ID,
  216    216   
    ::aws_smithy_schema::ShapeType::Structure,
  217    217   
    &[
  218    218   
        &ADDPERMISSIONINPUT_MEMBER_FUNCTION_NAME,
  219    219   
        &ADDPERMISSIONINPUT_MEMBER_STATEMENT_ID,
  220    220   
        &ADDPERMISSIONINPUT_MEMBER_ACTION,
  221    221   
        &ADDPERMISSIONINPUT_MEMBER_PRINCIPAL,
  222    222   
        &ADDPERMISSIONINPUT_MEMBER_SOURCE_ARN,
  223    223   
        &ADDPERMISSIONINPUT_MEMBER_SOURCE_ACCOUNT,
  224    224   
        &ADDPERMISSIONINPUT_MEMBER_EVENT_SOURCE_TOKEN,
  225    225   
        &ADDPERMISSIONINPUT_MEMBER_QUALIFIER,
  226    226   
        &ADDPERMISSIONINPUT_MEMBER_REVISION_ID,
  227    227   
        &ADDPERMISSIONINPUT_MEMBER_PRINCIPAL_ORG_ID,
  228    228   
        &ADDPERMISSIONINPUT_MEMBER_FUNCTION_URL_AUTH_TYPE,
  229    229   
    ],
  230         -
);
         230  +
)
         231  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
         232  +
    "POST",
         233  +
    "/2015-03-31/functions/{FunctionName}/policy",
         234  +
    Some(201),
         235  +
));
  231    236   
impl AddPermissionInput {
  232    237   
    /// The schema for this shape.
  233    238   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ADDPERMISSIONINPUT_SCHEMA;
  234    239   
}
  235    240   
impl ::aws_smithy_schema::serde::SerializableStruct for AddPermissionInput {
  236    241   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  237    242   
    fn serialize_members(
  238    243   
        &self,
  239    244   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  240    245   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  241    246   
        if let Some(ref val) = self.function_name {
  242    247   
            ser.write_string(&ADDPERMISSIONINPUT_MEMBER_FUNCTION_NAME, val)?;
  243    248   
        }
  244    249   
        if let Some(ref val) = self.statement_id {
  245    250   
            ser.write_string(&ADDPERMISSIONINPUT_MEMBER_STATEMENT_ID, val)?;
  246    251   
        }
  247    252   
        if let Some(ref val) = self.action {
  248    253   
            ser.write_string(&ADDPERMISSIONINPUT_MEMBER_ACTION, val)?;
  249    254   
        }
  250    255   
        if let Some(ref val) = self.principal {
  251    256   
            ser.write_string(&ADDPERMISSIONINPUT_MEMBER_PRINCIPAL, val)?;
  252    257   
        }
  253    258   
        if let Some(ref val) = self.source_arn {
  254    259   
            ser.write_string(&ADDPERMISSIONINPUT_MEMBER_SOURCE_ARN, val)?;
  255    260   
        }
  256    261   
        if let Some(ref val) = self.source_account {
  257    262   
            ser.write_string(&ADDPERMISSIONINPUT_MEMBER_SOURCE_ACCOUNT, val)?;
  258    263   
        }
  259    264   
        if let Some(ref val) = self.event_source_token {
  260    265   
            ser.write_string(&ADDPERMISSIONINPUT_MEMBER_EVENT_SOURCE_TOKEN, val)?;
  261    266   
        }
  262    267   
        if let Some(ref val) = self.qualifier {
  263    268   
            ser.write_string(&ADDPERMISSIONINPUT_MEMBER_QUALIFIER, val)?;
  264    269   
        }
  265    270   
        if let Some(ref val) = self.revision_id {
  266    271   
            ser.write_string(&ADDPERMISSIONINPUT_MEMBER_REVISION_ID, val)?;
  267    272   
        }
  268    273   
        if let Some(ref val) = self.principal_org_id {
  269    274   
            ser.write_string(&ADDPERMISSIONINPUT_MEMBER_PRINCIPAL_ORG_ID, val)?;
  270    275   
        }
  271    276   
        if let Some(ref val) = self.function_url_auth_type {
  272    277   
            ser.write_string(&ADDPERMISSIONINPUT_MEMBER_FUNCTION_URL_AUTH_TYPE, val.as_str())?;
  273    278   
        }
  274    279   
        Ok(())
  275    280   
    }
  276    281   
}
  277    282   
impl AddPermissionInput {
  278    283   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  279         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  280         -
        deserializer: &mut D,
         284  +
    pub fn deserialize(
         285  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  281    286   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  282    287   
        #[allow(unused_variables, unused_mut)]
  283    288   
        let mut builder = Self::builder();
  284    289   
        #[allow(
  285    290   
            unused_variables,
  286    291   
            unreachable_code,
  287    292   
            clippy::single_match,
  288    293   
            clippy::match_single_binding,
  289    294   
            clippy::diverging_sub_expression
  290    295   
        )]
  291         -
        deserializer.read_struct(&ADDPERMISSIONINPUT_SCHEMA, (), |_, member, deser| {
         296  +
        deserializer.read_struct(&ADDPERMISSIONINPUT_SCHEMA, &mut |member, deser| {
  292    297   
            match member.member_index() {
  293    298   
                Some(0) => {
  294    299   
                    builder.function_name = Some(deser.read_string(member)?);
  295    300   
                }
  296    301   
                Some(1) => {
  297    302   
                    builder.statement_id = Some(deser.read_string(member)?);
  298    303   
                }
  299    304   
                Some(2) => {
  300    305   
                    builder.action = Some(deser.read_string(member)?);
  301    306   
                }
  302    307   
                Some(3) => {
  303    308   
                    builder.principal = Some(deser.read_string(member)?);
  304    309   
                }
  305    310   
                Some(4) => {
  306    311   
                    builder.source_arn = Some(deser.read_string(member)?);
  307    312   
                }
  308    313   
                Some(5) => {
  309    314   
                    builder.source_account = Some(deser.read_string(member)?);
  310    315   
                }
  311    316   
                Some(6) => {
  312    317   
                    builder.event_source_token = Some(deser.read_string(member)?);
  313    318   
                }
  314    319   
                Some(7) => {
  315    320   
                    builder.qualifier = Some(deser.read_string(member)?);
  316    321   
                }
  317    322   
                Some(8) => {
  318    323   
                    builder.revision_id = Some(deser.read_string(member)?);
  319    324   
                }
  320    325   
                Some(9) => {
  321    326   
                    builder.principal_org_id = Some(deser.read_string(member)?);
  322    327   
                }
  323    328   
                Some(10) => {
  324    329   
                    builder.function_url_auth_type = Some(crate::types::FunctionUrlAuthType::from(deser.read_string(member)?.as_str()));
  325    330   
                }
  326    331   
                _ => {}
  327    332   
            }
  328    333   
            Ok(())
  329    334   
        })?;
         335  +
        builder.function_name = builder.function_name.or(Some(String::new()));
         336  +
        builder.statement_id = builder.statement_id.or(Some(String::new()));
         337  +
        builder.action = builder.action.or(Some(String::new()));
         338  +
        builder.principal = builder.principal.or(Some(String::new()));
  330    339   
        builder
  331    340   
            .build()
  332    341   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  333    342   
    }
  334    343   
}
         344  +
impl AddPermissionInput {
         345  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         346  +
    pub fn deserialize_with_response(
         347  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         348  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         349  +
        _status: u16,
         350  +
        _body: &[u8],
         351  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         352  +
        Self::deserialize(deserializer)
         353  +
    }
         354  +
}
  335    355   
impl AddPermissionInput {
  336    356   
    /// Creates a new builder-style object to manufacture [`AddPermissionInput`](crate::operation::add_permission::AddPermissionInput).
  337    357   
    pub fn builder() -> crate::operation::add_permission::builders::AddPermissionInputBuilder {
  338    358   
        crate::operation::add_permission::builders::AddPermissionInputBuilder::default()
  339    359   
    }
  340    360   
}
  341    361   
  342    362   
/// A builder for [`AddPermissionInput`](crate::operation::add_permission::AddPermissionInput).
  343    363   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  344    364   
#[non_exhaustive]

tmp-codegen-diff/aws-sdk/sdk/lambda/src/operation/add_permission/_add_permission_output.rs

@@ -1,1 +96,140 @@
   18     18   
    "com.amazonaws.lambda.synthetic",
   19     19   
    "AddPermissionOutput",
   20     20   
);
   21     21   
static ADDPERMISSIONOUTPUT_MEMBER_STATEMENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   22     22   
    ::aws_smithy_schema::ShapeId::from_static(
   23     23   
        "com.amazonaws.lambda.synthetic#AddPermissionOutput$Statement",
   24     24   
        "com.amazonaws.lambda.synthetic",
   25     25   
        "AddPermissionOutput",
   26     26   
    ),
   27     27   
    ::aws_smithy_schema::ShapeType::String,
   28         -
    "statement",
          28  +
    "Statement",
   29     29   
    0,
   30     30   
);
          31  +
static ADDPERMISSIONOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          32  +
    ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
          33  +
    ::aws_smithy_schema::ShapeType::String,
          34  +
    "request_id",
          35  +
    1,
          36  +
)
          37  +
.with_http_header("x-amzn-requestid");
   31     38   
static ADDPERMISSIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     39   
    ADDPERMISSIONOUTPUT_SCHEMA_ID,
   33     40   
    ::aws_smithy_schema::ShapeType::Structure,
   34         -
    &[&ADDPERMISSIONOUTPUT_MEMBER_STATEMENT],
          41  +
    &[&ADDPERMISSIONOUTPUT_MEMBER_STATEMENT, &ADDPERMISSIONOUTPUT_MEMBER__REQUEST_ID],
   35     42   
);
   36     43   
impl AddPermissionOutput {
   37     44   
    /// The schema for this shape.
   38     45   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ADDPERMISSIONOUTPUT_SCHEMA;
   39     46   
}
   40     47   
impl ::aws_smithy_schema::serde::SerializableStruct for AddPermissionOutput {
   41     48   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     49   
    fn serialize_members(
   43     50   
        &self,
   44     51   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     52   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     53   
        if let Some(ref val) = self.statement {
   47     54   
            ser.write_string(&ADDPERMISSIONOUTPUT_MEMBER_STATEMENT, val)?;
   48     55   
        }
   49     56   
        Ok(())
   50     57   
    }
   51     58   
}
   52     59   
impl AddPermissionOutput {
   53     60   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          61  +
    pub fn deserialize(
          62  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     63   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     64   
        #[allow(unused_variables, unused_mut)]
   58     65   
        let mut builder = Self::builder();
   59     66   
        #[allow(
   60     67   
            unused_variables,
   61     68   
            unreachable_code,
   62     69   
            clippy::single_match,
   63     70   
            clippy::match_single_binding,
   64     71   
            clippy::diverging_sub_expression
   65     72   
        )]
   66         -
        deserializer.read_struct(&ADDPERMISSIONOUTPUT_SCHEMA, (), |_, member, deser| {
          73  +
        deserializer.read_struct(&ADDPERMISSIONOUTPUT_SCHEMA, &mut |member, deser| {
          74  +
            match member.member_index() {
          75  +
                Some(0) => {
          76  +
                    builder.statement = Some(deser.read_string(member)?);
          77  +
                }
          78  +
                Some(1) => {
          79  +
                    builder._request_id = Some(deser.read_string(member)?);
          80  +
                }
          81  +
                _ => {}
          82  +
            }
          83  +
            Ok(())
          84  +
        })?;
          85  +
        Ok(builder.build())
          86  +
    }
          87  +
}
          88  +
impl AddPermissionOutput {
          89  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          90  +
    /// Header-bound members are read directly from headers, avoiding runtime
          91  +
    /// member iteration overhead. Body members are read via the deserializer.
          92  +
    pub fn deserialize_with_response(
          93  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          94  +
        headers: &::aws_smithy_runtime_api::http::Headers,
          95  +
        _status: u16,
          96  +
        _body: &[u8],
          97  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          98  +
        #[allow(unused_variables, unused_mut)]
          99  +
        let mut builder = Self::builder();
         100  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         101  +
            builder._request_id = Some(val.to_string());
         102  +
        }
         103  +
        #[allow(
         104  +
            unused_variables,
         105  +
            unreachable_code,
         106  +
            clippy::single_match,
         107  +
            clippy::match_single_binding,
         108  +
            clippy::diverging_sub_expression
         109  +
        )]
         110  +
        deserializer.read_struct(&ADDPERMISSIONOUTPUT_SCHEMA, &mut |member, deser| {
   67    111   
            match member.member_index() {
   68    112   
                Some(0) => {
   69    113   
                    builder.statement = Some(deser.read_string(member)?);
   70    114   
                }
   71    115   
                _ => {}
   72    116   
            }
   73    117   
            Ok(())
   74    118   
        })?;
   75    119   
        Ok(builder.build())
   76    120   
    }

tmp-codegen-diff/aws-sdk/sdk/lambda/src/operation/create_alias.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 `CreateAlias`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct CreateAlias;
    6      6   
impl CreateAlias {
    7      7   
    /// Creates a new `CreateAlias`
    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::create_alias::CreateAliasInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::create_alias::CreateAliasOutput::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::create_alias::CreateAliasInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::create_alias::CreateAliasOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::create_alias::CreateAliasError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -118,122 +249,405 @@
  138    142   
        ::std::borrow::Cow::Owned(rcb)
  139    143   
    }
  140    144   
}
  141    145   
  142    146   
#[derive(Debug)]
  143    147   
struct CreateAliasResponseDeserializer;
  144    148   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateAliasResponseDeserializer {
  145    149   
    fn deserialize_nonstreaming(
  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 != 201 || force_error {
  156         -
            crate::protocol_serde::shape_create_alias::de_create_alias_http_error(status, headers, body)
         158  +
        if !success && status != 201 || 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::create_alias::CreateAliasError::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  +
                "InvalidParameterValueException" => crate::operation::create_alias::CreateAliasError::InvalidParameterValueException({
         181  +
                    let mut tmp = match protocol
         182  +
                        .deserialize_response(response, crate::types::error::InvalidParameterValueException::SCHEMA, _cfg)
         183  +
                        .and_then(|mut deser| {
         184  +
                            crate::types::error::InvalidParameterValueException::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  +
                "ResourceConflictException" => crate::operation::create_alias::CreateAliasError::ResourceConflictException({
         205  +
                    let mut tmp = match protocol
         206  +
                        .deserialize_response(response, crate::types::error::ResourceConflictException::SCHEMA, _cfg)
         207  +
                        .and_then(|mut deser| {
         208  +
                            crate::types::error::ResourceConflictException::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  +
                "ResourceNotFoundException" => crate::operation::create_alias::CreateAliasError::ResourceNotFoundException({
         229  +
                    let mut tmp = match protocol
         230  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundException::SCHEMA, _cfg)
         231  +
                        .and_then(|mut deser| {
         232  +
                            crate::types::error::ResourceNotFoundException::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  +
                "ServiceException" => crate::operation::create_alias::CreateAliasError::ServiceException({
         253  +
                    let mut tmp = match protocol
         254  +
                        .deserialize_response(response, crate::types::error::ServiceException::SCHEMA, _cfg)
         255  +
                        .and_then(|mut deser| {
         256  +
                            crate::types::error::ServiceException::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  +
                "TooManyRequestsException" => crate::operation::create_alias::CreateAliasError::TooManyRequestsException({
         277  +
                    let mut tmp = match protocol
         278  +
                        .deserialize_response(response, crate::types::error::TooManyRequestsException::SCHEMA, _cfg)
         279  +
                        .and_then(|mut deser| {
         280  +
                            crate::types::error::TooManyRequestsException::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::create_alias::CreateAliasError::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  +
            ))
  157    305   
        } else {
  158         -
            crate::protocol_serde::shape_create_alias::de_create_alias_http_response(status, headers, body)
  159         -
        };
  160         -
        crate::protocol_serde::type_erase_result(parse_result)
         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, CreateAlias::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::create_alias::CreateAliasOutput::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 CreateAliasRequestSerializer;
  165    328   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateAliasRequestSerializer {
  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::create_alias::CreateAliasInput>()
  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::create_alias::CreateAliasInput,
  183         -
                output: &mut ::std::string::String,
  184         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  185         -
                use ::std::fmt::Write as _;
  186         -
                let input_1 = &_input.function_name;
  187         -
                let input_1 = input_1
  188         -
                    .as_ref()
  189         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?;
  190         -
                let function_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  191         -
                if function_name.is_empty() {
  192         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  193         -
                        "function_name",
  194         -
                        "cannot be empty or unset",
  195         -
                    ));
         338  +
        let protocol = _cfg
         339  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         340  +
            .expect("a SharedClientProtocol is required");
         341  +
        if protocol.supports_http_bindings() {
         342  +
            let mut request = protocol
         343  +
                .serialize_body(&input, CreateAlias::INPUT_SCHEMA, "", _cfg)
         344  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         345  +
            {
         346  +
                let mut uri = "/2015-03-31/functions/{FunctionName}/aliases".to_string();
         347  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         348  +
                if let Some(ref val) = input.function_name {
         349  +
                    uri = uri.replace("{FunctionName}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
  196    350   
                }
  197         -
                ::std::write!(output, "/2015-03-31/functions/{FunctionName}/aliases", FunctionName = function_name)
  198         -
                    .expect("formatting should succeed");
  199         -
                ::std::result::Result::Ok(())
  200         -
            }
  201         -
            #[allow(clippy::unnecessary_wraps)]
  202         -
            fn update_http_builder(
  203         -
                input: &crate::operation::create_alias::CreateAliasInput,
  204         -
                builder: ::http_1x::request::Builder,
  205         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  206         -
                let mut uri = ::std::string::String::new();
  207         -
                uri_base(input, &mut uri)?;
  208         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
         351  +
                if !query_params.is_empty() {
         352  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         353  +
                    let pairs: Vec<String> = query_params
         354  +
                        .iter()
         355  +
                        .map(|(k, v)| {
         356  +
                            format!(
         357  +
                                "{}={}",
         358  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         359  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         360  +
                            )
         361  +
                        })
         362  +
                        .collect();
         363  +
                    uri.push_str(&pairs.join("&"));
         364  +
                }
         365  +
                request.set_uri(uri.as_str()).expect("valid URI");
  209    366   
            }
  210         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  211         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  212         -
            builder
  213         -
        };
  214         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_alias::ser_create_alias_input(&input)?);
  215         -
        if let Some(content_length) = body.content_length() {
  216         -
            let content_length = content_length.to_string();
  217         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
         367  +
         368  +
            return ::std::result::Result::Ok(request);
         369  +
        } else {
         370  +
            let mut request = protocol
         371  +
                .serialize_request(&input, CreateAlias::INPUT_SCHEMA, "", _cfg)
         372  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         373  +
         374  +
            return ::std::result::Result::Ok(request);
  218    375   
        }
  219         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  220    376   
    }
  221    377   
}
  222    378   
#[derive(Debug)]
  223    379   
struct CreateAliasEndpointParamsInterceptor;
  224    380   
  225    381   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateAliasEndpointParamsInterceptor {
  226    382   
    fn name(&self) -> &'static str {
  227    383   
        "CreateAliasEndpointParamsInterceptor"
  228    384   
    }
  229    385