AWS SDK

AWS SDK

rev. 32b1b3c3761061baed26023be3219639e42d7d12 (ignoring whitespace)

Files changed:

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/start_async_invoke/_start_async_invoke_input.rs

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/operation/start_async_invoke/_start_async_invoke_output.rs

@@ -1,1 +98,145 @@
   19     19   
    "com.amazonaws.bedrockruntime.synthetic",
   20     20   
    "StartAsyncInvokeOutput",
   21     21   
);
   22     22   
static STARTASYNCINVOKEOUTPUT_MEMBER_INVOCATION_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   23     23   
    ::aws_smithy_schema::ShapeId::from_static(
   24     24   
        "com.amazonaws.bedrockruntime.synthetic#StartAsyncInvokeOutput$invocationArn",
   25     25   
        "com.amazonaws.bedrockruntime.synthetic",
   26     26   
        "StartAsyncInvokeOutput",
   27     27   
    ),
   28     28   
    ::aws_smithy_schema::ShapeType::String,
   29         -
    "invocation_arn",
          29  +
    "invocationArn",
   30     30   
    0,
   31     31   
);
          32  +
static STARTASYNCINVOKEOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          33  +
    ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
          34  +
    ::aws_smithy_schema::ShapeType::String,
          35  +
    "request_id",
          36  +
    1,
          37  +
)
          38  +
.with_http_header("x-amzn-requestid");
   32     39   
static STARTASYNCINVOKEOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   33     40   
    STARTASYNCINVOKEOUTPUT_SCHEMA_ID,
   34     41   
    ::aws_smithy_schema::ShapeType::Structure,
   35         -
    &[&STARTASYNCINVOKEOUTPUT_MEMBER_INVOCATION_ARN],
          42  +
    &[&STARTASYNCINVOKEOUTPUT_MEMBER_INVOCATION_ARN, &STARTASYNCINVOKEOUTPUT_MEMBER__REQUEST_ID],
   36     43   
);
   37     44   
impl StartAsyncInvokeOutput {
   38     45   
    /// The schema for this shape.
   39     46   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STARTASYNCINVOKEOUTPUT_SCHEMA;
   40     47   
}
   41     48   
impl ::aws_smithy_schema::serde::SerializableStruct for StartAsyncInvokeOutput {
   42     49   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   43     50   
    fn serialize_members(
   44     51   
        &self,
   45     52   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   46     53   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   47     54   
        {
   48     55   
            let val = &self.invocation_arn;
   49     56   
            ser.write_string(&STARTASYNCINVOKEOUTPUT_MEMBER_INVOCATION_ARN, val)?;
   50     57   
        }
   51     58   
        Ok(())
   52     59   
    }
   53     60   
}
   54     61   
impl StartAsyncInvokeOutput {
   55     62   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   56         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   57         -
        deserializer: &mut D,
          63  +
    pub fn deserialize(
          64  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          65  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          66  +
        #[allow(unused_variables, unused_mut)]
          67  +
        let mut builder = Self::builder();
          68  +
        #[allow(
          69  +
            unused_variables,
          70  +
            unreachable_code,
          71  +
            clippy::single_match,
          72  +
            clippy::match_single_binding,
          73  +
            clippy::diverging_sub_expression
          74  +
        )]
          75  +
        deserializer.read_struct(&STARTASYNCINVOKEOUTPUT_SCHEMA, &mut |member, deser| {
          76  +
            match member.member_index() {
          77  +
                Some(0) => {
          78  +
                    builder.invocation_arn = Some(deser.read_string(member)?);
          79  +
                }
          80  +
                Some(1) => {
          81  +
                    builder._request_id = Some(deser.read_string(member)?);
          82  +
                }
          83  +
                _ => {}
          84  +
            }
          85  +
            Ok(())
          86  +
        })?;
          87  +
        builder.invocation_arn = builder.invocation_arn.or(Some(String::new()));
          88  +
        builder
          89  +
            .build()
          90  +
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
          91  +
    }
          92  +
}
          93  +
impl StartAsyncInvokeOutput {
          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],
   58    102   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   59    103   
        #[allow(unused_variables, unused_mut)]
   60    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  +
        }
   61    108   
        #[allow(
   62    109   
            unused_variables,
   63    110   
            unreachable_code,
   64    111   
            clippy::single_match,
   65    112   
            clippy::match_single_binding,
   66    113   
            clippy::diverging_sub_expression
   67    114   
        )]
   68         -
        deserializer.read_struct(&STARTASYNCINVOKEOUTPUT_SCHEMA, (), |_, member, deser| {
         115  +
        deserializer.read_struct(&STARTASYNCINVOKEOUTPUT_SCHEMA, &mut |member, deser| {
   69    116   
            match member.member_index() {
   70    117   
                Some(0) => {
   71    118   
                    builder.invocation_arn = Some(deser.read_string(member)?);
   72    119   
                }
   73    120   
                _ => {}
   74    121   
            }
   75    122   
            Ok(())
   76    123   
        })?;
   77    124   
        builder
   78    125   
            .build()

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

@@ -1,1 +386,222 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn parse_http_error_metadata(
           3  +
    _response_status: u16,
           4  +
    response_headers: &::aws_smithy_runtime_api::http::Headers,
           5  +
    response_body: &[u8],
           6  +
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
           7  +
    crate::json_errors::parse_error_metadata(response_body, response_headers)
           8  +
}
           9  +
    2     10   
pub(crate) fn type_erase_result<O, E>(
    3     11   
    result: ::std::result::Result<O, E>,
    4     12   
) -> ::std::result::Result<
    5     13   
    ::aws_smithy_runtime_api::client::interceptors::context::Output,
    6     14   
    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>,
    7     15   
>
    8     16   
where
    9     17   
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10     18   
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11     19   
{
   12     20   
    result
   13     21   
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14     22   
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15     23   
        .map_err(::std::convert::Into::into)
   16     24   
}
   17     25   
   18         -
pub fn parse_http_error_metadata(
   19         -
    _response_status: u16,
   20         -
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21         -
    response_body: &[u8],
   22         -
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23         -
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   24         -
}
   25         -
   26         -
pub(crate) mod shape_apply_guardrail;
   27         -
   28         -
pub(crate) mod shape_converse;
   29         -
   30     26   
pub(crate) mod shape_converse_stream;
   31     27   
   32         -
pub(crate) mod shape_count_tokens;
   33         -
   34         -
pub(crate) mod shape_get_async_invoke;
          28  +
pub(crate) mod shape_invoke_model_with_bidirectional_stream;
   35     29   
   36         -
pub(crate) mod shape_invoke_model;
          30  +
pub(crate) mod shape_invoke_model_with_response_stream;
   37     31   
   38         -
pub(crate) mod shape_invoke_model_input;
          32  +
pub(crate) mod shape_converse_stream_output;
   39     33   
   40         -
pub(crate) mod shape_invoke_model_with_bidirectional_stream;
          34  +
pub(crate) mod shape_invoke_model_with_bidirectional_stream_input;
   41     35   
   42         -
pub(crate) mod shape_invoke_model_with_response_stream;
          36  +
pub(crate) mod shape_invoke_model_with_bidirectional_stream_output;
   43     37   
   44         -
pub(crate) mod shape_invoke_model_with_response_stream_input;
          38  +
pub(crate) mod shape_invoke_model_with_response_stream_output;
   45     39   
   46         -
pub(crate) mod shape_list_async_invokes;
          40  +
pub fn parse_event_stream_error_metadata(
          41  +
    payload: &::bytes::Bytes,
          42  +
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
          43  +
    crate::json_errors::parse_error_metadata(payload, &::aws_smithy_runtime_api::http::Headers::new())
          44  +
}
   47     45   
   48         -
pub(crate) mod shape_start_async_invoke;
          46  +
pub(crate) mod shape_bidirectional_input_payload_part;
   49     47   
   50     48   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   51     49   
    if data.is_empty() {
   52     50   
        b"{}"
   53     51   
    } else {
   54     52   
        data
   55     53   
    }
   56     54   
}
   57     55   
   58         -
pub(crate) mod shape_access_denied_exception;
   59         -
   60         -
pub(crate) mod shape_apply_guardrail_input;
   61         -
   62         -
pub(crate) mod shape_conflict_exception;
          56  +
pub(crate) mod shape_bidirectional_output_payload_part;
   63     57   
   64         -
pub(crate) mod shape_converse_input;
          58  +
pub(crate) mod shape_content_block_delta_event;
   65     59   
   66         -
pub(crate) mod shape_converse_stream_input;
          60  +
pub(crate) mod shape_content_block_start_event;
   67     61   
   68         -
pub(crate) mod shape_converse_stream_output;
          62  +
pub(crate) mod shape_content_block_stop_event;
   69     63   
   70         -
pub(crate) mod shape_count_tokens_input;
          64  +
pub(crate) mod shape_converse_stream_metadata_event;
   71     65   
   72     66   
pub(crate) mod shape_internal_server_exception;
   73     67   
   74         -
pub(crate) mod shape_invoke_model_output;
   75         -
   76         -
pub(crate) mod shape_invoke_model_with_bidirectional_stream_input;
   77         -
   78         -
pub(crate) mod shape_invoke_model_with_bidirectional_stream_output;
   79         -
   80         -
pub(crate) mod shape_invoke_model_with_response_stream_output;
   81         -
   82         -
pub(crate) mod shape_model_error_exception;
          68  +
pub(crate) mod shape_message_start_event;
   83     69   
   84         -
pub(crate) mod shape_model_not_ready_exception;
          70  +
pub(crate) mod shape_message_stop_event;
   85     71   
   86     72   
pub(crate) mod shape_model_stream_error_exception;
   87     73   
   88     74   
pub(crate) mod shape_model_timeout_exception;
   89     75   
   90         -
pub(crate) mod shape_resource_not_found_exception;
   91         -
   92         -
pub(crate) mod shape_service_quota_exceeded_exception;
          76  +
pub(crate) mod shape_payload_part;
   93     77   
   94     78   
pub(crate) mod shape_service_unavailable_exception;
   95     79   
   96         -
pub(crate) mod shape_start_async_invoke_input;
   97         -
   98     80   
pub(crate) mod shape_throttling_exception;
   99     81   
  100     82   
pub(crate) mod shape_validation_exception;
  101     83   
  102         -
pub fn parse_event_stream_error_metadata(
  103         -
    payload: &::bytes::Bytes,
  104         -
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
  105         -
    crate::json_errors::parse_error_metadata(payload, &::aws_smithy_runtime_api::http::Headers::new())
  106         -
}
  107         -
  108         -
pub(crate) mod shape_async_invoke_output_data_config;
  109         -
  110         -
pub(crate) mod shape_async_invoke_summaries;
  111         -
  112         -
pub(crate) mod shape_bidirectional_input_payload_part;
  113         -
  114         -
pub(crate) mod shape_converse_metrics;
  115         -
  116         -
pub(crate) mod shape_converse_output;
  117         -
  118         -
pub(crate) mod shape_converse_trace;
  119         -
  120         -
pub(crate) mod shape_guardrail_assessment_list;
  121         -
  122         -
pub(crate) mod shape_guardrail_configuration;
  123         -
  124         -
pub(crate) mod shape_guardrail_content_block;
  125         -
  126         -
pub(crate) mod shape_guardrail_coverage;
  127         -
  128         -
pub(crate) mod shape_guardrail_output_content_list;
  129         -
  130         -
pub(crate) mod shape_guardrail_stream_configuration;
          84  +
pub(crate) mod shape_content_block_delta;
  131     85   
  132         -
pub(crate) mod shape_guardrail_usage;
          86  +
pub(crate) mod shape_content_block_start;
  133     87   
  134         -
pub(crate) mod shape_inference_configuration;
          88  +
pub(crate) mod shape_converse_stream_metrics;
  135     89   
  136         -
pub(crate) mod shape_message;
          90  +
pub(crate) mod shape_converse_stream_trace;
  137     91   
  138     92   
pub(crate) mod shape_performance_configuration;
  139     93   
  140         -
pub(crate) mod shape_prompt_variable_values;
  141         -
  142         -
pub(crate) mod shape_system_content_block;
  143         -
  144         -
pub(crate) mod shape_tag;
  145         -
  146     94   
pub(crate) mod shape_token_usage;
  147     95   
  148         -
pub(crate) mod shape_tool_configuration;
  149         -
  150         -
pub(crate) mod shape_async_invoke_s3_output_data_config;
  151         -
  152         -
pub(crate) mod shape_async_invoke_summary;
  153         -
  154         -
pub(crate) mod shape_bidirectional_output_payload_part;
  155         -
  156         -
pub(crate) mod shape_cache_point_block;
  157         -
  158         -
pub(crate) mod shape_content_block;
  159         -
  160         -
pub(crate) mod shape_content_block_delta_event;
  161         -
  162         -
pub(crate) mod shape_content_block_start_event;
  163         -
  164         -
pub(crate) mod shape_content_block_stop_event;
  165         -
  166         -
pub(crate) mod shape_converse_stream_metadata_event;
  167         -
  168         -
pub(crate) mod shape_converse_tokens_request;
  169         -
  170         -
pub(crate) mod shape_guardrail_assessment;
  171         -
  172         -
pub(crate) mod shape_guardrail_converse_content_block;
  173         -
  174         -
pub(crate) mod shape_guardrail_image_block;
  175         -
  176         -
pub(crate) mod shape_guardrail_image_coverage;
  177         -
  178         -
pub(crate) mod shape_guardrail_output_content;
  179         -
  180         -
pub(crate) mod shape_guardrail_text_block;
  181         -
  182         -
pub(crate) mod shape_guardrail_text_characters_coverage;
          96  +
pub(crate) mod shape_citations_delta;
  183     97   
  184     98   
pub(crate) mod shape_guardrail_trace_assessment;
  185     99   
  186         -
pub(crate) mod shape_invoke_model_tokens_request;
         100  +
pub(crate) mod shape_prompt_router_trace;
         101  +
         102  +
pub(crate) mod shape_reasoning_content_block_delta;
  187    103   
  188         -
pub(crate) mod shape_message_start_event;
         104  +
pub(crate) mod shape_tool_use_block_delta;
  189    105   
  190         -
pub(crate) mod shape_message_stop_event;
         106  +
pub(crate) mod shape_tool_use_block_start;
  191    107   
  192         -
pub(crate) mod shape_payload_part;
         108  +
pub(crate) mod shape_citation_location;
  193    109   
  194         -
pub(crate) mod shape_prompt_router_trace;
         110  +
pub(crate) mod shape_citation_source_content_list_delta;
  195    111   
  196         -
pub(crate) mod shape_tool;
         112  +
pub(crate) mod shape_guardrail_assessment_list_map;
  197    113   
  198         -
pub(crate) mod shape_tool_choice;
         114  +
pub(crate) mod shape_guardrail_assessment_map;
  199    115   
  200         -
pub(crate) mod shape_any_tool_choice;
         116  +
pub(crate) mod shape_model_outputs;
  201    117   
  202         -
pub(crate) mod shape_auto_tool_choice;
         118  +
pub(crate) mod shape_citation_source_content_delta;
  203    119   
  204         -
pub(crate) mod shape_citations_content_block;
         120  +
pub(crate) mod shape_document_char_location;
  205    121   
  206         -
pub(crate) mod shape_content_blocks;
         122  +
pub(crate) mod shape_document_chunk_location;
  207    123   
  208         -
pub(crate) mod shape_document_block;
         124  +
pub(crate) mod shape_document_page_location;
  209    125   
  210         -
pub(crate) mod shape_guardrail_assessment_list_map;
         126  +
pub(crate) mod shape_guardrail_assessment;
  211    127   
  212         -
pub(crate) mod shape_guardrail_assessment_map;
         128  +
pub(crate) mod shape_guardrail_assessment_list;
  213    129   
  214    130   
pub(crate) mod shape_guardrail_automated_reasoning_policy_assessment;
  215    131   
  216    132   
pub(crate) mod shape_guardrail_content_policy_assessment;
  217    133   
  218    134   
pub(crate) mod shape_guardrail_contextual_grounding_policy_assessment;
  219    135   
  220         -
pub(crate) mod shape_guardrail_converse_image_block;
  221         -
  222         -
pub(crate) mod shape_guardrail_converse_text_block;
  223         -
  224         -
pub(crate) mod shape_guardrail_image_source;
  225         -
  226    136   
pub(crate) mod shape_guardrail_invocation_metrics;
  227    137   
  228    138   
pub(crate) mod shape_guardrail_sensitive_information_policy_assessment;
  229    139   
  230    140   
pub(crate) mod shape_guardrail_topic_policy_assessment;
  231    141   
  232    142   
pub(crate) mod shape_guardrail_word_policy_assessment;
  233    143   
  234         -
pub(crate) mod shape_image_block;
  235         -
  236         -
pub(crate) mod shape_model_outputs;
  237         -
  238         -
pub(crate) mod shape_reasoning_content_block;
  239         -
  240         -
pub(crate) mod shape_specific_tool_choice;
  241         -
  242         -
pub(crate) mod shape_tool_result_block;
  243         -
  244         -
pub(crate) mod shape_tool_specification;
  245         -
  246         -
pub(crate) mod shape_tool_use_block;
  247         -
  248         -
pub(crate) mod shape_video_block;
  249         -
  250         -
pub(crate) mod shape_citation;
  251         -
  252         -
pub(crate) mod shape_citation_generated_content;
  253         -
  254         -
pub(crate) mod shape_citations_config;
  255         -
  256         -
pub(crate) mod shape_content_block_delta;
  257         -
  258         -
pub(crate) mod shape_content_block_start;
  259         -
  260         -
pub(crate) mod shape_converse_stream_metrics;
  261         -
  262         -
pub(crate) mod shape_converse_stream_trace;
  263         -
  264         -
pub(crate) mod shape_document_source;
  265         -
  266    144   
pub(crate) mod shape_guardrail_automated_reasoning_finding_list;
  267    145   
  268    146   
pub(crate) mod shape_guardrail_content_filter_list;
  269    147   
  270    148   
pub(crate) mod shape_guardrail_contextual_grounding_filters;
  271    149   
  272         -
pub(crate) mod shape_guardrail_converse_image_source;
         150  +
pub(crate) mod shape_guardrail_coverage;
  273    151   
  274    152   
pub(crate) mod shape_guardrail_custom_word_list;
  275    153   
  276    154   
pub(crate) mod shape_guardrail_managed_word_list;
  277    155   
  278    156   
pub(crate) mod shape_guardrail_pii_entity_filter_list;
  279    157   
  280    158   
pub(crate) mod shape_guardrail_regex_filter_list;
  281    159   
  282    160   
pub(crate) mod shape_guardrail_topic_list;
  283    161   
  284         -
pub(crate) mod shape_image_source;
  285         -
  286         -
pub(crate) mod shape_reasoning_text_block;
  287         -
  288         -
pub(crate) mod shape_tool_input_schema;
  289         -
  290         -
pub(crate) mod shape_tool_result_content_block;
  291         -
  292         -
pub(crate) mod shape_video_source;
  293         -
  294         -
pub(crate) mod shape_citation_location;
  295         -
  296         -
pub(crate) mod shape_citation_source_content;
  297         -
  298         -
pub(crate) mod shape_citations_delta;
  299         -
  300         -
pub(crate) mod shape_document_content_block;
         162  +
pub(crate) mod shape_guardrail_usage;
  301    163   
  302    164   
pub(crate) mod shape_guardrail_automated_reasoning_finding;
  303    165   
  304    166   
pub(crate) mod shape_guardrail_content_filter;
  305    167   
  306    168   
pub(crate) mod shape_guardrail_contextual_grounding_filter;
  307    169   
  308    170   
pub(crate) mod shape_guardrail_custom_word;
  309    171   
         172  +
pub(crate) mod shape_guardrail_image_coverage;
         173  +
  310    174   
pub(crate) mod shape_guardrail_managed_word;
  311    175   
  312    176   
pub(crate) mod shape_guardrail_pii_entity_filter;
  313    177   
  314    178   
pub(crate) mod shape_guardrail_regex_filter;
  315    179   
  316         -
pub(crate) mod shape_guardrail_topic;
  317         -
  318         -
pub(crate) mod shape_reasoning_content_block_delta;
  319         -
  320         -
pub(crate) mod shape_s3_location;
  321         -
  322         -
pub(crate) mod shape_tool_use_block_delta;
  323         -
  324         -
pub(crate) mod shape_tool_use_block_start;
  325         -
  326         -
pub(crate) mod shape_citation_generated_content_list;
  327         -
  328         -
pub(crate) mod shape_citation_source_content_list_delta;
  329         -
  330         -
pub(crate) mod shape_citations;
  331         -
  332         -
pub(crate) mod shape_document_char_location;
  333         -
  334         -
pub(crate) mod shape_document_chunk_location;
         180  +
pub(crate) mod shape_guardrail_text_characters_coverage;
  335    181   
  336         -
pub(crate) mod shape_document_page_location;
         182  +
pub(crate) mod shape_guardrail_topic;
  337    183   
  338    184   
pub(crate) mod shape_guardrail_automated_reasoning_impossible_finding;
  339    185   
  340    186   
pub(crate) mod shape_guardrail_automated_reasoning_invalid_finding;
  341    187   
  342    188   
pub(crate) mod shape_guardrail_automated_reasoning_no_translations_finding;
  343    189   
  344    190   
pub(crate) mod shape_guardrail_automated_reasoning_satisfiable_finding;
  345    191   
  346    192   
pub(crate) mod shape_guardrail_automated_reasoning_too_complex_finding;
  347    193   
  348    194   
pub(crate) mod shape_guardrail_automated_reasoning_translation_ambiguous_finding;
  349    195   
  350    196   
pub(crate) mod shape_guardrail_automated_reasoning_valid_finding;
  351    197   
  352         -
pub(crate) mod shape_tool_result_content_blocks;
  353         -
  354         -
pub(crate) mod shape_citation_source_content_delta;
  355         -
  356         -
pub(crate) mod shape_document_content_blocks;
  357         -
  358    198   
pub(crate) mod shape_guardrail_automated_reasoning_difference_scenario_list;
  359    199   
  360    200   
pub(crate) mod shape_guardrail_automated_reasoning_logic_warning;
  361    201   
  362    202   
pub(crate) mod shape_guardrail_automated_reasoning_rule_list;
  363    203   
  364    204   
pub(crate) mod shape_guardrail_automated_reasoning_scenario;
  365    205   
  366    206   
pub(crate) mod shape_guardrail_automated_reasoning_translation;
  367    207   
  368    208   
pub(crate) mod shape_guardrail_automated_reasoning_translation_option_list;
  369    209   
  370         -
pub(crate) mod shape_guardrail_converse_content_qualifier_list;
  371         -
  372         -
pub(crate) mod shape_citation_source_content_list;
  373         -
  374    210   
pub(crate) mod shape_guardrail_automated_reasoning_input_text_reference_list;
  375    211   
  376    212   
pub(crate) mod shape_guardrail_automated_reasoning_rule;
  377    213   
  378    214   
pub(crate) mod shape_guardrail_automated_reasoning_statement_list;
  379    215   
  380    216   
pub(crate) mod shape_guardrail_automated_reasoning_translation_option;
  381    217   
  382    218   
pub(crate) mod shape_guardrail_automated_reasoning_input_text_reference;
  383    219   

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_access_denied_exception.rs

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_access_denied_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::AccessDeniedExceptionBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::AccessDeniedExceptionBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
    6         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    7         -
    let tokens = &mut tokens_owned;
    8         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
    9         -
    loop {
   10         -
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   13         -
                "message" => {
   14         -
                    builder = builder.set_message(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
   18         -
                    );
   19         -
                }
   20         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   21         -
            },
   22         -
            other => {
   23         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   24         -
                    "expected object key or end object, found: {other:?}"
   25         -
                )))
   26         -
            }
   27         -
        }
   28         -
    }
   29         -
    if tokens.next().is_some() {
   30         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   31         -
            "found more JSON tokens after completing parsing",
   32         -
        ));
   33         -
    }
   34         -
    Ok(builder)
   35         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_any_tool_choice.rs

@@ -1,0 +7,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_any_tool_choice(
    3         -
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    #[allow(unused_variables)] input: &crate::types::AnyToolChoice,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    Ok(())
    7         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_apply_guardrail.rs

@@ -1,0 +219,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_apply_guardrail_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::apply_guardrail::ApplyGuardrailOutput, crate::operation::apply_guardrail::ApplyGuardrailError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?;
   11         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "AccessDeniedException" => crate::operation::apply_guardrail::ApplyGuardrailError::AccessDeniedException({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default();
   25         -
                output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?;
   27         -
                let output = output.meta(generic);
   28         -
                output.build()
   29         -
            };
   30         -
            if tmp.message.is_none() {
   31         -
                tmp.message = _error_message;
   32         -
            }
   33         -
            tmp
   34         -
        }),
   35         -
        "InternalServerException" => crate::operation::apply_guardrail::ApplyGuardrailError::InternalServerException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?;
   42         -
                let output = output.meta(generic);
   43         -
                output.build()
   44         -
            };
   45         -
            if tmp.message.is_none() {
   46         -
                tmp.message = _error_message;
   47         -
            }
   48         -
            tmp
   49         -
        }),
   50         -
        "ResourceNotFoundException" => crate::operation::apply_guardrail::ApplyGuardrailError::ResourceNotFoundException({
   51         -
            #[allow(unused_mut)]
   52         -
            let mut tmp = {
   53         -
                #[allow(unused_mut)]
   54         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   55         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   56         -
                    .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?;
   57         -
                let output = output.meta(generic);
   58         -
                output.build()
   59         -
            };
   60         -
            if tmp.message.is_none() {
   61         -
                tmp.message = _error_message;
   62         -
            }
   63         -
            tmp
   64         -
        }),
   65         -
        "ServiceQuotaExceededException" => crate::operation::apply_guardrail::ApplyGuardrailError::ServiceQuotaExceededException({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default();
   70         -
                output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
   71         -
                    _response_body,
   72         -
                    output,
   73         -
                )
   74         -
                .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?;
   75         -
                let output = output.meta(generic);
   76         -
                output.build()
   77         -
            };
   78         -
            if tmp.message.is_none() {
   79         -
                tmp.message = _error_message;
   80         -
            }
   81         -
            tmp
   82         -
        }),
   83         -
        "ServiceUnavailableException" => crate::operation::apply_guardrail::ApplyGuardrailError::ServiceUnavailableException({
   84         -
            #[allow(unused_mut)]
   85         -
            let mut tmp = {
   86         -
                #[allow(unused_mut)]
   87         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   88         -
                output =
   89         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   90         -
                        .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?;
   91         -
                let output = output.meta(generic);
   92         -
                output.build()
   93         -
            };
   94         -
            if tmp.message.is_none() {
   95         -
                tmp.message = _error_message;
   96         -
            }
   97         -
            tmp
   98         -
        }),
   99         -
        "ThrottlingException" => crate::operation::apply_guardrail::ApplyGuardrailError::ThrottlingException({
  100         -
            #[allow(unused_mut)]
  101         -
            let mut tmp = {
  102         -
                #[allow(unused_mut)]
  103         -
                let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
  104         -
                output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
  105         -
                    .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?;
  106         -
                let output = output.meta(generic);
  107         -
                output.build()
  108         -
            };
  109         -
            if tmp.message.is_none() {
  110         -
                tmp.message = _error_message;
  111         -
            }
  112         -
            tmp
  113         -
        }),
  114         -
        "ValidationException" => crate::operation::apply_guardrail::ApplyGuardrailError::ValidationException({
  115         -
            #[allow(unused_mut)]
  116         -
            let mut tmp = {
  117         -
                #[allow(unused_mut)]
  118         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
  119         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
  120         -
                    .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?;
  121         -
                let output = output.meta(generic);
  122         -
                output.build()
  123         -
            };
  124         -
            if tmp.message.is_none() {
  125         -
                tmp.message = _error_message;
  126         -
            }
  127         -
            tmp
  128         -
        }),
  129         -
        _ => crate::operation::apply_guardrail::ApplyGuardrailError::generic(generic),
  130         -
    })
  131         -
}
  132         -
  133         -
#[allow(clippy::unnecessary_wraps)]
  134         -
pub fn de_apply_guardrail_http_response(
  135         -
    _response_status: u16,
  136         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  137         -
    _response_body: &[u8],
  138         -
) -> std::result::Result<crate::operation::apply_guardrail::ApplyGuardrailOutput, crate::operation::apply_guardrail::ApplyGuardrailError> {
  139         -
    Ok({
  140         -
        #[allow(unused_mut)]
  141         -
        let mut output = crate::operation::apply_guardrail::builders::ApplyGuardrailOutputBuilder::default();
  142         -
        output = crate::protocol_serde::shape_apply_guardrail::de_apply_guardrail(_response_body, output)
  143         -
            .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?;
  144         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  145         -
        crate::serde_util::apply_guardrail_output_output_correct_errors(output)
  146         -
            .build()
  147         -
            .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?
  148         -
    })
  149         -
}
  150         -
  151         -
pub fn ser_apply_guardrail_input(
  152         -
    input: &crate::operation::apply_guardrail::ApplyGuardrailInput,
  153         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  154         -
    let mut out = String::new();
  155         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  156         -
    crate::protocol_serde::shape_apply_guardrail_input::ser_apply_guardrail_input_input(&mut object, input)?;
  157         -
    object.finish();
  158         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  159         -
}
  160         -
  161         -
pub(crate) fn de_apply_guardrail(
  162         -
    _value: &[u8],
  163         -
    mut builder: crate::operation::apply_guardrail::builders::ApplyGuardrailOutputBuilder,
  164         -
) -> ::std::result::Result<
  165         -
    crate::operation::apply_guardrail::builders::ApplyGuardrailOutputBuilder,
  166         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  167         -
> {
  168         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  169         -
    let tokens = &mut tokens_owned;
  170         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  171         -
    loop {
  172         -
        match tokens.next().transpose()? {
  173         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  174         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  175         -
                "action" => {
  176         -
                    builder = builder.set_action(
  177         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  178         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::GuardrailAction::from(u.as_ref())))
  179         -
                            .transpose()?,
  180         -
                    );
  181         -
                }
  182         -
                "actionReason" => {
  183         -
                    builder = builder.set_action_reason(
  184         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  185         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  186         -
                            .transpose()?,
  187         -
                    );
  188         -
                }
  189         -
                "assessments" => {
  190         -
                    builder = builder.set_assessments(crate::protocol_serde::shape_guardrail_assessment_list::de_guardrail_assessment_list(
  191         -
                        tokens, _value,
  192         -
                    )?);
  193         -
                }
  194         -
                "guardrailCoverage" => {
  195         -
                    builder = builder.set_guardrail_coverage(crate::protocol_serde::shape_guardrail_coverage::de_guardrail_coverage(tokens, _value)?);
  196         -
                }
  197         -
                "outputs" => {
  198         -
                    builder = builder
  199         -
                        .set_outputs(crate::protocol_serde::shape_guardrail_output_content_list::de_guardrail_output_content_list(tokens, _value)?);
  200         -
                }
  201         -
                "usage" => {
  202         -
                    builder = builder.set_usage(crate::protocol_serde::shape_guardrail_usage::de_guardrail_usage(tokens, _value)?);
  203         -
                }
  204         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  205         -
            },
  206         -
            other => {
  207         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  208         -
                    "expected object key or end object, found: {other:?}"
  209         -
                )))
  210         -
            }
  211         -
        }
  212         -
    }
  213         -
    if tokens.next().is_some() {
  214         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  215         -
            "found more JSON tokens after completing parsing",
  216         -
        ));
  217         -
    }
  218         -
    Ok(builder)
  219         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_apply_guardrail_input.rs

@@ -1,0 +25,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_apply_guardrail_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::apply_guardrail::ApplyGuardrailInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.content {
    7         -
        let mut array_2 = object.key("content").start_array();
    8         -
        for item_3 in var_1 {
    9         -
            {
   10         -
                #[allow(unused_mut)]
   11         -
                let mut object_4 = array_2.value().start_object();
   12         -
                crate::protocol_serde::shape_guardrail_content_block::ser_guardrail_content_block(&mut object_4, item_3)?;
   13         -
                object_4.finish();
   14         -
            }
   15         -
        }
   16         -
        array_2.finish();
   17         -
    }
   18         -
    if let Some(var_5) = &input.output_scope {
   19         -
        object.key("outputScope").string(var_5.as_str());
   20         -
    }
   21         -
    if let Some(var_6) = &input.source {
   22         -
        object.key("source").string(var_6.as_str());
   23         -
    }
   24         -
    Ok(())
   25         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_async_invoke_output_data_config.rs

@@ -1,0 +84,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_async_invoke_output_data_config<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::AsyncInvokeOutputDataConfig>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    let mut variant = None;
   10         -
    match tokens.next().transpose()? {
   11         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   12         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
   13         -
            match tokens.next().transpose()? {
   14         -
                Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   15         -
                Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   16         -
                    if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) =
   17         -
                        tokens.peek()
   18         -
                    {
   19         -
                        let _ = tokens.next().expect("peek returned a token")?;
   20         -
                        continue;
   21         -
                    }
   22         -
                    let key = key.to_unescaped()?;
   23         -
                    if key == "__type" {
   24         -
                        ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   25         -
                        continue;
   26         -
                    }
   27         -
                    if variant.is_some() {
   28         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29         -
                            "encountered mixed variants in union",
   30         -
                        ));
   31         -
                    }
   32         -
                    variant = match key.as_ref() {
   33         -
                        "s3OutputDataConfig" => Some(crate::types::AsyncInvokeOutputDataConfig::S3OutputDataConfig(
   34         -
                            crate::protocol_serde::shape_async_invoke_s3_output_data_config::de_async_invoke_s3_output_data_config(tokens, _value)?
   35         -
                                .ok_or_else(|| {
   36         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 's3OutputDataConfig' cannot be null")
   37         -
                            })?,
   38         -
                        )),
   39         -
                        _ => {
   40         -
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   41         -
                            Some(crate::types::AsyncInvokeOutputDataConfig::Unknown)
   42         -
                        }
   43         -
                    };
   44         -
                }
   45         -
                other => {
   46         -
                    return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   47         -
                        "expected object key or end object, found: {other:?}"
   48         -
                    )))
   49         -
                }
   50         -
            }
   51         -
        },
   52         -
        _ => {
   53         -
            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   54         -
                "expected start object or null",
   55         -
            ))
   56         -
        }
   57         -
    }
   58         -
    if variant.is_none() {
   59         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   60         -
            "Union did not contain a valid variant.",
   61         -
        ));
   62         -
    }
   63         -
    Ok(variant)
   64         -
}
   65         -
   66         -
pub fn ser_async_invoke_output_data_config(
   67         -
    object_5: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   68         -
    input: &crate::types::AsyncInvokeOutputDataConfig,
   69         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   70         -
    match input {
   71         -
        crate::types::AsyncInvokeOutputDataConfig::S3OutputDataConfig(inner) => {
   72         -
            #[allow(unused_mut)]
   73         -
            let mut object_1 = object_5.key("s3OutputDataConfig").start_object();
   74         -
            crate::protocol_serde::shape_async_invoke_s3_output_data_config::ser_async_invoke_s3_output_data_config(&mut object_1, inner)?;
   75         -
            object_1.finish();
   76         -
        }
   77         -
        crate::types::AsyncInvokeOutputDataConfig::Unknown => {
   78         -
            return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant(
   79         -
                "AsyncInvokeOutputDataConfig",
   80         -
            ))
   81         -
        }
   82         -
    }
   83         -
    Ok(())
   84         -
}