AWS SDK

AWS SDK

rev. 5673a7a38b4a4a6973351c005d572863803729fe (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,189 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::start_async_invoke::_start_async_invoke_output::StartAsyncInvokeOutputBuilder;
           3  +
           4  +
pub use crate::operation::start_async_invoke::_start_async_invoke_input::StartAsyncInvokeInputBuilder;
           5  +
           6  +
impl crate::operation::start_async_invoke::builders::StartAsyncInvokeInputBuilder {
           7  +
    /// Sends a request with this input using the given client.
           8  +
    pub async fn send_with(
           9  +
        self,
          10  +
        client: &crate::Client,
          11  +
    ) -> ::std::result::Result<
          12  +
        crate::operation::start_async_invoke::StartAsyncInvokeOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::start_async_invoke::StartAsyncInvokeError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.start_async_invoke();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `StartAsyncInvoke`.
          24  +
///
          25  +
/// <p>Starts an asynchronous invocation.</p>
          26  +
/// <p>This operation requires permission for the <code>bedrock:InvokeModel</code> action.</p><important>
          27  +
/// <p>To deny all inference access to resources that you specify in the modelId field, you need to deny access to the <code>bedrock:InvokeModel</code> and <code>bedrock:InvokeModelWithResponseStream</code> actions. Doing this also denies access to the resource through the Converse API actions (<a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> and <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a>). For more information see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-deny-inference">Deny access for inference on specific models</a>.</p>
          28  +
/// </important>
          29  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          30  +
pub struct StartAsyncInvokeFluentBuilder {
          31  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          32  +
    inner: crate::operation::start_async_invoke::builders::StartAsyncInvokeInputBuilder,
          33  +
    config_override: ::std::option::Option<crate::config::Builder>,
          34  +
}
          35  +
impl
          36  +
    crate::client::customize::internal::CustomizableSend<
          37  +
        crate::operation::start_async_invoke::StartAsyncInvokeOutput,
          38  +
        crate::operation::start_async_invoke::StartAsyncInvokeError,
          39  +
    > for StartAsyncInvokeFluentBuilder
          40  +
{
          41  +
    fn send(
          42  +
        self,
          43  +
        config_override: crate::config::Builder,
          44  +
    ) -> crate::client::customize::internal::BoxFuture<
          45  +
        crate::client::customize::internal::SendResult<
          46  +
            crate::operation::start_async_invoke::StartAsyncInvokeOutput,
          47  +
            crate::operation::start_async_invoke::StartAsyncInvokeError,
          48  +
        >,
          49  +
    > {
          50  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          51  +
    }
          52  +
}
          53  +
impl StartAsyncInvokeFluentBuilder {
          54  +
    /// Creates a new `StartAsyncInvokeFluentBuilder`.
          55  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          56  +
        Self {
          57  +
            handle,
          58  +
            inner: ::std::default::Default::default(),
          59  +
            config_override: ::std::option::Option::None,
          60  +
        }
          61  +
    }
          62  +
    /// Access the StartAsyncInvoke as a reference.
          63  +
    pub fn as_input(&self) -> &crate::operation::start_async_invoke::builders::StartAsyncInvokeInputBuilder {
          64  +
        &self.inner
          65  +
    }
          66  +
    /// Sends the request and returns the response.
          67  +
    ///
          68  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          69  +
    /// can be matched against.
          70  +
    ///
          71  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          72  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          73  +
    /// set when configuring the client.
          74  +
    pub async fn send(
          75  +
        self,
          76  +
    ) -> ::std::result::Result<
          77  +
        crate::operation::start_async_invoke::StartAsyncInvokeOutput,
          78  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          79  +
            crate::operation::start_async_invoke::StartAsyncInvokeError,
          80  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          81  +
        >,
          82  +
    > {
          83  +
        let input = self
          84  +
            .inner
          85  +
            .build()
          86  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          87  +
        let runtime_plugins = crate::operation::start_async_invoke::StartAsyncInvoke::operation_runtime_plugins(
          88  +
            self.handle.runtime_plugins.clone(),
          89  +
            &self.handle.conf,
          90  +
            self.config_override,
          91  +
        );
          92  +
        crate::operation::start_async_invoke::StartAsyncInvoke::orchestrate(&runtime_plugins, input).await
          93  +
    }
          94  +
          95  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
          96  +
    pub fn customize(
          97  +
        self,
          98  +
    ) -> crate::client::customize::CustomizableOperation<
          99  +
        crate::operation::start_async_invoke::StartAsyncInvokeOutput,
         100  +
        crate::operation::start_async_invoke::StartAsyncInvokeError,
         101  +
        Self,
         102  +
    > {
         103  +
        crate::client::customize::CustomizableOperation::new(self)
         104  +
    }
         105  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         106  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         107  +
        self
         108  +
    }
         109  +
         110  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         111  +
        self.config_override = config_override;
         112  +
        self
         113  +
    }
         114  +
    /// <p>Specify idempotency token to ensure that requests are not duplicated.</p>
         115  +
    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         116  +
        self.inner = self.inner.client_request_token(input.into());
         117  +
        self
         118  +
    }
         119  +
    /// <p>Specify idempotency token to ensure that requests are not duplicated.</p>
         120  +
    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         121  +
        self.inner = self.inner.set_client_request_token(input);
         122  +
        self
         123  +
    }
         124  +
    /// <p>Specify idempotency token to ensure that requests are not duplicated.</p>
         125  +
    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
         126  +
        self.inner.get_client_request_token()
         127  +
    }
         128  +
    /// <p>The model to invoke.</p>
         129  +
    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         130  +
        self.inner = self.inner.model_id(input.into());
         131  +
        self
         132  +
    }
         133  +
    /// <p>The model to invoke.</p>
         134  +
    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         135  +
        self.inner = self.inner.set_model_id(input);
         136  +
        self
         137  +
    }
         138  +
    /// <p>The model to invoke.</p>
         139  +
    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
         140  +
        self.inner.get_model_id()
         141  +
    }
         142  +
    /// <p>Input to send to the model.</p>
         143  +
    pub fn model_input(mut self, input: ::aws_smithy_types::Document) -> Self {
         144  +
        self.inner = self.inner.model_input(input);
         145  +
        self
         146  +
    }
         147  +
    /// <p>Input to send to the model.</p>
         148  +
    pub fn set_model_input(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
         149  +
        self.inner = self.inner.set_model_input(input);
         150  +
        self
         151  +
    }
         152  +
    /// <p>Input to send to the model.</p>
         153  +
    pub fn get_model_input(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
         154  +
        self.inner.get_model_input()
         155  +
    }
         156  +
    /// <p>Where to store the output.</p>
         157  +
    pub fn output_data_config(mut self, input: crate::types::AsyncInvokeOutputDataConfig) -> Self {
         158  +
        self.inner = self.inner.output_data_config(input);
         159  +
        self
         160  +
    }
         161  +
    /// <p>Where to store the output.</p>
         162  +
    pub fn set_output_data_config(mut self, input: ::std::option::Option<crate::types::AsyncInvokeOutputDataConfig>) -> Self {
         163  +
        self.inner = self.inner.set_output_data_config(input);
         164  +
        self
         165  +
    }
         166  +
    /// <p>Where to store the output.</p>
         167  +
    pub fn get_output_data_config(&self) -> &::std::option::Option<crate::types::AsyncInvokeOutputDataConfig> {
         168  +
        self.inner.get_output_data_config()
         169  +
    }
         170  +
    ///
         171  +
    /// Appends an item to `tags`.
         172  +
    ///
         173  +
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
         174  +
    ///
         175  +
    /// <p>Tags to apply to the invocation.</p>
         176  +
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
         177  +
        self.inner = self.inner.tags(input);
         178  +
        self
         179  +
    }
         180  +
    /// <p>Tags to apply to the invocation.</p>
         181  +
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
         182  +
        self.inner = self.inner.set_tags(input);
         183  +
        self
         184  +
    }
         185  +
    /// <p>Tags to apply to the invocation.</p>
         186  +
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
         187  +
        self.inner.get_tags()
         188  +
    }
         189  +
}

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

@@ -1,1 +7,9 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
    2      3   
pub use ::aws_smithy_types::Blob;
           4  +
pub use ::aws_smithy_types::DateTime;
    3      5   
    4      6   
/// Event stream related primitives such as `Message` or `Header`.
    5      7   
pub mod event_stream;
    6      8   
    7      9   
pub(crate) mod sealed_enum_unknown;

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

@@ -1,1 +0,332 @@
   16     16   
}
   17     17   
   18     18   
pub fn parse_http_error_metadata(
   19     19   
    _response_status: u16,
   20     20   
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21     21   
    response_body: &[u8],
   22     22   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23     23   
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   24     24   
}
   25     25   
          26  +
pub(crate) mod shape_apply_guardrail;
          27  +
   26     28   
pub(crate) mod shape_converse;
   27     29   
   28     30   
pub(crate) mod shape_converse_stream;
   29     31   
          32  +
pub(crate) mod shape_get_async_invoke;
          33  +
   30     34   
pub(crate) mod shape_invoke_model;
   31     35   
   32     36   
pub(crate) mod shape_invoke_model_input;
   33     37   
          38  +
pub(crate) mod shape_invoke_model_with_bidirectional_stream;
          39  +
   34     40   
pub(crate) mod shape_invoke_model_with_response_stream;
   35     41   
   36     42   
pub(crate) mod shape_invoke_model_with_response_stream_input;
   37     43   
          44  +
pub(crate) mod shape_list_async_invokes;
          45  +
          46  +
pub(crate) mod shape_start_async_invoke;
          47  +
   38     48   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   39     49   
    if data.is_empty() {
   40     50   
        b"{}"
   41     51   
    } else {
   42     52   
        data
   43     53   
    }
   44     54   
}
   45     55   
   46     56   
pub(crate) mod shape_access_denied_exception;
   47     57   
          58  +
pub(crate) mod shape_apply_guardrail_input;
          59  +
          60  +
pub(crate) mod shape_conflict_exception;
          61  +
   48     62   
pub(crate) mod shape_converse_input;
   49     63   
   50     64   
pub(crate) mod shape_converse_stream_input;
   51     65   
   52     66   
pub(crate) mod shape_converse_stream_output;
   53     67   
   54     68   
pub(crate) mod shape_internal_server_exception;
   55     69   
   56     70   
pub(crate) mod shape_invoke_model_output;
   57     71   
          72  +
pub(crate) mod shape_invoke_model_with_bidirectional_stream_input;
          73  +
          74  +
pub(crate) mod shape_invoke_model_with_bidirectional_stream_output;
          75  +
   58     76   
pub(crate) mod shape_invoke_model_with_response_stream_output;
   59     77   
   60     78   
pub(crate) mod shape_model_error_exception;
   61     79   
   62     80   
pub(crate) mod shape_model_not_ready_exception;
   63     81   
   64     82   
pub(crate) mod shape_model_stream_error_exception;
   65     83   
   66     84   
pub(crate) mod shape_model_timeout_exception;
   67     85   
   68     86   
pub(crate) mod shape_resource_not_found_exception;
   69     87   
   70     88   
pub(crate) mod shape_service_quota_exceeded_exception;
   71     89   
          90  +
pub(crate) mod shape_service_unavailable_exception;
          91  +
          92  +
pub(crate) mod shape_start_async_invoke_input;
          93  +
   72     94   
pub(crate) mod shape_throttling_exception;
   73     95   
   74     96   
pub(crate) mod shape_validation_exception;
   75     97   
   76     98   
pub fn parse_event_stream_error_metadata(
   77     99   
    payload: &::bytes::Bytes,
   78    100   
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   79    101   
    crate::json_errors::parse_error_metadata(payload, &::aws_smithy_runtime_api::http::Headers::new())
   80    102   
}
   81    103   
         104  +
pub(crate) mod shape_async_invoke_output_data_config;
         105  +
         106  +
pub(crate) mod shape_async_invoke_summaries;
         107  +
         108  +
pub(crate) mod shape_bidirectional_input_payload_part;
         109  +
   82    110   
pub(crate) mod shape_converse_metrics;
   83    111   
   84    112   
pub(crate) mod shape_converse_output;
   85    113   
         114  +
pub(crate) mod shape_converse_trace;
         115  +
         116  +
pub(crate) mod shape_guardrail_assessment_list;
         117  +
         118  +
pub(crate) mod shape_guardrail_configuration;
         119  +
         120  +
pub(crate) mod shape_guardrail_content_block;
         121  +
         122  +
pub(crate) mod shape_guardrail_coverage;
         123  +
         124  +
pub(crate) mod shape_guardrail_output_content_list;
         125  +
         126  +
pub(crate) mod shape_guardrail_stream_configuration;
         127  +
         128  +
pub(crate) mod shape_guardrail_usage;
         129  +
   86    130   
pub(crate) mod shape_inference_configuration;
   87    131   
   88    132   
pub(crate) mod shape_message;
   89    133   
         134  +
pub(crate) mod shape_performance_configuration;
         135  +
         136  +
pub(crate) mod shape_prompt_variable_values;
         137  +
   90    138   
pub(crate) mod shape_system_content_block;
   91    139   
         140  +
pub(crate) mod shape_tag;
         141  +
   92    142   
pub(crate) mod shape_token_usage;
   93    143   
   94    144   
pub(crate) mod shape_tool_configuration;
   95    145   
         146  +
pub(crate) mod shape_async_invoke_s3_output_data_config;
         147  +
         148  +
pub(crate) mod shape_async_invoke_summary;
         149  +
         150  +
pub(crate) mod shape_bidirectional_output_payload_part;
         151  +
         152  +
pub(crate) mod shape_cache_point_block;
         153  +
   96    154   
pub(crate) mod shape_content_block;
   97    155   
   98    156   
pub(crate) mod shape_content_block_delta_event;
   99    157   
  100    158   
pub(crate) mod shape_content_block_start_event;
  101    159   
  102    160   
pub(crate) mod shape_content_block_stop_event;
  103    161   
  104    162   
pub(crate) mod shape_converse_stream_metadata_event;
  105    163   
         164  +
pub(crate) mod shape_guardrail_assessment;
         165  +
         166  +
pub(crate) mod shape_guardrail_converse_content_block;
         167  +
         168  +
pub(crate) mod shape_guardrail_image_block;
         169  +
         170  +
pub(crate) mod shape_guardrail_image_coverage;
         171  +
         172  +
pub(crate) mod shape_guardrail_output_content;
         173  +
         174  +
pub(crate) mod shape_guardrail_text_block;
         175  +
         176  +
pub(crate) mod shape_guardrail_text_characters_coverage;
         177  +
         178  +
pub(crate) mod shape_guardrail_trace_assessment;
         179  +
  106    180   
pub(crate) mod shape_message_start_event;
  107    181   
  108    182   
pub(crate) mod shape_message_stop_event;
  109    183   
  110    184   
pub(crate) mod shape_payload_part;
  111    185   
         186  +
pub(crate) mod shape_prompt_router_trace;
         187  +
  112    188   
pub(crate) mod shape_tool;
  113    189   
  114    190   
pub(crate) mod shape_tool_choice;
  115    191   
  116    192   
pub(crate) mod shape_any_tool_choice;
  117    193   
  118    194   
pub(crate) mod shape_auto_tool_choice;
  119    195   
         196  +
pub(crate) mod shape_citations_content_block;
         197  +
  120    198   
pub(crate) mod shape_content_blocks;
  121    199   
         200  +
pub(crate) mod shape_document_block;
         201  +
         202  +
pub(crate) mod shape_guardrail_assessment_list_map;
         203  +
         204  +
pub(crate) mod shape_guardrail_assessment_map;
         205  +
         206  +
pub(crate) mod shape_guardrail_content_policy_assessment;
         207  +
         208  +
pub(crate) mod shape_guardrail_contextual_grounding_policy_assessment;
         209  +
         210  +
pub(crate) mod shape_guardrail_converse_image_block;
         211  +
         212  +
pub(crate) mod shape_guardrail_converse_text_block;
         213  +
         214  +
pub(crate) mod shape_guardrail_image_source;
         215  +
         216  +
pub(crate) mod shape_guardrail_invocation_metrics;
         217  +
         218  +
pub(crate) mod shape_guardrail_sensitive_information_policy_assessment;
         219  +
         220  +
pub(crate) mod shape_guardrail_topic_policy_assessment;
         221  +
         222  +
pub(crate) mod shape_guardrail_word_policy_assessment;
         223  +
  122    224   
pub(crate) mod shape_image_block;
  123    225   
         226  +
pub(crate) mod shape_model_outputs;
         227  +
         228  +
pub(crate) mod shape_reasoning_content_block;
         229  +
  124    230   
pub(crate) mod shape_specific_tool_choice;
  125    231   
  126    232   
pub(crate) mod shape_tool_result_block;
  127    233   
  128    234   
pub(crate) mod shape_tool_specification;
  129    235   
  130    236   
pub(crate) mod shape_tool_use_block;
  131    237   
         238  +
pub(crate) mod shape_video_block;
         239  +
         240  +
pub(crate) mod shape_citation;
         241  +
         242  +
pub(crate) mod shape_citation_generated_content;
         243  +
         244  +
pub(crate) mod shape_citations_config;
         245  +
  132    246   
pub(crate) mod shape_content_block_delta;
  133    247   
  134    248   
pub(crate) mod shape_content_block_start;
  135    249   
  136    250   
pub(crate) mod shape_converse_stream_metrics;
  137    251   
         252  +
pub(crate) mod shape_converse_stream_trace;
         253  +
         254  +
pub(crate) mod shape_document_source;
         255  +
         256  +
pub(crate) mod shape_guardrail_content_filter_list;
         257  +
         258  +
pub(crate) mod shape_guardrail_contextual_grounding_filters;
         259  +
         260  +
pub(crate) mod shape_guardrail_converse_image_source;
         261  +
         262  +
pub(crate) mod shape_guardrail_custom_word_list;
         263  +
         264  +
pub(crate) mod shape_guardrail_managed_word_list;
         265  +
         266  +
pub(crate) mod shape_guardrail_pii_entity_filter_list;
         267  +
         268  +
pub(crate) mod shape_guardrail_regex_filter_list;
         269  +
         270  +
pub(crate) mod shape_guardrail_topic_list;
         271  +
  138    272   
pub(crate) mod shape_image_source;
  139    273   
         274  +
pub(crate) mod shape_reasoning_text_block;
         275  +
  140    276   
pub(crate) mod shape_tool_input_schema;
  141    277   
  142    278   
pub(crate) mod shape_tool_result_content_block;
  143    279   
         280  +
pub(crate) mod shape_video_source;
         281  +
         282  +
pub(crate) mod shape_citation_location;
         283  +
         284  +
pub(crate) mod shape_citation_source_content;
         285  +
         286  +
pub(crate) mod shape_citations_delta;
         287  +
         288  +
pub(crate) mod shape_document_content_block;
         289  +
         290  +
pub(crate) mod shape_guardrail_content_filter;
         291  +
         292  +
pub(crate) mod shape_guardrail_contextual_grounding_filter;
         293  +
         294  +
pub(crate) mod shape_guardrail_custom_word;
         295  +
         296  +
pub(crate) mod shape_guardrail_managed_word;
         297  +
         298  +
pub(crate) mod shape_guardrail_pii_entity_filter;
         299  +
         300  +
pub(crate) mod shape_guardrail_regex_filter;
         301  +
         302  +
pub(crate) mod shape_guardrail_topic;
         303  +
         304  +
pub(crate) mod shape_reasoning_content_block_delta;
         305  +
         306  +
pub(crate) mod shape_s3_location;
         307  +
  144    308   
pub(crate) mod shape_tool_use_block_delta;
  145    309   
  146    310   
pub(crate) mod shape_tool_use_block_start;
  147    311   
         312  +
pub(crate) mod shape_citation_generated_content_list;
         313  +
         314  +
pub(crate) mod shape_citation_source_content_list_delta;
         315  +
         316  +
pub(crate) mod shape_citations;
         317  +
         318  +
pub(crate) mod shape_document_char_location;
         319  +
         320  +
pub(crate) mod shape_document_chunk_location;
         321  +
         322  +
pub(crate) mod shape_document_page_location;
         323  +
  148    324   
pub(crate) mod shape_tool_result_content_blocks;
         325  +
         326  +
pub(crate) mod shape_citation_source_content_delta;
         327  +
         328  +
pub(crate) mod shape_document_content_blocks;
         329  +
         330  +
pub(crate) mod shape_guardrail_converse_content_qualifier_list;
         331  +
         332  +
pub(crate) mod shape_citation_source_content_list;

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

@@ -0,1 +0,204 @@
           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  +
        "ThrottlingException" => crate::operation::apply_guardrail::ApplyGuardrailError::ThrottlingException({
          84  +
            #[allow(unused_mut)]
          85  +
            let mut tmp = {
          86  +
                #[allow(unused_mut)]
          87  +
                let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
          88  +
                output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
          89  +
                    .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?;
          90  +
                let output = output.meta(generic);
          91  +
                output.build()
          92  +
            };
          93  +
            if tmp.message.is_none() {
          94  +
                tmp.message = _error_message;
          95  +
            }
          96  +
            tmp
          97  +
        }),
          98  +
        "ValidationException" => crate::operation::apply_guardrail::ApplyGuardrailError::ValidationException({
          99  +
            #[allow(unused_mut)]
         100  +
            let mut tmp = {
         101  +
                #[allow(unused_mut)]
         102  +
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
         103  +
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
         104  +
                    .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?;
         105  +
                let output = output.meta(generic);
         106  +
                output.build()
         107  +
            };
         108  +
            if tmp.message.is_none() {
         109  +
                tmp.message = _error_message;
         110  +
            }
         111  +
            tmp
         112  +
        }),
         113  +
        _ => crate::operation::apply_guardrail::ApplyGuardrailError::generic(generic),
         114  +
    })
         115  +
}
         116  +
         117  +
#[allow(clippy::unnecessary_wraps)]
         118  +
pub fn de_apply_guardrail_http_response(
         119  +
    _response_status: u16,
         120  +
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
         121  +
    _response_body: &[u8],
         122  +
) -> std::result::Result<crate::operation::apply_guardrail::ApplyGuardrailOutput, crate::operation::apply_guardrail::ApplyGuardrailError> {
         123  +
    Ok({
         124  +
        #[allow(unused_mut)]
         125  +
        let mut output = crate::operation::apply_guardrail::builders::ApplyGuardrailOutputBuilder::default();
         126  +
        output = crate::protocol_serde::shape_apply_guardrail::de_apply_guardrail(_response_body, output)
         127  +
            .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?;
         128  +
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
         129  +
        crate::serde_util::apply_guardrail_output_output_correct_errors(output)
         130  +
            .build()
         131  +
            .map_err(crate::operation::apply_guardrail::ApplyGuardrailError::unhandled)?
         132  +
    })
         133  +
}
         134  +
         135  +
pub fn ser_apply_guardrail_input(
         136  +
    input: &crate::operation::apply_guardrail::ApplyGuardrailInput,
         137  +
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
         138  +
    let mut out = String::new();
         139  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
         140  +
    crate::protocol_serde::shape_apply_guardrail_input::ser_apply_guardrail_input_input(&mut object, input)?;
         141  +
    object.finish();
         142  +
    Ok(::aws_smithy_types::body::SdkBody::from(out))
         143  +
}
         144  +
         145  +
pub(crate) fn de_apply_guardrail(
         146  +
    value: &[u8],
         147  +
    mut builder: crate::operation::apply_guardrail::builders::ApplyGuardrailOutputBuilder,
         148  +
) -> ::std::result::Result<
         149  +
    crate::operation::apply_guardrail::builders::ApplyGuardrailOutputBuilder,
         150  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
         151  +
> {
         152  +
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
         153  +
    let tokens = &mut tokens_owned;
         154  +
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         155  +
    loop {
         156  +
        match tokens.next().transpose()? {
         157  +
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
         158  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
         159  +
                "action" => {
         160  +
                    builder = builder.set_action(
         161  +
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
         162  +
                            .map(|s| s.to_unescaped().map(|u| crate::types::GuardrailAction::from(u.as_ref())))
         163  +
                            .transpose()?,
         164  +
                    );
         165  +
                }
         166  +
                "actionReason" => {
         167  +
                    builder = builder.set_action_reason(
         168  +
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
         169  +
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
         170  +
                            .transpose()?,
         171  +
                    );
         172  +
                }
         173  +
                "assessments" => {
         174  +
                    builder = builder.set_assessments(crate::protocol_serde::shape_guardrail_assessment_list::de_guardrail_assessment_list(
         175  +
                        tokens,
         176  +
                    )?);
         177  +
                }
         178  +
                "guardrailCoverage" => {
         179  +
                    builder = builder.set_guardrail_coverage(crate::protocol_serde::shape_guardrail_coverage::de_guardrail_coverage(tokens)?);
         180  +
                }
         181  +
                "outputs" => {
         182  +
                    builder =
         183  +
                        builder.set_outputs(crate::protocol_serde::shape_guardrail_output_content_list::de_guardrail_output_content_list(tokens)?);
         184  +
                }
         185  +
                "usage" => {
         186  +
                    builder = builder.set_usage(crate::protocol_serde::shape_guardrail_usage::de_guardrail_usage(tokens)?);
         187  +
                }
         188  +
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         189  +
            },
         190  +
            other => {
         191  +
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
         192  +
                    "expected object key or end object, found: {:?}",
         193  +
                    other
         194  +
                )))
         195  +
            }
         196  +
        }
         197  +
    }
         198  +
    if tokens.next().is_some() {
         199  +
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
         200  +
            "found more JSON tokens after completing parsing",
         201  +
        ));
         202  +
    }
         203  +
    Ok(builder)
         204  +
}

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

@@ -0,1 +0,25 @@
           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

@@ -0,1 +0,84 @@
           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  +
) -> ::std::result::Result<Option<crate::types::AsyncInvokeOutputDataConfig>, ::aws_smithy_json::deserialize::error::DeserializeError>
           5  +
where
           6  +
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
           7  +
{
           8  +
    let mut variant = None;
           9  +
    match tokens.next().transpose()? {
          10  +
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
          11  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
          12  +
            match tokens.next().transpose()? {
          13  +
                Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          14  +
                Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          15  +
                    if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) =
          16  +
                        tokens.peek()
          17  +
                    {
          18  +
                        let _ = tokens.next().expect("peek returned a token")?;
          19  +
                        continue;
          20  +
                    }
          21  +
                    let key = key.to_unescaped()?;
          22  +
                    if key == "__type" {
          23  +
                        ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
          24  +
                        continue;
          25  +
                    }
          26  +
                    if variant.is_some() {
          27  +
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          28  +
                            "encountered mixed variants in union",
          29  +
                        ));
          30  +
                    }
          31  +
                    variant = match key.as_ref() {
          32  +
                        "s3OutputDataConfig" => Some(crate::types::AsyncInvokeOutputDataConfig::S3OutputDataConfig(
          33  +
                            crate::protocol_serde::shape_async_invoke_s3_output_data_config::de_async_invoke_s3_output_data_config(tokens)?
          34  +
                                .ok_or_else(|| {
          35  +
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 's3OutputDataConfig' cannot be null")
          36  +
                                })?,
          37  +
                        )),
          38  +
                        _ => {
          39  +
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
          40  +
                            Some(crate::types::AsyncInvokeOutputDataConfig::Unknown)
          41  +
                        }
          42  +
                    };
          43  +
                }
          44  +
                other => {
          45  +
                    return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
          46  +
                        "expected object key or end object, found: {:?}",
          47  +
                        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  +
}

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

@@ -0,1 +0,74 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_async_invoke_s3_output_data_config<'a, I>(
           3  +
    tokens: &mut ::std::iter::Peekable<I>,
           4  +
) -> ::std::result::Result<Option<crate::types::AsyncInvokeS3OutputDataConfig>, ::aws_smithy_json::deserialize::error::DeserializeError>
           5  +
where
           6  +
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
           7  +
{
           8  +
    match tokens.next().transpose()? {
           9  +
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          10  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          11  +
            #[allow(unused_mut)]
          12  +
            let mut builder = crate::types::builders::AsyncInvokeS3OutputDataConfigBuilder::default();
          13  +
            loop {
          14  +
                match tokens.next().transpose()? {
          15  +
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          16  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          17  +
                        "s3Uri" => {
          18  +
                            builder = builder.set_s3_uri(
          19  +
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          20  +
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
          21  +
                                    .transpose()?,
          22  +
                            );
          23  +
                        }
          24  +
                        "kmsKeyId" => {
          25  +
                            builder = builder.set_kms_key_id(
          26  +
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          27  +
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
          28  +
                                    .transpose()?,
          29  +
                            );
          30  +
                        }
          31  +
                        "bucketOwner" => {
          32  +
                            builder = builder.set_bucket_owner(
          33  +
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          34  +
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
          35  +
                                    .transpose()?,
          36  +
                            );
          37  +
                        }
          38  +
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          39  +
                    },
          40  +
                    other => {
          41  +
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
          42  +
                            "expected object key or end object, found: {:?}",
          43  +
                            other
          44  +
                        )))
          45  +
                    }
          46  +
                }
          47  +
            }
          48  +
            Ok(Some(
          49  +
                crate::serde_util::async_invoke_s3_output_data_config_correct_errors(builder)
          50  +
                    .build()
          51  +
                    .map_err(|err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?,
          52  +
            ))
          53  +
        }
          54  +
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          55  +
            "expected start object or null",
          56  +
        )),
          57  +
    }
          58  +
}
          59  +
          60  +
pub fn ser_async_invoke_s3_output_data_config(
          61  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          62  +
    input: &crate::types::AsyncInvokeS3OutputDataConfig,
          63  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          64  +
    {
          65  +
        object.key("s3Uri").string(input.s3_uri.as_str());
          66  +
    }
          67  +
    if let Some(var_1) = &input.kms_key_id {
          68  +
        object.key("kmsKeyId").string(var_1.as_str());
          69  +
    }
          70  +
    if let Some(var_2) = &input.bucket_owner {
          71  +
        object.key("bucketOwner").string(var_2.as_str());
          72  +
    }
          73  +
    Ok(())
          74  +
}

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

@@ -0,1 +0,32 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_async_invoke_summaries<'a, I>(
           3  +
    tokens: &mut ::std::iter::Peekable<I>,
           4  +
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::AsyncInvokeSummary>>, ::aws_smithy_json::deserialize::error::DeserializeError>
           5  +
where
           6  +
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
           7  +
{
           8  +
    match tokens.next().transpose()? {
           9  +
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          10  +
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          11  +
            let mut items = Vec::new();
          12  +
            loop {
          13  +
                match tokens.peek() {
          14  +
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          15  +
                        tokens.next().transpose().unwrap();
          16  +
                        break;
          17  +
                    }
          18  +
                    _ => {
          19  +
                        let value = crate::protocol_serde::shape_async_invoke_summary::de_async_invoke_summary(tokens)?;
          20  +
                        if let Some(value) = value {
          21  +
                            items.push(value);
          22  +
                        }
          23  +
                    }
          24  +
                }
          25  +
            }
          26  +
            Ok(Some(items))
          27  +
        }
          28  +
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          29  +
            "expected start array or null",
          30  +
        )),
          31  +
    }
          32  +
}

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

@@ -0,1 +0,93 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_async_invoke_summary<'a, I>(
           3  +
    tokens: &mut ::std::iter::Peekable<I>,
           4  +
) -> ::std::result::Result<Option<crate::types::AsyncInvokeSummary>, ::aws_smithy_json::deserialize::error::DeserializeError>
           5  +
where
           6  +
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
           7  +
{
           8  +
    match tokens.next().transpose()? {
           9  +
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          10  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          11  +
            #[allow(unused_mut)]
          12  +
            let mut builder = crate::types::builders::AsyncInvokeSummaryBuilder::default();
          13  +
            loop {
          14  +
                match tokens.next().transpose()? {
          15  +
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          16  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          17  +
                        "invocationArn" => {
          18  +
                            builder = builder.set_invocation_arn(
          19  +
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          20  +
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
          21  +
                                    .transpose()?,
          22  +
                            );
          23  +
                        }
          24  +
                        "modelArn" => {
          25  +
                            builder = builder.set_model_arn(
          26  +
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          27  +
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
          28  +
                                    .transpose()?,
          29  +
                            );
          30  +
                        }
          31  +
                        "clientRequestToken" => {
          32  +
                            builder = builder.set_client_request_token(
          33  +
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          34  +
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
          35  +
                                    .transpose()?,
          36  +
                            );
          37  +
                        }
          38  +
                        "status" => {
          39  +
                            builder = builder.set_status(
          40  +
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          41  +
                                    .map(|s| s.to_unescaped().map(|u| crate::types::AsyncInvokeStatus::from(u.as_ref())))
          42  +
                                    .transpose()?,
          43  +
                            );
          44  +
                        }
          45  +
                        "failureMessage" => {
          46  +
                            builder = builder.set_failure_message(
          47  +
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          48  +
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
          49  +
                                    .transpose()?,
          50  +
                            );
          51  +
                        }
          52  +
                        "submitTime" => {
          53  +
                            builder = builder.set_submit_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
          54  +
                                tokens.next(),
          55  +
                                ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
          56  +
                            )?);
          57  +
                        }
          58  +
                        "lastModifiedTime" => {
          59  +
                            builder = builder.set_last_modified_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
          60  +
                                tokens.next(),
          61  +
                                ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
          62  +
                            )?);
          63  +
                        }
          64  +
                        "endTime" => {
          65  +
                            builder = builder.set_end_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
          66  +
                                tokens.next(),
          67  +
                                ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
          68  +
                            )?);
          69  +
                        }
          70  +
                        "outputDataConfig" => {
          71  +
                            builder = builder.set_output_data_config(
          72  +
                                crate::protocol_serde::shape_async_invoke_output_data_config::de_async_invoke_output_data_config(tokens)?,
          73  +
                            );
          74  +
                        }
          75  +
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          76  +
                    },
          77  +
                    other => {
          78  +
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
          79  +
                            "expected object key or end object, found: {:?}",
          80  +
                            other
          81  +
                        )))
          82  +
                    }
          83  +
                }
          84  +
            }
          85  +
            Ok(Some(crate::serde_util::async_invoke_summary_correct_errors(builder).build().map_err(
          86  +
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
          87  +
            )?))
          88  +
        }
          89  +
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          90  +
            "expected start object or null",
          91  +
        )),
          92  +
    }
          93  +
}

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

@@ -0,1 +0,10 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_bidirectional_input_payload_part(
           3  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
           4  +
    input: &crate::types::BidirectionalInputPayloadPart,
           5  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    if let Some(var_1) = &input.bytes {
           7  +
        object.key("bytes").string_unchecked(&::aws_smithy_types::base64::encode(var_1));
           8  +
    }
           9  +
    Ok(())
          10  +
}

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

@@ -0,1 +0,51 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_bidirectional_output_payload_part_payload(
           3  +
    input: &[u8],
           4  +
) -> ::std::result::Result<crate::types::BidirectionalOutputPayloadPart, ::aws_smithy_json::deserialize::error::DeserializeError> {
           5  +
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(input)).peekable();
           6  +
    let tokens = &mut tokens_owned;
           7  +
    let result = crate::protocol_serde::shape_bidirectional_output_payload_part::de_bidirectional_output_payload_part(tokens)?
           8  +
        .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("expected payload member value"));
           9  +
    if tokens.next().is_some() {
          10  +
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          11  +
            "found more JSON tokens after completing parsing",
          12  +
        ));
          13  +
    }
          14  +
    result
          15  +
}
          16  +
          17  +
pub(crate) fn de_bidirectional_output_payload_part<'a, I>(
          18  +
    tokens: &mut ::std::iter::Peekable<I>,
          19  +
) -> ::std::result::Result<Option<crate::types::BidirectionalOutputPayloadPart>, ::aws_smithy_json::deserialize::error::DeserializeError>
          20  +
where
          21  +
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
          22  +
{
          23  +
    match tokens.next().transpose()? {
          24  +
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          25  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          26  +
            #[allow(unused_mut)]
          27  +
            let mut builder = crate::types::builders::BidirectionalOutputPayloadPartBuilder::default();
          28  +
            loop {
          29  +
                match tokens.next().transpose()? {
          30  +
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          31  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          32  +
                        "bytes" => {
          33  +
                            builder = builder.set_bytes(::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?);
          34  +
                        }
          35  +
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          36  +
                    },
          37  +
                    other => {
          38  +
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
          39  +
                            "expected object key or end object, found: {:?}",
          40  +
                            other
          41  +
                        )))
          42  +
                    }
          43  +
                }
          44  +
            }
          45  +
            Ok(Some(builder.build()))
          46  +
        }
          47  +
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          48  +
            "expected start object or null",
          49  +
        )),
          50  +
    }
          51  +
}

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

@@ -0,1 +0,52 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_cache_point_block(
           3  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
           4  +
    input: &crate::types::CachePointBlock,
           5  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    {
           7  +
        object.key("type").string(input.r#type.as_str());
           8  +
    }
           9  +
    Ok(())
          10  +
}
          11  +
          12  +
pub(crate) fn de_cache_point_block<'a, I>(
          13  +
    tokens: &mut ::std::iter::Peekable<I>,
          14  +
) -> ::std::result::Result<Option<crate::types::CachePointBlock>, ::aws_smithy_json::deserialize::error::DeserializeError>
          15  +
where
          16  +
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
          17  +
{
          18  +
    match tokens.next().transpose()? {
          19  +
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          20  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          21  +
            #[allow(unused_mut)]
          22  +
            let mut builder = crate::types::builders::CachePointBlockBuilder::default();
          23  +
            loop {
          24  +
                match tokens.next().transpose()? {
          25  +
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          26  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          27  +
                        "type" => {
          28  +
                            builder = builder.set_type(
          29  +
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          30  +
                                    .map(|s| s.to_unescaped().map(|u| crate::types::CachePointType::from(u.as_ref())))
          31  +
                                    .transpose()?,
          32  +
                            );
          33  +
                        }
          34  +
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          35  +
                    },
          36  +
                    other => {
          37  +
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
          38  +
                            "expected object key or end object, found: {:?}",
          39  +
                            other
          40  +
                        )))
          41  +
                    }
          42  +
                }
          43  +
            }
          44  +
            Ok(Some(crate::serde_util::cache_point_block_correct_errors(builder).build().map_err(
          45  +
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
          46  +
            )?))
          47  +
        }
          48  +
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          49  +
            "expected start object or null",
          50  +
        )),
          51  +
    }
          52  +
}