AWS SDK

AWS SDK

rev. ec7b2441254af868911fccffe8d8dca83aff0045 (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-wasm/Cargo.toml

@@ -1,1 +37,37 @@
   18     18   
http-body-util = "0.1.3"
   19     19   
wstd = "0.6.5"
   20     20   
   21     21   
[dependencies.aws-smithy-async]
   22     22   
path = "../aws-smithy-async"
   23     23   
version = "1.2.14"
   24     24   
   25     25   
[dependencies.aws-smithy-runtime-api]
   26     26   
path = "../aws-smithy-runtime-api"
   27     27   
features = ["http-1x", "client"]
   28         -
version = "1.11.6"
          28  +
version = "1.11.7"
   29     29   
   30     30   
[dependencies.aws-smithy-types]
   31     31   
path = "../aws-smithy-types"
   32     32   
features = ["http-body-1-x"]
   33     33   
version = "1.4.7"
   34     34   
   35     35   
[dependencies.sync_wrapper]
   36     36   
version = "1"
   37     37   
features = ["futures"]

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

@@ -7,7 +77,81 @@
   27     27   
tracing = "0.1.44"
   28     28   
   29     29   
[dependencies.aws-credential-types]
   30     30   
path = "../aws-credential-types"
   31     31   
version = "1.2.14"
   32     32   
   33     33   
[dependencies.aws-smithy-async]
   34     34   
path = "../aws-smithy-async"
   35     35   
version = "1.2.14"
   36     36   
          37  +
[dependencies.aws-smithy-schema]
          38  +
path = "../aws-smithy-schema"
          39  +
version = "1.0.0"
          40  +
   37     41   
[dependencies.aws-smithy-types]
   38     42   
path = "../aws-smithy-types"
   39     43   
version = "1.4.7"
   40     44   
   41     45   
[dependencies.aws-smithy-runtime]
   42     46   
path = "../aws-smithy-runtime"
   43     47   
optional = true
   44         -
version = "1.10.3"
          48  +
version = "1.10.4"
   45     49   
   46     50   
[dependencies.aws-smithy-runtime-api]
   47     51   
path = "../aws-smithy-runtime-api"
   48     52   
features = ["client"]
   49         -
version = "1.11.6"
          53  +
version = "1.11.7"
   50     54   
   51     55   
[dependencies.hyper-rustls]
   52     56   
version = "0.24.2"
   53     57   
optional = true
   54     58   
default-features = false
   55     59   
features = ["http2", "webpki-roots"]
   56     60   
   57     61   
[dev-dependencies]
   58     62   
http = "0.2.4"
   59     63   
tempfile = "3.16.0"
   60     64   
tracing-test = "0.2.5"
   61     65   
   62     66   
[dev-dependencies.tokio]
   63     67   
version = "1"
   64     68   
features = ["rt", "macros"]
   65     69   
   66     70   
[dev-dependencies.aws-smithy-runtime-api]
   67     71   
path = "../aws-smithy-runtime-api"
   68     72   
features = ["http-02x"]
   69         -
version = "1.11.6"
          73  +
version = "1.11.7"
   70     74   
   71     75   
[dev-dependencies.aws-smithy-runtime]
   72     76   
path = "../aws-smithy-runtime"
   73     77   
features = ["client"]
   74         -
version = "1.10.3"
          78  +
version = "1.10.4"
   75     79   
   76     80   
[build-dependencies]
   77     81   
rustc_version = "0.4.0"

tmp-codegen-diff/aws-sdk/sdk/aws-types/external-types.toml

@@ -1,1 +23,25 @@
    5      5   
    "aws_smithy_async::rt::sleep::SharedAsyncSleep",
    6      6   
    "aws_smithy_async::time::SharedTimeSource",
    7      7   
    "aws_smithy_async::time::TimeSource",
    8      8   
    "aws_smithy_runtime_api::client::auth::AuthSchemePreference",
    9      9   
    "aws_smithy_runtime_api::client::behavior_version::BehaviorVersion",
   10     10   
    "aws_smithy_runtime_api::client::http::HttpClient",
   11     11   
    "aws_smithy_runtime_api::client::http::SharedHttpClient",
   12     12   
    "aws_smithy_runtime_api::client::identity::ResolveCachedIdentity",
   13     13   
    "aws_smithy_runtime_api::client::identity::SharedIdentityCache",
   14     14   
    "aws_smithy_runtime_api::client::stalled_stream_protection::StalledStreamProtectionConfig",
          15  +
    "aws_smithy_schema::schema::protocol::ClientProtocol",
          16  +
    "aws_smithy_schema::schema::protocol::SharedClientProtocol",
   15     17   
    "aws_smithy_runtime_api::http::headers::Headers",
   16     18   
    "aws_smithy_types::checksum_config::ResponseChecksumValidation",
   17     19   
    "aws_smithy_types::checksum_config::RequestChecksumCalculation",
   18     20   
    "aws_smithy_types::config_bag::storable::Storable",
   19     21   
    "aws_smithy_types::config_bag::storable::StoreReplace",
   20     22   
    "aws_smithy_types::error::metadata::Builder",
   21     23   
    "aws_smithy_types::retry::RetryConfig",
   22     24   
    "aws_smithy_types::timeout::TimeoutConfig",
   23     25   
]

tmp-codegen-diff/aws-sdk/sdk/aws-types/src/sdk_config.rs

@@ -1,1 +59,60 @@
   20     20   
use aws_smithy_async::rt::sleep::AsyncSleep;
   21     21   
pub use aws_smithy_async::rt::sleep::SharedAsyncSleep;
   22     22   
pub use aws_smithy_async::time::{SharedTimeSource, TimeSource};
   23     23   
use aws_smithy_runtime_api::client::auth::AuthSchemePreference;
   24     24   
use aws_smithy_runtime_api::client::behavior_version::BehaviorVersion;
   25     25   
use aws_smithy_runtime_api::client::http::HttpClient;
   26     26   
pub use aws_smithy_runtime_api::client::http::SharedHttpClient;
   27     27   
use aws_smithy_runtime_api::client::identity::{ResolveCachedIdentity, SharedIdentityCache};
   28     28   
pub use aws_smithy_runtime_api::client::stalled_stream_protection::StalledStreamProtectionConfig;
   29     29   
use aws_smithy_runtime_api::shared::IntoShared;
          30  +
use aws_smithy_schema::protocol::SharedClientProtocol;
   30     31   
pub use aws_smithy_types::checksum_config::{
   31     32   
    RequestChecksumCalculation, ResponseChecksumValidation,
   32     33   
};
   33     34   
pub use aws_smithy_types::retry::RetryConfig;
   34     35   
pub use aws_smithy_types::timeout::TimeoutConfig;
   35     36   
use std::collections::HashMap;
   36     37   
use std::sync::Arc;
   37     38   
   38     39   
/// Unified docstrings to keep crates in sync. Not intended for public use
   39     40   
pub mod unified_docs {
@@ -103,104 +195,198 @@
  123    124   
    http_client: Option<SharedHttpClient>,
  124    125   
    use_fips: Option<bool>,
  125    126   
    use_dual_stack: Option<bool>,
  126    127   
    behavior_version: Option<BehaviorVersion>,
  127    128   
    service_config: Option<Arc<dyn LoadServiceConfig>>,
  128    129   
    config_origins: HashMap<&'static str, Origin>,
  129    130   
    disable_request_compression: Option<bool>,
  130    131   
    request_min_compression_size_bytes: Option<u32>,
  131    132   
    request_checksum_calculation: Option<RequestChecksumCalculation>,
  132    133   
    response_checksum_validation: Option<ResponseChecksumValidation>,
         134  +
    protocol: Option<SharedClientProtocol>,
  133    135   
}
  134    136   
  135    137   
/// Builder for AWS Shared Configuration
  136    138   
///
  137    139   
/// _Important:_ Using the `aws-config` crate to configure the SDK is preferred to invoking this
  138    140   
/// builder directly. Using this builder directly won't pull in any AWS recommended default
  139    141   
/// configuration values.
  140    142   
#[derive(Debug, Default)]
  141    143   
pub struct Builder {
  142    144   
    app_name: Option<AppName>,
  143    145   
    auth_scheme_preference: Option<AuthSchemePreference>,
  144    146   
    sigv4a_signing_region_set: Option<SigningRegionSet>,
  145    147   
    identity_cache: Option<SharedIdentityCache>,
  146    148   
    credentials_provider: Option<SharedCredentialsProvider>,
  147    149   
    token_provider: Option<SharedTokenProvider>,
  148    150   
    region: Option<Region>,
  149    151   
    account_id_endpoint_mode: Option<AccountIdEndpointMode>,
  150    152   
    endpoint_url: Option<String>,
  151    153   
    retry_config: Option<RetryConfig>,
  152    154   
    sleep_impl: Option<SharedAsyncSleep>,
  153    155   
    time_source: Option<SharedTimeSource>,
  154    156   
    timeout_config: Option<TimeoutConfig>,
  155    157   
    stalled_stream_protection_config: Option<StalledStreamProtectionConfig>,
  156    158   
    http_client: Option<SharedHttpClient>,
  157    159   
    use_fips: Option<bool>,
  158    160   
    use_dual_stack: Option<bool>,
  159    161   
    behavior_version: Option<BehaviorVersion>,
  160    162   
    service_config: Option<Arc<dyn LoadServiceConfig>>,
  161    163   
    config_origins: HashMap<&'static str, Origin>,
  162    164   
    disable_request_compression: Option<bool>,
  163    165   
    request_min_compression_size_bytes: Option<u32>,
  164    166   
    request_checksum_calculation: Option<RequestChecksumCalculation>,
  165    167   
    response_checksum_validation: Option<ResponseChecksumValidation>,
         168  +
    protocol: Option<SharedClientProtocol>,
  166    169   
}
  167    170   
  168    171   
impl Builder {
  169    172   
    /// Set the region for the builder
  170    173   
    ///
  171    174   
    /// # Examples
  172    175   
    /// ```rust
  173    176   
    /// use aws_types::SdkConfig;
  174    177   
    /// use aws_types::region::Region;
  175    178   
    /// let config = SdkConfig::builder().region(Region::new("us-east-1")).build();
@@ -668,671 +727,748 @@
  688    691   
    /// let mut builder = SdkConfig::builder();
  689    692   
    /// override_http_client(&mut builder);
  690    693   
    /// let config = builder.build();
  691    694   
    /// # }
  692    695   
    /// ```
  693    696   
    pub fn set_http_client(&mut self, http_client: Option<SharedHttpClient>) -> &mut Self {
  694    697   
        self.http_client = http_client;
  695    698   
        self
  696    699   
    }
  697    700   
         701  +
    /// Sets the client protocol to use for serialization and deserialization.
         702  +
    ///
         703  +
    /// This overrides the default protocol determined by the service model,
         704  +
    /// enabling runtime protocol selection.
         705  +
    pub fn protocol(
         706  +
        mut self,
         707  +
        protocol: impl aws_smithy_schema::protocol::ClientProtocol + 'static,
         708  +
    ) -> Self {
         709  +
        self.set_protocol(Some(SharedClientProtocol::new(protocol)));
         710  +
        self
         711  +
    }
         712  +
         713  +
    /// Sets the client protocol to use for serialization and deserialization.
         714  +
    pub fn set_protocol(&mut self, protocol: Option<SharedClientProtocol>) -> &mut Self {
         715  +
        self.protocol = protocol;
         716  +
        self
         717  +
    }
         718  +
  698    719   
    #[doc = docs_for!(use_fips)]
  699    720   
    pub fn use_fips(mut self, use_fips: bool) -> Self {
  700    721   
        self.set_use_fips(Some(use_fips));
  701    722   
        self
  702    723   
    }
  703    724   
  704    725   
    #[doc = docs_for!(use_fips)]
  705    726   
    pub fn set_use_fips(&mut self, use_fips: Option<bool>) -> &mut Self {
  706    727   
        self.use_fips = use_fips;
  707    728   
        self
@@ -843,864 +902,924 @@
  863    884   
            use_dual_stack: self.use_dual_stack,
  864    885   
            time_source: self.time_source,
  865    886   
            behavior_version: self.behavior_version,
  866    887   
            stalled_stream_protection_config: self.stalled_stream_protection_config,
  867    888   
            service_config: self.service_config,
  868    889   
            config_origins: self.config_origins,
  869    890   
            disable_request_compression: self.disable_request_compression,
  870    891   
            request_min_compression_size_bytes: self.request_min_compression_size_bytes,
  871    892   
            request_checksum_calculation: self.request_checksum_calculation,
  872    893   
            response_checksum_validation: self.response_checksum_validation,
         894  +
            protocol: self.protocol,
  873    895   
        }
  874    896   
    }
  875    897   
}
  876    898   
  877    899   
impl Builder {
  878    900   
    /// Set the [`StalledStreamProtectionConfig`] to configure protection for stalled streams.
  879    901   
    ///
  880    902   
    /// This configures stalled stream protection. When enabled, download streams
  881    903   
    /// that stall (stream no data) for longer than a configured grace period will return an error.
  882    904   
    ///
@@ -989,1011 +1048,1075 @@
 1009   1031   
    /// Configured app name
 1010   1032   
    pub fn app_name(&self) -> Option<&AppName> {
 1011   1033   
        self.app_name.as_ref()
 1012   1034   
    }
 1013   1035   
 1014   1036   
    /// Configured HTTP client
 1015   1037   
    pub fn http_client(&self) -> Option<SharedHttpClient> {
 1016   1038   
        self.http_client.clone()
 1017   1039   
    }
 1018   1040   
        1041  +
    /// Configured client protocol for serialization and deserialization
        1042  +
    pub fn protocol(&self) -> Option<SharedClientProtocol> {
        1043  +
        self.protocol.clone()
        1044  +
    }
        1045  +
 1019   1046   
    /// Use FIPS endpoints
 1020   1047   
    pub fn use_fips(&self) -> Option<bool> {
 1021   1048   
        self.use_fips
 1022   1049   
    }
 1023   1050   
 1024   1051   
    /// Use dual-stack endpoint
 1025   1052   
    pub fn use_dual_stack(&self) -> Option<bool> {
 1026   1053   
        self.use_dual_stack
 1027   1054   
    }
 1028   1055   
@@ -1086,1113 +1118,1146 @@
 1106   1133   
            use_fips: self.use_fips,
 1107   1134   
            use_dual_stack: self.use_dual_stack,
 1108   1135   
            behavior_version: self.behavior_version,
 1109   1136   
            stalled_stream_protection_config: self.stalled_stream_protection_config,
 1110   1137   
            service_config: self.service_config,
 1111   1138   
            config_origins: self.config_origins,
 1112   1139   
            disable_request_compression: self.disable_request_compression,
 1113   1140   
            request_min_compression_size_bytes: self.request_min_compression_size_bytes,
 1114   1141   
            request_checksum_calculation: self.request_checksum_calculation,
 1115   1142   
            response_checksum_validation: self.response_checksum_validation,
        1143  +
            protocol: self.protocol,
 1116   1144   
        }
 1117   1145   
    }
 1118   1146   
}

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

@@ -25,25 +90,90 @@
   45     45   
path = "../aws-smithy-json"
   46     46   
version = "0.62.6"
   47     47   
   48     48   
[dependencies.aws-smithy-observability]
   49     49   
path = "../aws-smithy-observability"
   50     50   
version = "0.2.6"
   51     51   
   52     52   
[dependencies.aws-smithy-runtime]
   53     53   
path = "../aws-smithy-runtime"
   54     54   
features = ["client", "http-auth"]
   55         -
version = "1.10.3"
          55  +
version = "1.10.4"
   56     56   
   57     57   
[dependencies.aws-smithy-runtime-api]
   58     58   
path = "../aws-smithy-runtime-api"
   59     59   
features = ["client", "http-1x", "http-auth"]
   60         -
version = "1.11.6"
          60  +
version = "1.11.7"
   61     61   
   62     62   
[dependencies.aws-smithy-schema]
   63     63   
path = "../aws-smithy-schema"
   64     64   
version = "1.0.0"
   65     65   
   66     66   
[dependencies.aws-smithy-types]
   67     67   
path = "../aws-smithy-types"
   68     68   
features = ["http-body-1-x"]
   69     69   
version = "1.4.7"
   70     70   
@@ -102,102 +167,167 @@
  122    122   
features = ["test-util", "wire-mock"]
  123    123   
version = "1.1.12"
  124    124   
  125    125   
[dev-dependencies.aws-smithy-protocol-test]
  126    126   
path = "../aws-smithy-protocol-test"
  127    127   
version = "0.63.14"
  128    128   
  129    129   
[dev-dependencies.aws-smithy-runtime]
  130    130   
path = "../aws-smithy-runtime"
  131    131   
features = ["test-util"]
  132         -
version = "1.10.3"
         132  +
version = "1.10.4"
  133    133   
  134    134   
[dev-dependencies.aws-smithy-runtime-api]
  135    135   
path = "../aws-smithy-runtime-api"
  136    136   
features = ["test-util"]
  137         -
version = "1.11.6"
         137  +
version = "1.11.7"
  138    138   
  139    139   
[dev-dependencies.aws-smithy-types]
  140    140   
path = "../aws-smithy-types"
  141    141   
features = ["http-body-1-x", "test-util"]
  142    142   
version = "1.4.7"
  143    143   
  144    144   
[dev-dependencies.futures-util]
  145    145   
version = "0.3.25"
  146    146   
features = ["alloc"]
  147    147   
default-features = false

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/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 +254,277 @@
  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   
    }
  209    216   
    /// Sets the idempotency token provider to use for service calls that require tokens.
  210    217   
    pub fn idempotency_token_provider(
  211    218   
        mut self,
  212    219   
        idempotency_token_provider: impl ::std::convert::Into<crate::idempotency_token::IdempotencyTokenProvider>,
  213    220   
    ) -> Self {
  214    221   
        self.set_idempotency_token_provider(::std::option::Option::Some(idempotency_token_provider.into()));
  215    222   
        self
  216    223   
    }
  217    224   
    /// Sets the idempotency token provider to use for service calls that require tokens.
  218    225   
    pub fn set_idempotency_token_provider(
  219    226   
        &mut self,
  220    227   
        idempotency_token_provider: ::std::option::Option<crate::idempotency_token::IdempotencyTokenProvider>,
  221    228   
    ) -> &mut Self {
  222    229   
        self.config.store_or_unset(idempotency_token_provider);
  223    230   
        self
  224    231   
    }
         232  +
    /// Sets the client protocol to use for serialization and deserialization.
         233  +
    ///
         234  +
    /// This overrides the default protocol determined by the service model,
         235  +
    /// enabling runtime protocol selection.
         236  +
    pub fn protocol(mut self, protocol: impl ::aws_smithy_schema::protocol::ClientProtocol + 'static) -> Self {
         237  +
        self.set_protocol(::std::option::Option::Some(::aws_smithy_schema::protocol::SharedClientProtocol::new(
         238  +
            protocol,
         239  +
        )));
         240  +
        self
         241  +
    }
         242  +
         243  +
    /// Sets the client protocol to use for serialization and deserialization.
         244  +
    pub fn set_protocol(&mut self, protocol: ::std::option::Option<::aws_smithy_schema::protocol::SharedClientProtocol>) -> &mut Self {
         245  +
        self.config.store_or_unset(protocol);
         246  +
        self
         247  +
    }
  225    248   
    /// Sets the HTTP client to use when making requests.
  226    249   
    ///
  227    250   
    /// # Examples
  228    251   
    /// ```no_run
  229    252   
    /// # #[cfg(test)]
  230    253   
    /// # mod tests {
  231    254   
    /// # #[test]
  232    255   
    /// # fn example() {
  233    256   
    /// use std::time::Duration;
  234    257   
    /// use aws_sdk_bedrockruntime::config::Config;
@@ -1336,1359 +1395,1423 @@
 1356   1379   
pub(crate) struct ServiceRuntimePlugin {
 1357   1380   
    config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>,
 1358   1381   
    runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
 1359   1382   
}
 1360   1383   
 1361   1384   
impl ServiceRuntimePlugin {
 1362   1385   
    pub fn new(_service_config: crate::config::Config) -> Self {
 1363   1386   
        let config = {
 1364   1387   
            let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AmazonBedrockFrontendService");
 1365   1388   
            cfg.store_put(crate::idempotency_token::default_provider());
        1389  +
            if _service_config.protocol().is_none() {
        1390  +
                cfg.store_put(::aws_smithy_schema::protocol::SharedClientProtocol::new(
        1391  +
                    ::aws_smithy_json::protocol::aws_rest_json_1::AwsRestJsonProtocol::new(),
        1392  +
                ));
        1393  +
            }
 1366   1394   
            cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2);
 1367   1395   
            ::std::option::Option::Some(cfg.freeze())
 1368   1396   
        };
 1369   1397   
        let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin");
 1370   1398   
        runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
 1371   1399   
            ::aws_smithy_runtime::client::auth::http::BearerAuthScheme::new(),
 1372   1400   
        ));
 1373   1401   
        runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({
 1374   1402   
            use crate::config::auth::ResolveAuthScheme;
 1375   1403   
            crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver()
@@ -1474,1502 +1533,1564 @@
 1494   1522   
        }
 1495   1523   
        // resiliency
 1496   1524   
        builder.set_retry_config(input.retry_config().cloned());
 1497   1525   
        builder.set_timeout_config(input.timeout_config().cloned());
 1498   1526   
        builder.set_sleep_impl(input.sleep_impl());
 1499   1527   
 1500   1528   
        builder.set_http_client(input.http_client());
 1501   1529   
        builder.set_time_source(input.time_source());
 1502   1530   
        builder.set_behavior_version(input.behavior_version());
 1503   1531   
        builder.set_auth_scheme_preference(input.auth_scheme_preference().cloned());
        1532  +
        if let Some(protocol) = input.protocol() {
        1533  +
            builder.set_protocol(Some(protocol.clone()));
        1534  +
        }
 1504   1535   
        // setting `None` here removes the default
 1505   1536   
        if let Some(config) = input.stalled_stream_protection() {
 1506   1537   
            builder.set_stalled_stream_protection(Some(config));
 1507   1538   
        }
 1508   1539   
 1509   1540   
        if let Some(cache) = input.identity_cache() {
 1510   1541   
            builder.set_identity_cache(cache);
 1511   1542   
        }
 1512   1543   
        builder.set_token_provider(input.token_provider());
 1513   1544   
        if let ::std::option::Option::Some(val) = input.service_config().and_then(|conf| {

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

@@ -176,176 +217,215 @@
  196    196   
mod event_stream_serde;
  197    197   
  198    198   
mod idempotency_token;
  199    199   
  200    200   
mod observability_feature;
  201    201   
  202    202   
pub(crate) mod protocol_serde;
  203    203   
  204    204   
mod sdk_feature_tracker;
  205    205   
  206         -
mod serialization_settings;
  207         -
  208    206   
mod endpoint_lib;
  209    207   
         208  +
mod json_errors;
         209  +
  210    210   
mod lens;
  211    211   
  212    212   
mod serde_util;
  213    213   
  214         -
mod json_errors;
  215         -
  216    214   
#[doc(inline)]
  217    215   
pub use client::Client;

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/apply_guardrail/_apply_guardrail_input.rs

@@ -25,25 +226,242 @@
   45     45   
    "com.amazonaws.bedrockruntime.synthetic",
   46     46   
    "ApplyGuardrailInput",
   47     47   
);
   48     48   
static APPLYGUARDRAILINPUT_MEMBER_GUARDRAIL_IDENTIFIER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   49     49   
    ::aws_smithy_schema::ShapeId::from_static(
   50     50   
        "com.amazonaws.bedrockruntime.synthetic#ApplyGuardrailInput$guardrailIdentifier",
   51     51   
        "com.amazonaws.bedrockruntime.synthetic",
   52     52   
        "ApplyGuardrailInput",
   53     53   
    ),
   54     54   
    ::aws_smithy_schema::ShapeType::String,
   55         -
    "guardrail_identifier",
          55  +
    "guardrailIdentifier",
   56     56   
    0,
   57     57   
)
   58     58   
.with_http_label();
   59     59   
static APPLYGUARDRAILINPUT_MEMBER_GUARDRAIL_VERSION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   60     60   
    ::aws_smithy_schema::ShapeId::from_static(
   61     61   
        "com.amazonaws.bedrockruntime.synthetic#ApplyGuardrailInput$guardrailVersion",
   62     62   
        "com.amazonaws.bedrockruntime.synthetic",
   63     63   
        "ApplyGuardrailInput",
   64     64   
    ),
   65     65   
    ::aws_smithy_schema::ShapeType::String,
   66         -
    "guardrail_version",
          66  +
    "guardrailVersion",
   67     67   
    1,
   68     68   
)
   69     69   
.with_http_label();
   70     70   
static APPLYGUARDRAILINPUT_MEMBER_SOURCE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   71     71   
    ::aws_smithy_schema::ShapeId::from_static(
   72     72   
        "com.amazonaws.bedrockruntime.synthetic#ApplyGuardrailInput$source",
   73     73   
        "com.amazonaws.bedrockruntime.synthetic",
   74     74   
        "ApplyGuardrailInput",
   75     75   
    ),
   76     76   
    ::aws_smithy_schema::ShapeType::String,
   77     77   
    "source",
   78     78   
    2,
   79     79   
);
   80     80   
static APPLYGUARDRAILINPUT_MEMBER_CONTENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   81     81   
    ::aws_smithy_schema::ShapeId::from_static(
   82     82   
        "com.amazonaws.bedrockruntime.synthetic#ApplyGuardrailInput$content",
   83     83   
        "com.amazonaws.bedrockruntime.synthetic",
   84     84   
        "ApplyGuardrailInput",
   85     85   
    ),
   86     86   
    ::aws_smithy_schema::ShapeType::List,
   87     87   
    "content",
   88     88   
    3,
   89     89   
);
   90     90   
static APPLYGUARDRAILINPUT_MEMBER_OUTPUT_SCOPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   91     91   
    ::aws_smithy_schema::ShapeId::from_static(
   92     92   
        "com.amazonaws.bedrockruntime.synthetic#ApplyGuardrailInput$outputScope",
   93     93   
        "com.amazonaws.bedrockruntime.synthetic",
   94     94   
        "ApplyGuardrailInput",
   95     95   
    ),
   96     96   
    ::aws_smithy_schema::ShapeType::String,
   97         -
    "output_scope",
          97  +
    "outputScope",
   98     98   
    4,
   99     99   
);
  100    100   
static APPLYGUARDRAILINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  101    101   
    APPLYGUARDRAILINPUT_SCHEMA_ID,
  102    102   
    ::aws_smithy_schema::ShapeType::Structure,
  103    103   
    &[
  104    104   
        &APPLYGUARDRAILINPUT_MEMBER_GUARDRAIL_IDENTIFIER,
  105    105   
        &APPLYGUARDRAILINPUT_MEMBER_GUARDRAIL_VERSION,
  106    106   
        &APPLYGUARDRAILINPUT_MEMBER_SOURCE,
  107    107   
        &APPLYGUARDRAILINPUT_MEMBER_CONTENT,
  108    108   
        &APPLYGUARDRAILINPUT_MEMBER_OUTPUT_SCOPE,
  109    109   
    ],
  110         -
);
         110  +
)
         111  +
.with_http(aws_smithy_schema::traits::HttpTrait::new(
         112  +
    "POST",
         113  +
    "/guardrail/{guardrailIdentifier}/version/{guardrailVersion}/apply",
         114  +
    None,
         115  +
));
  111    116   
impl ApplyGuardrailInput {
  112    117   
    /// The schema for this shape.
  113    118   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &APPLYGUARDRAILINPUT_SCHEMA;
  114    119   
}
  115    120   
impl ::aws_smithy_schema::serde::SerializableStruct for ApplyGuardrailInput {
  116    121   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  117    122   
    fn serialize_members(
  118    123   
        &self,
  119    124   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  120    125   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  121    126   
        if let Some(ref val) = self.guardrail_identifier {
  122    127   
            ser.write_string(&APPLYGUARDRAILINPUT_MEMBER_GUARDRAIL_IDENTIFIER, val)?;
  123    128   
        }
  124    129   
        if let Some(ref val) = self.guardrail_version {
  125    130   
            ser.write_string(&APPLYGUARDRAILINPUT_MEMBER_GUARDRAIL_VERSION, val)?;
  126    131   
        }
  127    132   
        if let Some(ref val) = self.source {
  128    133   
            ser.write_string(&APPLYGUARDRAILINPUT_MEMBER_SOURCE, val.as_str())?;
  129    134   
        }
  130    135   
        if let Some(ref val) = self.content {
  131    136   
            ser.write_list(
  132    137   
                &APPLYGUARDRAILINPUT_MEMBER_CONTENT,
  133    138   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  134    139   
                    for item in val {
  135         -
                        todo!("schema: unsupported list element type");
         140  +
                        ser.write_struct(crate::types::GuardrailContentBlock::SCHEMA, item)?;
  136    141   
                    }
  137    142   
                    Ok(())
  138    143   
                },
  139    144   
            )?;
  140    145   
        }
  141    146   
        if let Some(ref val) = self.output_scope {
  142    147   
            ser.write_string(&APPLYGUARDRAILINPUT_MEMBER_OUTPUT_SCOPE, val.as_str())?;
  143    148   
        }
  144    149   
        Ok(())
  145    150   
    }
  146    151   
}
  147    152   
impl ApplyGuardrailInput {
  148    153   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  149         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  150         -
        deserializer: &mut D,
         154  +
    pub fn deserialize(
         155  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  151    156   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  152    157   
        #[allow(unused_variables, unused_mut)]
  153    158   
        let mut builder = Self::builder();
  154    159   
        #[allow(
  155    160   
            unused_variables,
  156    161   
            unreachable_code,
  157    162   
            clippy::single_match,
  158    163   
            clippy::match_single_binding,
  159    164   
            clippy::diverging_sub_expression
  160    165   
        )]
  161         -
        deserializer.read_struct(&APPLYGUARDRAILINPUT_SCHEMA, (), |_, member, deser| {
         166  +
        deserializer.read_struct(&APPLYGUARDRAILINPUT_SCHEMA, &mut |member, deser| {
  162    167   
            match member.member_index() {
  163    168   
                Some(0) => {
  164    169   
                    builder.guardrail_identifier = Some(deser.read_string(member)?);
  165    170   
                }
  166    171   
                Some(1) => {
  167    172   
                    builder.guardrail_version = Some(deser.read_string(member)?);
  168    173   
                }
  169    174   
                Some(2) => {
  170    175   
                    builder.source = Some(crate::types::GuardrailContentSource::from(deser.read_string(member)?.as_str()));
  171    176   
                }
  172    177   
                Some(3) => {
  173    178   
                    builder.content = Some({
  174         -
                        let container = if let Some(cap) = deser.container_size() {
  175         -
                            Vec::with_capacity(cap)
  176         -
                        } else {
  177         -
                            Vec::new()
  178         -
                        };
  179         -
                        deser.read_list(member, container, |mut list, deser| {
  180         -
                            list.push(todo!("deserialize nested aggregate"));
  181         -
                            Ok(list)
  182         -
                        })?
         179  +
                        let mut container = Vec::new();
         180  +
                        deser.read_list(member, &mut |deser| {
         181  +
                            container.push(crate::types::GuardrailContentBlock::deserialize(deser)?);
         182  +
                            Ok(())
         183  +
                        })?;
         184  +
                        container
  183    185   
                    });
  184    186   
                }
  185    187   
                Some(4) => {
  186    188   
                    builder.output_scope = Some(crate::types::GuardrailOutputScope::from(deser.read_string(member)?.as_str()));
  187    189   
                }
  188    190   
                _ => {}
  189    191   
            }
  190    192   
            Ok(())
  191    193   
        })?;
         194  +
        builder.guardrail_identifier = builder.guardrail_identifier.or(Some(String::new()));
         195  +
        builder.guardrail_version = builder.guardrail_version.or(Some(String::new()));
         196  +
        builder.content = builder.content.or(Some(Vec::new()));
  192    197   
        builder
  193    198   
            .build()
  194    199   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  195    200   
    }
  196    201   
}
         202  +
impl ApplyGuardrailInput {
         203  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         204  +
    pub fn deserialize_with_response(
         205  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         206  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         207  +
        _status: u16,
         208  +
        _body: &[u8],
         209  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         210  +
        Self::deserialize(deserializer)
         211  +
    }
         212  +
}
  197    213   
impl ApplyGuardrailInput {
  198    214   
    /// Creates a new builder-style object to manufacture [`ApplyGuardrailInput`](crate::operation::apply_guardrail::ApplyGuardrailInput).
  199    215   
    pub fn builder() -> crate::operation::apply_guardrail::builders::ApplyGuardrailInputBuilder {
  200    216   
        crate::operation::apply_guardrail::builders::ApplyGuardrailInputBuilder::default()
  201    217   
    }
  202    218   
}
  203    219   
  204    220   
/// A builder for [`ApplyGuardrailInput`](crate::operation::apply_guardrail::ApplyGuardrailInput).
  205    221   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  206    222   
#[non_exhaustive]

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/apply_guardrail/_apply_guardrail_output.rs

@@ -50,50 +255,327 @@
   70     70   
    "action",
   71     71   
    1,
   72     72   
);
   73     73   
static APPLYGUARDRAILOUTPUT_MEMBER_ACTION_REASON: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   74     74   
    ::aws_smithy_schema::ShapeId::from_static(
   75     75   
        "com.amazonaws.bedrockruntime.synthetic#ApplyGuardrailOutput$actionReason",
   76     76   
        "com.amazonaws.bedrockruntime.synthetic",
   77     77   
        "ApplyGuardrailOutput",
   78     78   
    ),
   79     79   
    ::aws_smithy_schema::ShapeType::String,
   80         -
    "action_reason",
          80  +
    "actionReason",
   81     81   
    2,
   82     82   
);
   83     83   
static APPLYGUARDRAILOUTPUT_MEMBER_OUTPUTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   84     84   
    ::aws_smithy_schema::ShapeId::from_static(
   85     85   
        "com.amazonaws.bedrockruntime.synthetic#ApplyGuardrailOutput$outputs",
   86     86   
        "com.amazonaws.bedrockruntime.synthetic",
   87     87   
        "ApplyGuardrailOutput",
   88     88   
    ),
   89     89   
    ::aws_smithy_schema::ShapeType::List,
   90     90   
    "outputs",
   91     91   
    3,
   92     92   
);
   93     93   
static APPLYGUARDRAILOUTPUT_MEMBER_ASSESSMENTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   94     94   
    ::aws_smithy_schema::ShapeId::from_static(
   95     95   
        "com.amazonaws.bedrockruntime.synthetic#ApplyGuardrailOutput$assessments",
   96     96   
        "com.amazonaws.bedrockruntime.synthetic",
   97     97   
        "ApplyGuardrailOutput",
   98     98   
    ),
   99     99   
    ::aws_smithy_schema::ShapeType::List,
  100    100   
    "assessments",
  101    101   
    4,
  102    102   
);
  103    103   
static APPLYGUARDRAILOUTPUT_MEMBER_GUARDRAIL_COVERAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  104    104   
    ::aws_smithy_schema::ShapeId::from_static(
  105    105   
        "com.amazonaws.bedrockruntime.synthetic#ApplyGuardrailOutput$guardrailCoverage",
  106    106   
        "com.amazonaws.bedrockruntime.synthetic",
  107    107   
        "ApplyGuardrailOutput",
  108    108   
    ),
  109    109   
    ::aws_smithy_schema::ShapeType::Structure,
  110         -
    "guardrail_coverage",
         110  +
    "guardrailCoverage",
  111    111   
    5,
  112    112   
);
         113  +
static APPLYGUARDRAILOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         114  +
    ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
         115  +
    ::aws_smithy_schema::ShapeType::String,
         116  +
    "request_id",
         117  +
    6,
         118  +
)
         119  +
.with_http_header("x-amzn-requestid");
  113    120   
static APPLYGUARDRAILOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  114    121   
    APPLYGUARDRAILOUTPUT_SCHEMA_ID,
  115    122   
    ::aws_smithy_schema::ShapeType::Structure,
  116    123   
    &[
  117    124   
        &APPLYGUARDRAILOUTPUT_MEMBER_USAGE,
  118    125   
        &APPLYGUARDRAILOUTPUT_MEMBER_ACTION,
  119    126   
        &APPLYGUARDRAILOUTPUT_MEMBER_ACTION_REASON,
  120    127   
        &APPLYGUARDRAILOUTPUT_MEMBER_OUTPUTS,
  121    128   
        &APPLYGUARDRAILOUTPUT_MEMBER_ASSESSMENTS,
  122    129   
        &APPLYGUARDRAILOUTPUT_MEMBER_GUARDRAIL_COVERAGE,
         130  +
        &APPLYGUARDRAILOUTPUT_MEMBER__REQUEST_ID,
  123    131   
    ],
  124    132   
);
  125    133   
impl ApplyGuardrailOutput {
  126    134   
    /// The schema for this shape.
  127    135   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &APPLYGUARDRAILOUTPUT_SCHEMA;
  128    136   
}
  129    137   
impl ::aws_smithy_schema::serde::SerializableStruct for ApplyGuardrailOutput {
  130    138   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  131    139   
    fn serialize_members(
  132    140   
        &self,
  133    141   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  134    142   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  135    143   
        if let Some(ref val) = self.usage {
  136    144   
            ser.write_struct(&APPLYGUARDRAILOUTPUT_MEMBER_USAGE, val)?;
  137    145   
        }
  138    146   
        {
  139    147   
            let val = &self.action;
  140    148   
            ser.write_string(&APPLYGUARDRAILOUTPUT_MEMBER_ACTION, val.as_str())?;
  141    149   
        }
  142    150   
        if let Some(ref val) = self.action_reason {
  143    151   
            ser.write_string(&APPLYGUARDRAILOUTPUT_MEMBER_ACTION_REASON, val)?;
  144    152   
        }
  145    153   
        {
  146    154   
            let val = &self.outputs;
  147    155   
  148    156   
            ser.write_list(
  149    157   
                &APPLYGUARDRAILOUTPUT_MEMBER_OUTPUTS,
  150    158   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  151    159   
                    for item in val {
  152    160   
                        ser.write_struct(crate::types::GuardrailOutputContent::SCHEMA, item)?;
  153    161   
                    }
  154    162   
                    Ok(())
  155    163   
                },
  156    164   
            )?;
  157    165   
        }
  158    166   
        {
  159    167   
            let val = &self.assessments;
  160    168   
  161    169   
            ser.write_list(
  162    170   
                &APPLYGUARDRAILOUTPUT_MEMBER_ASSESSMENTS,
  163    171   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  164    172   
                    for item in val {
  165    173   
                        ser.write_struct(crate::types::GuardrailAssessment::SCHEMA, item)?;
  166    174   
                    }
  167    175   
                    Ok(())
  168    176   
                },
  169    177   
            )?;
  170    178   
        }
  171    179   
        if let Some(ref val) = self.guardrail_coverage {
  172    180   
            ser.write_struct(&APPLYGUARDRAILOUTPUT_MEMBER_GUARDRAIL_COVERAGE, val)?;
  173    181   
        }
  174    182   
        Ok(())
  175    183   
    }
  176    184   
}
  177    185   
impl ApplyGuardrailOutput {
  178    186   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  179         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  180         -
        deserializer: &mut D,
         187  +
    pub fn deserialize(
         188  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         189  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         190  +
        #[allow(unused_variables, unused_mut)]
         191  +
        let mut builder = Self::builder();
         192  +
        #[allow(
         193  +
            unused_variables,
         194  +
            unreachable_code,
         195  +
            clippy::single_match,
         196  +
            clippy::match_single_binding,
         197  +
            clippy::diverging_sub_expression
         198  +
        )]
         199  +
        deserializer.read_struct(&APPLYGUARDRAILOUTPUT_SCHEMA, &mut |member, deser| {
         200  +
            match member.member_index() {
         201  +
                Some(0) => {
         202  +
                    builder.usage = Some(crate::types::GuardrailUsage::deserialize(deser)?);
         203  +
                }
         204  +
                Some(1) => {
         205  +
                    builder.action = Some(crate::types::GuardrailAction::from(deser.read_string(member)?.as_str()));
         206  +
                }
         207  +
                Some(2) => {
         208  +
                    builder.action_reason = Some(deser.read_string(member)?);
         209  +
                }
         210  +
                Some(3) => {
         211  +
                    builder.outputs = Some({
         212  +
                        let mut container = Vec::new();
         213  +
                        deser.read_list(member, &mut |deser| {
         214  +
                            container.push(crate::types::GuardrailOutputContent::deserialize(deser)?);
         215  +
                            Ok(())
         216  +
                        })?;
         217  +
                        container
         218  +
                    });
         219  +
                }
         220  +
                Some(4) => {
         221  +
                    builder.assessments = Some({
         222  +
                        let mut container = Vec::new();
         223  +
                        deser.read_list(member, &mut |deser| {
         224  +
                            container.push(crate::types::GuardrailAssessment::deserialize(deser)?);
         225  +
                            Ok(())
         226  +
                        })?;
         227  +
                        container
         228  +
                    });
         229  +
                }
         230  +
                Some(5) => {
         231  +
                    builder.guardrail_coverage = Some(crate::types::GuardrailCoverage::deserialize(deser)?);
         232  +
                }
         233  +
                Some(6) => {
         234  +
                    builder._request_id = Some(deser.read_string(member)?);
         235  +
                }
         236  +
                _ => {}
         237  +
            }
         238  +
            Ok(())
         239  +
        })?;
         240  +
        builder.outputs = builder.outputs.or(Some(Vec::new()));
         241  +
        builder.assessments = builder.assessments.or(Some(Vec::new()));
         242  +
        builder
         243  +
            .build()
         244  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         245  +
    }
         246  +
}
         247  +
impl ApplyGuardrailOutput {
         248  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         249  +
    /// Header-bound members are read directly from headers, avoiding runtime
         250  +
    /// member iteration overhead. Body members are read via the deserializer.
         251  +
    pub fn deserialize_with_response(
         252  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         253  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         254  +
        _status: u16,
         255  +
        _body: &[u8],
  181    256   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  182    257   
        #[allow(unused_variables, unused_mut)]
  183    258   
        let mut builder = Self::builder();
         259  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         260  +
            builder._request_id = Some(val.to_string());
         261  +
        }
  184    262   
        #[allow(
  185    263   
            unused_variables,
  186    264   
            unreachable_code,
  187    265   
            clippy::single_match,
  188    266   
            clippy::match_single_binding,
  189    267   
            clippy::diverging_sub_expression
  190    268   
        )]
  191         -
        deserializer.read_struct(&APPLYGUARDRAILOUTPUT_SCHEMA, (), |_, member, deser| {
         269  +
        deserializer.read_struct(&APPLYGUARDRAILOUTPUT_SCHEMA, &mut |member, deser| {
  192    270   
            match member.member_index() {
  193    271   
                Some(0) => {
  194    272   
                    builder.usage = Some(crate::types::GuardrailUsage::deserialize(deser)?);
  195    273   
                }
  196    274   
                Some(1) => {
  197    275   
                    builder.action = Some(crate::types::GuardrailAction::from(deser.read_string(member)?.as_str()));
  198    276   
                }
  199    277   
                Some(2) => {
  200    278   
                    builder.action_reason = Some(deser.read_string(member)?);
  201    279   
                }
  202    280   
                Some(3) => {
  203    281   
                    builder.outputs = Some({
  204         -
                        let container = if let Some(cap) = deser.container_size() {
  205         -
                            Vec::with_capacity(cap)
  206         -
                        } else {
  207         -
                            Vec::new()
  208         -
                        };
  209         -
                        deser.read_list(member, container, |mut list, deser| {
  210         -
                            list.push(crate::types::GuardrailOutputContent::deserialize(deser)?);
  211         -
                            Ok(list)
  212         -
                        })?
         282  +
                        let mut container = Vec::new();
         283  +
                        deser.read_list(member, &mut |deser| {
         284  +
                            container.push(crate::types::GuardrailOutputContent::deserialize(deser)?);
         285  +
                            Ok(())
         286  +
                        })?;
         287  +
                        container
  213    288   
                    });
  214    289   
                }
  215    290   
                Some(4) => {
  216    291   
                    builder.assessments = Some({
  217         -
                        let container = if let Some(cap) = deser.container_size() {
  218         -
                            Vec::with_capacity(cap)
  219         -
                        } else {
  220         -
                            Vec::new()
  221         -
                        };
  222         -
                        deser.read_list(member, container, |mut list, deser| {
  223         -
                            list.push(crate::types::GuardrailAssessment::deserialize(deser)?);
  224         -
                            Ok(list)
  225         -
                        })?
         292  +
                        let mut container = Vec::new();
         293  +
                        deser.read_list(member, &mut |deser| {
         294  +
                            container.push(crate::types::GuardrailAssessment::deserialize(deser)?);
         295  +
                            Ok(())
         296  +
                        })?;
         297  +
                        container
  226    298   
                    });
  227    299   
                }
  228    300   
                Some(5) => {
  229    301   
                    builder.guardrail_coverage = Some(crate::types::GuardrailCoverage::deserialize(deser)?);
  230    302   
                }
  231    303   
                _ => {}
  232    304   
            }
  233    305   
            Ok(())
  234    306   
        })?;
  235    307   
        builder

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/converse.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 `Converse`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct Converse;
    6      6   
impl Converse {
    7      7   
    /// Creates a new `Converse`
    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::converse::ConverseInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::converse::ConverseOutput::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::converse::ConverseInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::converse::ConverseOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::converse::ConverseError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -115,119 +246,499 @@
  135    139   
                crate::operation::converse::ConverseError,
  136    140   
            >::new());
  137    141   
  138    142   
        ::std::borrow::Cow::Owned(rcb)
  139    143   
    }
  140    144   
}
  141    145   
  142    146   
#[derive(Debug)]
  143    147   
struct ConverseResponseDeserializer;
  144    148   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ConverseResponseDeserializer {
  145         -
    fn deserialize_nonstreaming(
         149  +
    fn deserialize_nonstreaming_with_config(
  146    150   
        &self,
  147    151   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         152  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  148    153   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  149    154   
        let (success, status) = (response.status().is_success(), response.status().as_u16());
  150         -
        let headers = response.headers();
  151         -
        let body = response.body().bytes().expect("body loaded");
  152    155   
        #[allow(unused_mut)]
  153    156   
        let mut force_error = false;
  154    157   
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
  155         -
        let parse_result = if !success && status != 200 || force_error {
  156         -
            crate::protocol_serde::shape_converse::de_converse_http_error(status, headers, body)
  157         -
        } else {
  158         -
            crate::protocol_serde::shape_converse::de_converse_http_response(status, headers, body)
         158  +
        if !success && status != 200 || force_error {
         159  +
            let headers = response.headers();
         160  +
            let body = response.body().bytes().expect("body loaded");
         161  +
            #[allow(unused_mut)]
         162  +
            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         163  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         164  +
            })?;
         165  +
            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
         166  +
            let generic = generic_builder.build();
         167  +
            let error_code = match generic.code() {
         168  +
                ::std::option::Option::Some(code) => code,
         169  +
                ::std::option::Option::None => {
         170  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         171  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::converse::ConverseError::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  +
                "AccessDeniedException" => crate::operation::converse::ConverseError::AccessDeniedException({
         181  +
                    let mut tmp = match protocol
         182  +
                        .deserialize_response(response, crate::types::error::AccessDeniedException::SCHEMA, _cfg)
         183  +
                        .and_then(|mut deser| {
         184  +
                            crate::types::error::AccessDeniedException::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  +
                "InternalServerException" => crate::operation::converse::ConverseError::InternalServerException({
         205  +
                    let mut tmp = match protocol
         206  +
                        .deserialize_response(response, crate::types::error::InternalServerException::SCHEMA, _cfg)
         207  +
                        .and_then(|mut deser| {
         208  +
                            crate::types::error::InternalServerException::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  +
                "ModelErrorException" => crate::operation::converse::ConverseError::ModelErrorException({
         229  +
                    let mut tmp = match protocol
         230  +
                        .deserialize_response(response, crate::types::error::ModelErrorException::SCHEMA, _cfg)
         231  +
                        .and_then(|mut deser| {
         232  +
                            crate::types::error::ModelErrorException::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  +
                "ModelNotReadyException" => crate::operation::converse::ConverseError::ModelNotReadyException({
         253  +
                    let mut tmp = match protocol
         254  +
                        .deserialize_response(response, crate::types::error::ModelNotReadyException::SCHEMA, _cfg)
         255  +
                        .and_then(|mut deser| {
         256  +
                            crate::types::error::ModelNotReadyException::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  +
                "ModelTimeoutException" => crate::operation::converse::ConverseError::ModelTimeoutException({
         277  +
                    let mut tmp = match protocol
         278  +
                        .deserialize_response(response, crate::types::error::ModelTimeoutException::SCHEMA, _cfg)
         279  +
                        .and_then(|mut deser| {
         280  +
                            crate::types::error::ModelTimeoutException::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  +
                "ResourceNotFoundException" => crate::operation::converse::ConverseError::ResourceNotFoundException({
         301  +
                    let mut tmp = match protocol
         302  +
                        .deserialize_response(response, crate::types::error::ResourceNotFoundException::SCHEMA, _cfg)
         303  +
                        .and_then(|mut deser| {
         304  +
                            crate::types::error::ResourceNotFoundException::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  +
                "ServiceUnavailableException" => crate::operation::converse::ConverseError::ServiceUnavailableException({
         325  +
                    let mut tmp = match protocol
         326  +
                        .deserialize_response(response, crate::types::error::ServiceUnavailableException::SCHEMA, _cfg)
         327  +
                        .and_then(|mut deser| {
         328  +
                            crate::types::error::ServiceUnavailableException::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  +
                "ThrottlingException" => crate::operation::converse::ConverseError::ThrottlingException({
         349  +
                    let mut tmp = match protocol
         350  +
                        .deserialize_response(response, crate::types::error::ThrottlingException::SCHEMA, _cfg)
         351  +
                        .and_then(|mut deser| {
         352  +
                            crate::types::error::ThrottlingException::deserialize_with_response(
         353  +
                                &mut *deser,
         354  +
                                response.headers(),
         355  +
                                response.status().into(),
         356  +
                                body,
         357  +
                            )
         358  +
                        }) {
         359  +
                        ::std::result::Result::Ok(val) => val,
         360  +
                        ::std::result::Result::Err(e) => {
         361  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         362  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         363  +
                            ))
         364  +
                        }
         365  +
                    };
         366  +
                    tmp.meta = generic;
         367  +
                    if tmp.message.is_none() {
         368  +
                        tmp.message = _error_message;
         369  +
                    }
         370  +
                    tmp
         371  +
                }),
         372  +
                "ValidationException" => crate::operation::converse::ConverseError::ValidationException({
         373  +
                    let mut tmp = match protocol
         374  +
                        .deserialize_response(response, crate::types::error::ValidationException::SCHEMA, _cfg)
         375  +
                        .and_then(|mut deser| {
         376  +
                            crate::types::error::ValidationException::deserialize_with_response(
         377  +
                                &mut *deser,
         378  +
                                response.headers(),
         379  +
                                response.status().into(),
         380  +
                                body,
         381  +
                            )
         382  +
                        }) {
         383  +
                        ::std::result::Result::Ok(val) => val,
         384  +
                        ::std::result::Result::Err(e) => {
         385  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         386  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         387  +
                            ))
         388  +
                        }
  159    389   
                    };
  160         -
        crate::protocol_serde::type_erase_result(parse_result)
         390  +
                    tmp.meta = generic;
         391  +
                    if tmp.message.is_none() {
         392  +
                        tmp.message = _error_message;
         393  +
                    }
         394  +
                    tmp
         395  +
                }),
         396  +
                _ => crate::operation::converse::ConverseError::generic(generic),
         397  +
            };
         398  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         399  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         400  +
            ))
         401  +
        } else {
         402  +
            let protocol = _cfg
         403  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         404  +
                .expect("a SharedClientProtocol is required");
         405  +
            let mut deser = protocol.deserialize_response(response, Converse::OUTPUT_SCHEMA, _cfg).map_err(|e| {
         406  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         407  +
            })?;
         408  +
            let body = response.body().bytes().expect("body loaded");
         409  +
            let output = crate::operation::converse::ConverseOutput::deserialize_with_response(
         410  +
                &mut *deser,
         411  +
                response.headers(),
         412  +
                response.status().into(),
         413  +
                body,
         414  +
            )
         415  +
            .map_err(|e| {
         416  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         417  +
            })?;
         418  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         419  +
        }
  161    420   
    }
  162    421   
}
  163    422   
#[derive(Debug)]
  164    423   
struct ConverseRequestSerializer;
  165    424   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ConverseRequestSerializer {
  166    425   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  167    426   
    fn serialize_input(
  168    427   
        &self,
  169    428   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  170    429   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  171    430   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  172    431   
        let input = input.downcast::<crate::operation::converse::ConverseInput>().expect("correct type");
  173         -
        let _header_serialization_settings = _cfg
  174         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  175         -
            .cloned()
  176         -
            .unwrap_or_default();
  177         -
        let mut request_builder = {
  178         -
            #[allow(clippy::uninlined_format_args)]
  179         -
            fn uri_base(
  180         -
                _input: &crate::operation::converse::ConverseInput,
  181         -
                output: &mut ::std::string::String,
  182         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  183         -
                use ::std::fmt::Write as _;
  184         -
                let input_1 = &_input.model_id;
  185         -
                let input_1 = input_1
  186         -
                    .as_ref()
  187         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("model_id", "cannot be empty or unset"))?;
  188         -
                let model_id = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  189         -
                if model_id.is_empty() {
  190         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  191         -
                        "model_id",
  192         -
                        "cannot be empty or unset",
  193         -
                    ));
         432  +
        let protocol = _cfg
         433  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         434  +
            .expect("a SharedClientProtocol is required");
         435  +
        if protocol.supports_http_bindings() {
         436  +
            let mut request = protocol
         437  +
                .serialize_body(&input, Converse::INPUT_SCHEMA, "", _cfg)
         438  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         439  +
            {
         440  +
                let mut uri = "/model/{modelId}/converse".to_string();
         441  +
                let mut query_params: Vec<(String, String)> = Vec::new();
         442  +
                if let Some(ref val) = input.model_id {
         443  +
                    uri = uri.replace("{modelId}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
         444  +
                }
         445  +
                if !query_params.is_empty() {
         446  +
                    uri.push(if uri.contains('?') { '&' } else { '?' });
         447  +
                    let pairs: Vec<String> = query_params
         448  +
                        .iter()
         449  +
                        .map(|(k, v)| {
         450  +
                            format!(
         451  +
                                "{}={}",
         452  +
                                ::aws_smithy_schema::http_protocol::percent_encode(k),
         453  +
                                ::aws_smithy_schema::http_protocol::percent_encode(v)
         454  +
                            )
         455  +
                        })
         456  +
                        .collect();
         457  +
                    uri.push_str(&pairs.join("&"));
  194    458   
                }
  195         -
                ::std::write!(output, "/model/{modelId}/converse", modelId = model_id).expect("formatting should succeed");
  196         -
                ::std::result::Result::Ok(())
         459  +
                request.set_uri(uri.as_str()).expect("valid URI");
  197    460   
            }
  198         -
            #[allow(clippy::unnecessary_wraps)]
  199         -
            fn update_http_builder(
  200         -
                input: &crate::operation::converse::ConverseInput,
  201         -
                builder: ::http_1x::request::Builder,
  202         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  203         -
                let mut uri = ::std::string::String::new();
  204         -
                uri_base(input, &mut uri)?;
  205         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  206         -
            }
  207         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  208         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  209         -
            builder
  210         -
        };
  211         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_converse::ser_converse_input(&input)?);
  212         -
        if let Some(content_length) = body.content_length() {
  213         -
            let content_length = content_length.to_string();
  214         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
         461  +
         462  +
            return ::std::result::Result::Ok(request);
         463  +
        } else {
         464  +
            let mut request = protocol
         465  +
                .serialize_request(&input, Converse::INPUT_SCHEMA, "", _cfg)
         466  +
                .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         467  +
         468  +
            return ::std::result::Result::Ok(request);
  215    469   
        }
  216         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
  217    470   
    }
  218    471   
}
  219    472   
#[derive(Debug)]
  220    473   
struct ConverseEndpointParamsInterceptor;
  221    474   
  222    475   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ConverseEndpointParamsInterceptor {
  223    476   
    fn name(&self) -> &'static str {
  224    477   
        "ConverseEndpointParamsInterceptor"
  225    478   
    }
  226    479   

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/converse/_converse_input.rs

@@ -114,114 +490,474 @@
  134    134   
    "com.amazonaws.bedrockruntime.synthetic",
  135    135   
    "ConverseInput",
  136    136   
);
  137    137   
static CONVERSEINPUT_MEMBER_MODEL_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  138    138   
    ::aws_smithy_schema::ShapeId::from_static(
  139    139   
        "com.amazonaws.bedrockruntime.synthetic#ConverseInput$modelId",
  140    140   
        "com.amazonaws.bedrockruntime.synthetic",
  141    141   
        "ConverseInput",
  142    142   
    ),
  143    143   
    ::aws_smithy_schema::ShapeType::String,
  144         -
    "model_id",
         144  +
    "modelId",
  145    145   
    0,
  146    146   
)
  147    147   
.with_http_label();
  148    148   
static CONVERSEINPUT_MEMBER_MESSAGES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  149    149   
    ::aws_smithy_schema::ShapeId::from_static(
  150    150   
        "com.amazonaws.bedrockruntime.synthetic#ConverseInput$messages",
  151    151   
        "com.amazonaws.bedrockruntime.synthetic",
  152    152   
        "ConverseInput",
  153    153   
    ),
  154    154   
    ::aws_smithy_schema::ShapeType::List,
  155    155   
    "messages",
  156    156   
    1,
  157    157   
);
  158    158   
static CONVERSEINPUT_MEMBER_SYSTEM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  159    159   
    ::aws_smithy_schema::ShapeId::from_static(
  160    160   
        "com.amazonaws.bedrockruntime.synthetic#ConverseInput$system",
  161    161   
        "com.amazonaws.bedrockruntime.synthetic",
  162    162   
        "ConverseInput",
  163    163   
    ),
  164    164   
    ::aws_smithy_schema::ShapeType::List,
  165    165   
    "system",
  166    166   
    2,
  167    167   
);
  168    168   
static CONVERSEINPUT_MEMBER_INFERENCE_CONFIG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  169    169   
    ::aws_smithy_schema::ShapeId::from_static(
  170    170   
        "com.amazonaws.bedrockruntime.synthetic#ConverseInput$inferenceConfig",
  171    171   
        "com.amazonaws.bedrockruntime.synthetic",
  172    172   
        "ConverseInput",
  173    173   
    ),
  174    174   
    ::aws_smithy_schema::ShapeType::Structure,
  175         -
    "inference_config",
         175  +
    "inferenceConfig",
  176    176   
    3,
  177    177   
);
  178    178   
static CONVERSEINPUT_MEMBER_TOOL_CONFIG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  179    179   
    ::aws_smithy_schema::ShapeId::from_static(
  180    180   
        "com.amazonaws.bedrockruntime.synthetic#ConverseInput$toolConfig",
  181    181   
        "com.amazonaws.bedrockruntime.synthetic",
  182    182   
        "ConverseInput",
  183    183   
    ),
  184    184   
    ::aws_smithy_schema::ShapeType::Structure,
  185         -
    "tool_config",
         185  +
    "toolConfig",
  186    186   
    4,
  187    187   
);
  188    188   
static CONVERSEINPUT_MEMBER_GUARDRAIL_CONFIG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  189    189   
    ::aws_smithy_schema::ShapeId::from_static(
  190    190   
        "com.amazonaws.bedrockruntime.synthetic#ConverseInput$guardrailConfig",
  191    191   
        "com.amazonaws.bedrockruntime.synthetic",
  192    192   
        "ConverseInput",
  193    193   
    ),
  194    194   
    ::aws_smithy_schema::ShapeType::Structure,
  195         -
    "guardrail_config",
         195  +
    "guardrailConfig",
  196    196   
    5,
  197    197   
);
  198    198   
static CONVERSEINPUT_MEMBER_ADDITIONAL_MODEL_REQUEST_FIELDS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  199    199   
    ::aws_smithy_schema::ShapeId::from_static(
  200    200   
        "com.amazonaws.bedrockruntime.synthetic#ConverseInput$additionalModelRequestFields",
  201    201   
        "com.amazonaws.bedrockruntime.synthetic",
  202    202   
        "ConverseInput",
  203    203   
    ),
  204    204   
    ::aws_smithy_schema::ShapeType::Document,
  205         -
    "additional_model_request_fields",
         205  +
    "additionalModelRequestFields",
  206    206   
    6,
  207    207   
);
  208    208   
static CONVERSEINPUT_MEMBER_PROMPT_VARIABLES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  209    209   
    ::aws_smithy_schema::ShapeId::from_static(
  210    210   
        "com.amazonaws.bedrockruntime.synthetic#ConverseInput$promptVariables",
  211    211   
        "com.amazonaws.bedrockruntime.synthetic",
  212    212   
        "ConverseInput",
  213    213   
    ),
  214    214   
    ::aws_smithy_schema::ShapeType::Map,
  215         -
    "prompt_variables",
         215  +
    "promptVariables",
  216    216   
    7,
  217    217   
);
  218    218   
static CONVERSEINPUT_MEMBER_ADDITIONAL_MODEL_RESPONSE_FIELD_PATHS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  219    219   
    ::aws_smithy_schema::ShapeId::from_static(
  220    220   
        "com.amazonaws.bedrockruntime.synthetic#ConverseInput$additionalModelResponseFieldPaths",
  221    221   
        "com.amazonaws.bedrockruntime.synthetic",
  222    222   
        "ConverseInput",
  223    223   
    ),
  224    224   
    ::aws_smithy_schema::ShapeType::List,
  225         -
    "additional_model_response_field_paths",
         225  +
    "additionalModelResponseFieldPaths",
  226    226   
    8,
  227    227   
);
  228    228   
static CONVERSEINPUT_MEMBER_REQUEST_METADATA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  229    229   
    ::aws_smithy_schema::ShapeId::from_static(
  230    230   
        "com.amazonaws.bedrockruntime.synthetic#ConverseInput$requestMetadata",
  231    231   
        "com.amazonaws.bedrockruntime.synthetic",
  232    232   
        "ConverseInput",
  233    233   
    ),
  234    234   
    ::aws_smithy_schema::ShapeType::Map,
  235         -
    "request_metadata",
         235  +
    "requestMetadata",
  236    236   
    9,
  237    237   
);
  238    238   
static CONVERSEINPUT_MEMBER_PERFORMANCE_CONFIG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  239    239   
    ::aws_smithy_schema::ShapeId::from_static(
  240    240   
        "com.amazonaws.bedrockruntime.synthetic#ConverseInput$performanceConfig",
  241    241   
        "com.amazonaws.bedrockruntime.synthetic",
  242    242   
        "ConverseInput",
  243    243   
    ),
  244    244   
    ::aws_smithy_schema::ShapeType::Structure,
  245         -
    "performance_config",
         245  +
    "performanceConfig",
  246    246   
    10,
  247    247   
);
  248    248   
static CONVERSEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  249    249   
    CONVERSEINPUT_SCHEMA_ID,
  250    250   
    ::aws_smithy_schema::ShapeType::Structure,
  251    251   
    &[
  252    252   
        &CONVERSEINPUT_MEMBER_MODEL_ID,
  253    253   
        &CONVERSEINPUT_MEMBER_MESSAGES,
  254    254   
        &CONVERSEINPUT_MEMBER_SYSTEM,
  255    255   
        &CONVERSEINPUT_MEMBER_INFERENCE_CONFIG,
  256    256   
        &CONVERSEINPUT_MEMBER_TOOL_CONFIG,
  257    257   
        &CONVERSEINPUT_MEMBER_GUARDRAIL_CONFIG,
  258    258   
        &CONVERSEINPUT_MEMBER_ADDITIONAL_MODEL_REQUEST_FIELDS,
  259    259   
        &CONVERSEINPUT_MEMBER_PROMPT_VARIABLES,
  260    260   
        &CONVERSEINPUT_MEMBER_ADDITIONAL_MODEL_RESPONSE_FIELD_PATHS,
  261    261   
        &CONVERSEINPUT_MEMBER_REQUEST_METADATA,
  262    262   
        &CONVERSEINPUT_MEMBER_PERFORMANCE_CONFIG,
  263    263   
    ],
  264         -
);
         264  +
)
         265  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/model/{modelId}/converse", None));
  265    266   
impl ConverseInput {
  266    267   
    /// The schema for this shape.
  267    268   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CONVERSEINPUT_SCHEMA;
  268    269   
}
  269    270   
impl ::aws_smithy_schema::serde::SerializableStruct for ConverseInput {
  270    271   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  271    272   
    fn serialize_members(
  272    273   
        &self,
  273    274   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  274    275   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  275    276   
        if let Some(ref val) = self.model_id {
  276    277   
            ser.write_string(&CONVERSEINPUT_MEMBER_MODEL_ID, val)?;
  277    278   
        }
  278    279   
        if let Some(ref val) = self.messages {
  279    280   
            ser.write_list(
  280    281   
                &CONVERSEINPUT_MEMBER_MESSAGES,
  281    282   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  282    283   
                    for item in val {
  283    284   
                        ser.write_struct(crate::types::Message::SCHEMA, item)?;
  284    285   
                    }
  285    286   
                    Ok(())
  286    287   
                },
  287    288   
            )?;
  288    289   
        }
  289    290   
        if let Some(ref val) = self.system {
  290    291   
            ser.write_list(
  291    292   
                &CONVERSEINPUT_MEMBER_SYSTEM,
  292    293   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  293    294   
                    for item in val {
  294         -
                        todo!("schema: unsupported list element type");
         295  +
                        ser.write_struct(crate::types::SystemContentBlock::SCHEMA, item)?;
  295    296   
                    }
  296    297   
                    Ok(())
  297    298   
                },
  298    299   
            )?;
  299    300   
        }
  300    301   
        if let Some(ref val) = self.inference_config {
  301    302   
            ser.write_struct(&CONVERSEINPUT_MEMBER_INFERENCE_CONFIG, val)?;
  302    303   
        }
  303    304   
        if let Some(ref val) = self.tool_config {
  304    305   
            ser.write_struct(&CONVERSEINPUT_MEMBER_TOOL_CONFIG, val)?;
  305    306   
        }
  306    307   
        if let Some(ref val) = self.guardrail_config {
  307    308   
            ser.write_struct(&CONVERSEINPUT_MEMBER_GUARDRAIL_CONFIG, val)?;
  308    309   
        }
  309    310   
        if let Some(ref val) = self.additional_model_request_fields {
  310    311   
            ser.write_document(&CONVERSEINPUT_MEMBER_ADDITIONAL_MODEL_REQUEST_FIELDS, val)?;
  311    312   
        }
  312    313   
        if let Some(ref val) = self.prompt_variables {
  313    314   
            ser.write_map(
  314    315   
                &CONVERSEINPUT_MEMBER_PROMPT_VARIABLES,
  315    316   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  316    317   
                    for (key, value) in val {
  317    318   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  318         -
                        todo!("schema: unsupported map value type");
         319  +
                        ser.write_struct(crate::types::PromptVariableValues::SCHEMA, value)?;
  319    320   
                    }
  320    321   
                    Ok(())
  321    322   
                },
  322    323   
            )?;
  323    324   
        }
  324    325   
        if let Some(ref val) = self.additional_model_response_field_paths {
  325    326   
            ser.write_list(
  326    327   
                &CONVERSEINPUT_MEMBER_ADDITIONAL_MODEL_RESPONSE_FIELD_PATHS,
  327    328   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  328    329   
                    for item in val {
  329    330   
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
  330    331   
                    }
  331    332   
                    Ok(())
  332    333   
                },
  333    334   
            )?;
  334    335   
        }
  335    336   
        if let Some(ref val) = self.request_metadata {
  336    337   
            ser.write_map(
  337    338   
                &CONVERSEINPUT_MEMBER_REQUEST_METADATA,
  338    339   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  339    340   
                    for (key, value) in val {
  340    341   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
  341    342   
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
  342    343   
                    }
  343    344   
                    Ok(())
  344    345   
                },
  345    346   
            )?;
  346    347   
        }
  347    348   
        if let Some(ref val) = self.performance_config {
  348    349   
            ser.write_struct(&CONVERSEINPUT_MEMBER_PERFORMANCE_CONFIG, val)?;
  349    350   
        }
  350    351   
        Ok(())
  351    352   
    }
  352    353   
}
  353    354   
impl ConverseInput {
  354    355   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  355         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  356         -
        deserializer: &mut D,
         356  +
    pub fn deserialize(
         357  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  357    358   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  358    359   
        #[allow(unused_variables, unused_mut)]
  359    360   
        let mut builder = Self::builder();
  360    361   
        #[allow(
  361    362   
            unused_variables,
  362    363   
            unreachable_code,
  363    364   
            clippy::single_match,
  364    365   
            clippy::match_single_binding,
  365    366   
            clippy::diverging_sub_expression
  366    367   
        )]
  367         -
        deserializer.read_struct(&CONVERSEINPUT_SCHEMA, (), |_, member, deser| {
         368  +
        deserializer.read_struct(&CONVERSEINPUT_SCHEMA, &mut |member, deser| {
  368    369   
            match member.member_index() {
  369    370   
                Some(0) => {
  370    371   
                    builder.model_id = Some(deser.read_string(member)?);
  371    372   
                }
  372    373   
                Some(1) => {
  373    374   
                    builder.messages = Some({
  374         -
                        let container = if let Some(cap) = deser.container_size() {
  375         -
                            Vec::with_capacity(cap)
  376         -
                        } else {
  377         -
                            Vec::new()
  378         -
                        };
  379         -
                        deser.read_list(member, container, |mut list, deser| {
  380         -
                            list.push(crate::types::Message::deserialize(deser)?);
  381         -
                            Ok(list)
  382         -
                        })?
         375  +
                        let mut container = Vec::new();
         376  +
                        deser.read_list(member, &mut |deser| {
         377  +
                            container.push(crate::types::Message::deserialize(deser)?);
         378  +
                            Ok(())
         379  +
                        })?;
         380  +
                        container
  383    381   
                    });
  384    382   
                }
  385    383   
                Some(2) => {
  386    384   
                    builder.system = Some({
  387         -
                        let container = if let Some(cap) = deser.container_size() {
  388         -
                            Vec::with_capacity(cap)
  389         -
                        } else {
  390         -
                            Vec::new()
  391         -
                        };
  392         -
                        deser.read_list(member, container, |mut list, deser| {
  393         -
                            list.push(todo!("deserialize nested aggregate"));
  394         -
                            Ok(list)
  395         -
                        })?
         385  +
                        let mut container = Vec::new();
         386  +
                        deser.read_list(member, &mut |deser| {
         387  +
                            container.push(crate::types::SystemContentBlock::deserialize(deser)?);
         388  +
                            Ok(())
         389  +
                        })?;
         390  +
                        container
  396    391   
                    });
  397    392   
                }
  398    393   
                Some(3) => {
  399    394   
                    builder.inference_config = Some(crate::types::InferenceConfiguration::deserialize(deser)?);
  400    395   
                }
  401    396   
                Some(4) => {
  402    397   
                    builder.tool_config = Some(crate::types::ToolConfiguration::deserialize(deser)?);
  403    398   
                }
  404    399   
                Some(5) => {
  405    400   
                    builder.guardrail_config = Some(crate::types::GuardrailConfiguration::deserialize(deser)?);
  406    401   
                }
  407    402   
                Some(6) => {
  408    403   
                    builder.additional_model_request_fields = Some(deser.read_document(member)?);
  409    404   
                }
  410    405   
                Some(7) => {
  411    406   
                    builder.prompt_variables = Some({
  412         -
                        let container = if let Some(cap) = deser.container_size() {
  413         -
                            std::collections::HashMap::with_capacity(cap)
  414         -
                        } else {
  415         -
                            std::collections::HashMap::new()
  416         -
                        };
  417         -
                        deser.read_map(member, container, |mut map, key, deser| {
  418         -
                            map.insert(key, todo!("deserialize nested aggregate"));
  419         -
                            Ok(map)
  420         -
                        })?
         407  +
                        let mut container = std::collections::HashMap::new();
         408  +
                        deser.read_map(member, &mut |key, deser| {
         409  +
                            container.insert(key, crate::types::PromptVariableValues::deserialize(deser)?);
         410  +
                            Ok(())
         411  +
                        })?;
         412  +
                        container
  421    413   
                    });
  422    414   
                }
  423    415   
                Some(8) => {
  424         -
                    builder.additional_model_response_field_paths = Some({
  425         -
                        let container = if let Some(cap) = deser.container_size() {
  426         -
                            Vec::with_capacity(cap)
  427         -
                        } else {
  428         -
                            Vec::new()
  429         -
                        };
  430         -
                        deser.read_list(member, container, |mut list, deser| {
  431         -
                            list.push(deser.read_string(member)?);
  432         -
                            Ok(list)
  433         -
                        })?
  434         -
                    });
         416  +
                    builder.additional_model_response_field_paths = Some(deser.read_string_list(member)?);
  435    417   
                }
  436    418   
                Some(9) => {
  437         -
                    builder.request_metadata = Some({
  438         -
                        let container = if let Some(cap) = deser.container_size() {
  439         -
                            std::collections::HashMap::with_capacity(cap)
  440         -
                        } else {
  441         -
                            std::collections::HashMap::new()
  442         -
                        };
  443         -
                        deser.read_map(member, container, |mut map, key, deser| {
  444         -
                            map.insert(key, deser.read_string(member)?);
  445         -
                            Ok(map)
  446         -
                        })?
  447         -
                    });
         419  +
                    builder.request_metadata = Some(deser.read_string_string_map(member)?);
  448    420   
                }
  449    421   
                Some(10) => {
  450    422   
                    builder.performance_config = Some(crate::types::PerformanceConfiguration::deserialize(deser)?);
  451    423   
                }
  452    424   
                _ => {}
  453    425   
            }
  454    426   
            Ok(())
  455    427   
        })?;
         428  +
        builder.model_id = builder.model_id.or(Some(String::new()));
  456    429   
        builder
  457    430   
            .build()
  458    431   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  459    432   
    }
  460    433   
}
         434  +
impl ConverseInput {
         435  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         436  +
    pub fn deserialize_with_response(
         437  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         438  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         439  +
        _status: u16,
         440  +
        _body: &[u8],
         441  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         442  +
        Self::deserialize(deserializer)
         443  +
    }
         444  +
}
  461    445   
impl ConverseInput {
  462    446   
    /// Creates a new builder-style object to manufacture [`ConverseInput`](crate::operation::converse::ConverseInput).
  463    447   
    pub fn builder() -> crate::operation::converse::builders::ConverseInputBuilder {
  464    448   
        crate::operation::converse::builders::ConverseInputBuilder::default()
  465    449   
    }
  466    450   
}
  467    451   
  468    452   
/// A builder for [`ConverseInput`](crate::operation::converse::ConverseInput).
  469    453   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
  470    454   
#[non_exhaustive]