AWS SDK

AWS SDK

rev. 96f5a1b4ad139d2f1ad1e8e40f300e1cd1ff574c

Files changed:

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

@@ -44,44 +225,287 @@
   64     64   
    "output",
   65     65   
    0,
   66     66   
);
   67     67   
static CONVERSEOUTPUT_MEMBER_STOP_REASON: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   68     68   
    ::aws_smithy_schema::ShapeId::from_static(
   69     69   
        "com.amazonaws.bedrockruntime.synthetic#ConverseOutput$stopReason",
   70     70   
        "com.amazonaws.bedrockruntime.synthetic",
   71     71   
        "ConverseOutput",
   72     72   
    ),
   73     73   
    ::aws_smithy_schema::ShapeType::String,
   74         -
    "stop_reason",
          74  +
    "stopReason",
   75     75   
    1,
   76     76   
);
   77     77   
static CONVERSEOUTPUT_MEMBER_USAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   78     78   
    ::aws_smithy_schema::ShapeId::from_static(
   79     79   
        "com.amazonaws.bedrockruntime.synthetic#ConverseOutput$usage",
   80     80   
        "com.amazonaws.bedrockruntime.synthetic",
   81     81   
        "ConverseOutput",
   82     82   
    ),
   83     83   
    ::aws_smithy_schema::ShapeType::Structure,
   84     84   
    "usage",
   85     85   
    2,
   86     86   
);
   87     87   
static CONVERSEOUTPUT_MEMBER_METRICS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   88     88   
    ::aws_smithy_schema::ShapeId::from_static(
   89     89   
        "com.amazonaws.bedrockruntime.synthetic#ConverseOutput$metrics",
   90     90   
        "com.amazonaws.bedrockruntime.synthetic",
   91     91   
        "ConverseOutput",
   92     92   
    ),
   93     93   
    ::aws_smithy_schema::ShapeType::Structure,
   94     94   
    "metrics",
   95     95   
    3,
   96     96   
);
   97     97   
static CONVERSEOUTPUT_MEMBER_ADDITIONAL_MODEL_RESPONSE_FIELDS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   98     98   
    ::aws_smithy_schema::ShapeId::from_static(
   99     99   
        "com.amazonaws.bedrockruntime.synthetic#ConverseOutput$additionalModelResponseFields",
  100    100   
        "com.amazonaws.bedrockruntime.synthetic",
  101    101   
        "ConverseOutput",
  102    102   
    ),
  103    103   
    ::aws_smithy_schema::ShapeType::Document,
  104         -
    "additional_model_response_fields",
         104  +
    "additionalModelResponseFields",
  105    105   
    4,
  106    106   
);
  107    107   
static CONVERSEOUTPUT_MEMBER_TRACE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  108    108   
    ::aws_smithy_schema::ShapeId::from_static(
  109    109   
        "com.amazonaws.bedrockruntime.synthetic#ConverseOutput$trace",
  110    110   
        "com.amazonaws.bedrockruntime.synthetic",
  111    111   
        "ConverseOutput",
  112    112   
    ),
  113    113   
    ::aws_smithy_schema::ShapeType::Structure,
  114    114   
    "trace",
  115    115   
    5,
  116    116   
);
  117    117   
static CONVERSEOUTPUT_MEMBER_PERFORMANCE_CONFIG: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  118    118   
    ::aws_smithy_schema::ShapeId::from_static(
  119    119   
        "com.amazonaws.bedrockruntime.synthetic#ConverseOutput$performanceConfig",
  120    120   
        "com.amazonaws.bedrockruntime.synthetic",
  121    121   
        "ConverseOutput",
  122    122   
    ),
  123    123   
    ::aws_smithy_schema::ShapeType::Structure,
  124         -
    "performance_config",
         124  +
    "performanceConfig",
  125    125   
    6,
  126    126   
);
         127  +
static CONVERSEOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         128  +
    ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
         129  +
    ::aws_smithy_schema::ShapeType::String,
         130  +
    "request_id",
         131  +
    7,
         132  +
)
         133  +
.with_http_header("x-amzn-requestid");
  127    134   
static CONVERSEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  128    135   
    CONVERSEOUTPUT_SCHEMA_ID,
  129    136   
    ::aws_smithy_schema::ShapeType::Structure,
  130    137   
    &[
  131    138   
        &CONVERSEOUTPUT_MEMBER_OUTPUT,
  132    139   
        &CONVERSEOUTPUT_MEMBER_STOP_REASON,
  133    140   
        &CONVERSEOUTPUT_MEMBER_USAGE,
  134    141   
        &CONVERSEOUTPUT_MEMBER_METRICS,
  135    142   
        &CONVERSEOUTPUT_MEMBER_ADDITIONAL_MODEL_RESPONSE_FIELDS,
  136    143   
        &CONVERSEOUTPUT_MEMBER_TRACE,
  137    144   
        &CONVERSEOUTPUT_MEMBER_PERFORMANCE_CONFIG,
         145  +
        &CONVERSEOUTPUT_MEMBER__REQUEST_ID,
  138    146   
    ],
  139    147   
);
  140    148   
impl ConverseOutput {
  141    149   
    /// The schema for this shape.
  142    150   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CONVERSEOUTPUT_SCHEMA;
  143    151   
}
  144    152   
impl ::aws_smithy_schema::serde::SerializableStruct for ConverseOutput {
  145    153   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  146    154   
    fn serialize_members(
  147    155   
        &self,
  148    156   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  149    157   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  150    158   
        if let Some(ref val) = self.output {
  151         -
            ser.write_null(&CONVERSEOUTPUT_MEMBER_OUTPUT)?;
         159  +
            ser.write_struct(&CONVERSEOUTPUT_MEMBER_OUTPUT, val)?;
  152    160   
        }
  153    161   
        {
  154    162   
            let val = &self.stop_reason;
  155    163   
            ser.write_string(&CONVERSEOUTPUT_MEMBER_STOP_REASON, val.as_str())?;
  156    164   
        }
  157    165   
        if let Some(ref val) = self.usage {
  158    166   
            ser.write_struct(&CONVERSEOUTPUT_MEMBER_USAGE, val)?;
  159    167   
        }
  160    168   
        if let Some(ref val) = self.metrics {
  161    169   
            ser.write_struct(&CONVERSEOUTPUT_MEMBER_METRICS, val)?;
  162    170   
        }
  163    171   
        if let Some(ref val) = self.additional_model_response_fields {
  164    172   
            ser.write_document(&CONVERSEOUTPUT_MEMBER_ADDITIONAL_MODEL_RESPONSE_FIELDS, val)?;
  165    173   
        }
  166    174   
        if let Some(ref val) = self.trace {
  167    175   
            ser.write_struct(&CONVERSEOUTPUT_MEMBER_TRACE, val)?;
  168    176   
        }
  169    177   
        if let Some(ref val) = self.performance_config {
  170    178   
            ser.write_struct(&CONVERSEOUTPUT_MEMBER_PERFORMANCE_CONFIG, val)?;
  171    179   
        }
  172    180   
        Ok(())
  173    181   
    }
  174    182   
}
  175    183   
impl ConverseOutput {
  176    184   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  177         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  178         -
        deserializer: &mut D,
         185  +
    pub fn deserialize(
         186  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         187  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         188  +
        #[allow(unused_variables, unused_mut)]
         189  +
        let mut builder = Self::builder();
         190  +
        #[allow(
         191  +
            unused_variables,
         192  +
            unreachable_code,
         193  +
            clippy::single_match,
         194  +
            clippy::match_single_binding,
         195  +
            clippy::diverging_sub_expression
         196  +
        )]
         197  +
        deserializer.read_struct(&CONVERSEOUTPUT_SCHEMA, &mut |member, deser| {
         198  +
            match member.member_index() {
         199  +
                Some(0) => {
         200  +
                    builder.output = Some(crate::types::ConverseOutput::deserialize(deser)?);
         201  +
                }
         202  +
                Some(1) => {
         203  +
                    builder.stop_reason = Some(crate::types::StopReason::from(deser.read_string(member)?.as_str()));
         204  +
                }
         205  +
                Some(2) => {
         206  +
                    builder.usage = Some(crate::types::TokenUsage::deserialize(deser)?);
         207  +
                }
         208  +
                Some(3) => {
         209  +
                    builder.metrics = Some(crate::types::ConverseMetrics::deserialize(deser)?);
         210  +
                }
         211  +
                Some(4) => {
         212  +
                    builder.additional_model_response_fields = Some(deser.read_document(member)?);
         213  +
                }
         214  +
                Some(5) => {
         215  +
                    builder.trace = Some(crate::types::ConverseTrace::deserialize(deser)?);
         216  +
                }
         217  +
                Some(6) => {
         218  +
                    builder.performance_config = Some(crate::types::PerformanceConfiguration::deserialize(deser)?);
         219  +
                }
         220  +
                Some(7) => {
         221  +
                    builder._request_id = Some(deser.read_string(member)?);
         222  +
                }
         223  +
                _ => {}
         224  +
            }
         225  +
            Ok(())
         226  +
        })?;
         227  +
        builder
         228  +
            .build()
         229  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
         230  +
    }
         231  +
}
         232  +
impl ConverseOutput {
         233  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         234  +
    /// Header-bound members are read directly from headers, avoiding runtime
         235  +
    /// member iteration overhead. Body members are read via the deserializer.
         236  +
    pub fn deserialize_with_response(
         237  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         238  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         239  +
        _status: u16,
         240  +
        _body: &[u8],
  179    241   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  180    242   
        #[allow(unused_variables, unused_mut)]
  181    243   
        let mut builder = Self::builder();
         244  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         245  +
            builder._request_id = Some(val.to_string());
         246  +
        }
  182    247   
        #[allow(
  183    248   
            unused_variables,
  184    249   
            unreachable_code,
  185    250   
            clippy::single_match,
  186    251   
            clippy::match_single_binding,
  187    252   
            clippy::diverging_sub_expression
  188    253   
        )]
  189         -
        deserializer.read_struct(&CONVERSEOUTPUT_SCHEMA, (), |_, member, deser| {
         254  +
        deserializer.read_struct(&CONVERSEOUTPUT_SCHEMA, &mut |member, deser| {
  190    255   
            match member.member_index() {
  191    256   
                Some(0) => {
  192         -
                    builder.output = Some({
  193         -
                        let _ = member;
  194         -
                        todo!("deserialize aggregate")
  195         -
                    });
         257  +
                    builder.output = Some(crate::types::ConverseOutput::deserialize(deser)?);
  196    258   
                }
  197    259   
                Some(1) => {
  198    260   
                    builder.stop_reason = Some(crate::types::StopReason::from(deser.read_string(member)?.as_str()));
  199    261   
                }
  200    262   
                Some(2) => {
  201    263   
                    builder.usage = Some(crate::types::TokenUsage::deserialize(deser)?);
  202    264   
                }
  203    265   
                Some(3) => {
  204    266   
                    builder.metrics = Some(crate::types::ConverseMetrics::deserialize(deser)?);
  205    267   
                }

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/converse_stream/_converse_stream_input.rs

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/converse_stream/_converse_stream_output.rs

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

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/count_tokens/_count_tokens_input.rs

@@ -17,17 +148,158 @@
   37     37   
    "com.amazonaws.bedrockruntime.synthetic",
   38     38   
    "CountTokensInput",
   39     39   
);
   40     40   
static COUNTTOKENSINPUT_MEMBER_MODEL_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   41     41   
    ::aws_smithy_schema::ShapeId::from_static(
   42     42   
        "com.amazonaws.bedrockruntime.synthetic#CountTokensInput$modelId",
   43     43   
        "com.amazonaws.bedrockruntime.synthetic",
   44     44   
        "CountTokensInput",
   45     45   
    ),
   46     46   
    ::aws_smithy_schema::ShapeType::String,
   47         -
    "model_id",
          47  +
    "modelId",
   48     48   
    0,
   49     49   
)
   50     50   
.with_http_label();
   51     51   
static COUNTTOKENSINPUT_MEMBER_INPUT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   52     52   
    ::aws_smithy_schema::ShapeId::from_static(
   53     53   
        "com.amazonaws.bedrockruntime.synthetic#CountTokensInput$input",
   54     54   
        "com.amazonaws.bedrockruntime.synthetic",
   55     55   
        "CountTokensInput",
   56     56   
    ),
   57     57   
    ::aws_smithy_schema::ShapeType::Union,
   58     58   
    "input",
   59     59   
    1,
   60     60   
);
   61     61   
static COUNTTOKENSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   62     62   
    COUNTTOKENSINPUT_SCHEMA_ID,
   63     63   
    ::aws_smithy_schema::ShapeType::Structure,
   64     64   
    &[&COUNTTOKENSINPUT_MEMBER_MODEL_ID, &COUNTTOKENSINPUT_MEMBER_INPUT],
   65         -
);
          65  +
)
          66  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/model/{modelId}/count-tokens", None));
   66     67   
impl CountTokensInput {
   67     68   
    /// The schema for this shape.
   68     69   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &COUNTTOKENSINPUT_SCHEMA;
   69     70   
}
   70     71   
impl ::aws_smithy_schema::serde::SerializableStruct for CountTokensInput {
   71     72   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   72     73   
    fn serialize_members(
   73     74   
        &self,
   74     75   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   75     76   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   76     77   
        if let Some(ref val) = self.model_id {
   77     78   
            ser.write_string(&COUNTTOKENSINPUT_MEMBER_MODEL_ID, val)?;
   78     79   
        }
   79     80   
        if let Some(ref val) = self.input {
   80         -
            ser.write_null(&COUNTTOKENSINPUT_MEMBER_INPUT)?;
          81  +
            ser.write_struct(&COUNTTOKENSINPUT_MEMBER_INPUT, val)?;
   81     82   
        }
   82     83   
        Ok(())
   83     84   
    }
   84     85   
}
   85     86   
impl CountTokensInput {
   86     87   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   87         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   88         -
        deserializer: &mut D,
          88  +
    pub fn deserialize(
          89  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   89     90   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   90     91   
        #[allow(unused_variables, unused_mut)]
   91     92   
        let mut builder = Self::builder();
   92     93   
        #[allow(
   93     94   
            unused_variables,
   94     95   
            unreachable_code,
   95     96   
            clippy::single_match,
   96     97   
            clippy::match_single_binding,
   97     98   
            clippy::diverging_sub_expression
   98     99   
        )]
   99         -
        deserializer.read_struct(&COUNTTOKENSINPUT_SCHEMA, (), |_, member, deser| {
         100  +
        deserializer.read_struct(&COUNTTOKENSINPUT_SCHEMA, &mut |member, deser| {
  100    101   
            match member.member_index() {
  101    102   
                Some(0) => {
  102    103   
                    builder.model_id = Some(deser.read_string(member)?);
  103    104   
                }
  104    105   
                Some(1) => {
  105         -
                    builder.input = Some({
  106         -
                        let _ = member;
  107         -
                        todo!("deserialize aggregate")
  108         -
                    });
         106  +
                    builder.input = Some(crate::types::CountTokensInput::deserialize(deser)?);
  109    107   
                }
  110    108   
                _ => {}
  111    109   
            }
  112    110   
            Ok(())
  113    111   
        })?;
         112  +
        builder.model_id = builder.model_id.or(Some(String::new()));
  114    113   
        builder
  115    114   
            .build()
  116    115   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  117    116   
    }
  118    117   
}
         118  +
impl CountTokensInput {
         119  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         120  +
    pub fn deserialize_with_response(
         121  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         122  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         123  +
        _status: u16,
         124  +
        _body: &[u8],
         125  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         126  +
        Self::deserialize(deserializer)
         127  +
    }
         128  +
}
  119    129   
impl CountTokensInput {
  120    130   
    /// Creates a new builder-style object to manufacture [`CountTokensInput`](crate::operation::count_tokens::CountTokensInput).
  121    131   
    pub fn builder() -> crate::operation::count_tokens::builders::CountTokensInputBuilder {
  122    132   
        crate::operation::count_tokens::builders::CountTokensInputBuilder::default()
  123    133   
    }
  124    134   
}
  125    135   
  126    136   
/// A builder for [`CountTokensInput`](crate::operation::count_tokens::CountTokensInput).
  127    137   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  128    138   
#[non_exhaustive]

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/count_tokens/_count_tokens_output.rs

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/get_async_invoke.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 `GetAsyncInvoke`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct GetAsyncInvoke;
    6      6   
impl GetAsyncInvoke {
    7      7   
    /// Creates a new `GetAsyncInvoke`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::get_async_invoke::GetAsyncInvokeInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::get_async_invoke::GetAsyncInvokeOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::get_async_invoke::GetAsyncInvokeInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::get_async_invoke::GetAsyncInvokeOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::get_async_invoke::GetAsyncInvokeError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -119,123 +248,359 @@
  139    143   
                crate::operation::get_async_invoke::GetAsyncInvokeError,
  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 GetAsyncInvokeResponseDeserializer;
  148    152   
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetAsyncInvokeResponseDeserializer {
  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_get_async_invoke::de_get_async_invoke_http_error(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::get_async_invoke::GetAsyncInvokeError::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::get_async_invoke::GetAsyncInvokeError::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::get_async_invoke::GetAsyncInvokeError::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  +
                "ThrottlingException" => crate::operation::get_async_invoke::GetAsyncInvokeError::ThrottlingException({
         235  +
                    let mut tmp = match protocol
         236  +
                        .deserialize_response(response, crate::types::error::ThrottlingException::SCHEMA, _cfg)
         237  +
                        .and_then(|mut deser| {
         238  +
                            crate::types::error::ThrottlingException::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  +
                        }
         251  +
                    };
         252  +
                    tmp.meta = generic;
         253  +
                    if tmp.message.is_none() {
         254  +
                        tmp.message = _error_message;
         255  +
                    }
         256  +
                    tmp
         257  +
                }),
         258  +
                "ValidationException" => crate::operation::get_async_invoke::GetAsyncInvokeError::ValidationException({
         259  +
                    let mut tmp = match protocol
         260  +
                        .deserialize_response(response, crate::types::error::ValidationException::SCHEMA, _cfg)
         261  +
                        .and_then(|mut deser| {
         262  +
                            crate::types::error::ValidationException::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  +
                _ => crate::operation::get_async_invoke::GetAsyncInvokeError::generic(generic),
         283  +
            };
         284  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         285  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         286  +
            ))
  161    287   
        } else {
  162         -
            crate::protocol_serde::shape_get_async_invoke::de_get_async_invoke_http_response(status, headers, body)
  163         -
        };
  164         -
        crate::protocol_serde::type_erase_result(parse_result)
         288  +
            let protocol = _cfg
         289  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         290  +
                .expect("a SharedClientProtocol is required");
         291  +
            let mut deser = protocol
         292  +
                .deserialize_response(response, GetAsyncInvoke::OUTPUT_SCHEMA, _cfg)
         293  +
                .map_err(|e| {
         294  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         295  +
                })?;
         296  +
            let body = response.body().bytes().expect("body loaded");
         297  +
            let output = crate::operation::get_async_invoke::GetAsyncInvokeOutput::deserialize_with_response(
         298  +
                &mut *deser,
         299  +
                response.headers(),
         300  +
                response.status().into(),
         301  +
                body,
         302  +
            )
         303  +
            .map_err(|e| {
         304  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         305  +
            })?;
         306  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         307  +
        }
  165    308   
    }
  166    309   
}
  167    310   
#[derive(Debug)]
  168    311   
struct GetAsyncInvokeRequestSerializer;
  169    312   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetAsyncInvokeRequestSerializer {
  170    313   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  171    314   
    fn serialize_input(
  172    315   
        &self,
  173    316   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  174    317   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  175    318   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  176    319   
        let input = input
  177    320   
            .downcast::<crate::operation::get_async_invoke::GetAsyncInvokeInput>()
  178    321   
            .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::get_async_invoke::GetAsyncInvokeInput,
  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.invocation_arn;
  191         -
                let input_1 = input_1
  192         -
                    .as_ref()
  193         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("invocation_arn", "cannot be empty or unset"))?;
  194         -
                let invocation_arn = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
  195         -
                if invocation_arn.is_empty() {
  196         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  197         -
                        "invocation_arn",
  198         -
                        "cannot be empty or unset",
  199         -
                    ));
  200         -
                }
  201         -
                ::std::write!(output, "/async-invoke/{invocationArn}", invocationArn = invocation_arn).expect("formatting should succeed");
  202         -
                ::std::result::Result::Ok(())
  203         -
            }
  204         -
            #[allow(clippy::unnecessary_wraps)]
  205         -
            fn update_http_builder(
  206         -
                input: &crate::operation::get_async_invoke::GetAsyncInvokeInput,
  207         -
                builder: ::http_1x::request::Builder,
  208         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  209         -
                let mut uri = ::std::string::String::new();
  210         -
                uri_base(input, &mut uri)?;
  211         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  212         -
            }
  213         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  214         -
            builder
  215         -
        };
  216         -
        let body = ::aws_smithy_types::body::SdkBody::from("");
         322  +
        let protocol = _cfg
         323  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         324  +
            .expect("a SharedClientProtocol is required");
         325  +
        let mut request = protocol
         326  +
            .serialize_request(&input, GetAsyncInvoke::INPUT_SCHEMA, "", _cfg)
         327  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  217    328   
  218         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         329  +
        return ::std::result::Result::Ok(request);
  219    330   
    }
  220    331   
}
  221    332   
#[derive(Debug)]
  222    333   
struct GetAsyncInvokeEndpointParamsInterceptor;
  223    334   
  224    335   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetAsyncInvokeEndpointParamsInterceptor {
  225    336   
    fn name(&self) -> &'static str {
  226    337   
        "GetAsyncInvokeEndpointParamsInterceptor"
  227    338   
    }
  228    339