AWS SDK

AWS SDK

rev. db10d8b7d1ddffb641e5651cb5b4c7c7d63bda6a (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/_video_block.rs

@@ -0,1 +0,81 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>A video block.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct VideoBlock {
           7  +
    /// <p>The block's format.</p>
           8  +
    pub format: crate::types::VideoFormat,
           9  +
    /// <p>The block's source.</p>
          10  +
    pub source: ::std::option::Option<crate::types::VideoSource>,
          11  +
}
          12  +
impl VideoBlock {
          13  +
    /// <p>The block's format.</p>
          14  +
    pub fn format(&self) -> &crate::types::VideoFormat {
          15  +
        &self.format
          16  +
    }
          17  +
    /// <p>The block's source.</p>
          18  +
    pub fn source(&self) -> ::std::option::Option<&crate::types::VideoSource> {
          19  +
        self.source.as_ref()
          20  +
    }
          21  +
}
          22  +
impl VideoBlock {
          23  +
    /// Creates a new builder-style object to manufacture [`VideoBlock`](crate::types::VideoBlock).
          24  +
    pub fn builder() -> crate::types::builders::VideoBlockBuilder {
          25  +
        crate::types::builders::VideoBlockBuilder::default()
          26  +
    }
          27  +
}
          28  +
          29  +
/// A builder for [`VideoBlock`](crate::types::VideoBlock).
          30  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          31  +
#[non_exhaustive]
          32  +
pub struct VideoBlockBuilder {
          33  +
    pub(crate) format: ::std::option::Option<crate::types::VideoFormat>,
          34  +
    pub(crate) source: ::std::option::Option<crate::types::VideoSource>,
          35  +
}
          36  +
impl VideoBlockBuilder {
          37  +
    /// <p>The block's format.</p>
          38  +
    /// This field is required.
          39  +
    pub fn format(mut self, input: crate::types::VideoFormat) -> Self {
          40  +
        self.format = ::std::option::Option::Some(input);
          41  +
        self
          42  +
    }
          43  +
    /// <p>The block's format.</p>
          44  +
    pub fn set_format(mut self, input: ::std::option::Option<crate::types::VideoFormat>) -> Self {
          45  +
        self.format = input;
          46  +
        self
          47  +
    }
          48  +
    /// <p>The block's format.</p>
          49  +
    pub fn get_format(&self) -> &::std::option::Option<crate::types::VideoFormat> {
          50  +
        &self.format
          51  +
    }
          52  +
    /// <p>The block's source.</p>
          53  +
    /// This field is required.
          54  +
    pub fn source(mut self, input: crate::types::VideoSource) -> Self {
          55  +
        self.source = ::std::option::Option::Some(input);
          56  +
        self
          57  +
    }
          58  +
    /// <p>The block's source.</p>
          59  +
    pub fn set_source(mut self, input: ::std::option::Option<crate::types::VideoSource>) -> Self {
          60  +
        self.source = input;
          61  +
        self
          62  +
    }
          63  +
    /// <p>The block's source.</p>
          64  +
    pub fn get_source(&self) -> &::std::option::Option<crate::types::VideoSource> {
          65  +
        &self.source
          66  +
    }
          67  +
    /// Consumes the builder and constructs a [`VideoBlock`](crate::types::VideoBlock).
          68  +
    /// This method will fail if any of the following fields are not set:
          69  +
    /// - [`format`](crate::types::builders::VideoBlockBuilder::format)
          70  +
    pub fn build(self) -> ::std::result::Result<crate::types::VideoBlock, ::aws_smithy_types::error::operation::BuildError> {
          71  +
        ::std::result::Result::Ok(crate::types::VideoBlock {
          72  +
            format: self.format.ok_or_else(|| {
          73  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
          74  +
                    "format",
          75  +
                    "format was not specified but it is required when building VideoBlock",
          76  +
                )
          77  +
            })?,
          78  +
            source: self.source,
          79  +
        })
          80  +
    }
          81  +
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/_video_format.rs

@@ -0,1 +0,150 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// When writing a match expression against `VideoFormat`, it is important to ensure
           4  +
/// your code is forward-compatible. That is, if a match arm handles a case for a
           5  +
/// feature that is supported by the service but has not been represented as an enum
           6  +
/// variant in a current version of SDK, your code should continue to work when you
           7  +
/// upgrade SDK to a future version in which the enum does include a variant for that
           8  +
/// feature.
           9  +
///
          10  +
/// Here is an example of how you can make a match expression forward-compatible:
          11  +
///
          12  +
/// ```text
          13  +
/// # let videoformat = unimplemented!();
          14  +
/// match videoformat {
          15  +
///     VideoFormat::Flv => { /* ... */ },
          16  +
///     VideoFormat::Mkv => { /* ... */ },
          17  +
///     VideoFormat::Mov => { /* ... */ },
          18  +
///     VideoFormat::Mp4 => { /* ... */ },
          19  +
///     VideoFormat::Mpeg => { /* ... */ },
          20  +
///     VideoFormat::Mpg => { /* ... */ },
          21  +
///     VideoFormat::ThreeGp => { /* ... */ },
          22  +
///     VideoFormat::Webm => { /* ... */ },
          23  +
///     VideoFormat::Wmv => { /* ... */ },
          24  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          25  +
///     _ => { /* ... */ },
          26  +
/// }
          27  +
/// ```
          28  +
/// The above code demonstrates that when `videoformat` represents
          29  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          30  +
/// even though the enum does not contain a variant `VideoFormat::NewFeature`
          31  +
/// in the current version of SDK. The reason is that the variable `other`,
          32  +
/// created by the `@` operator, is bound to
          33  +
/// `VideoFormat::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
          34  +
/// and calling `as_str` on it yields `"NewFeature"`.
          35  +
/// This match expression is forward-compatible when executed with a newer
          36  +
/// version of SDK where the variant `VideoFormat::NewFeature` is defined.
          37  +
/// Specifically, when `videoformat` represents `NewFeature`,
          38  +
/// the execution path will hit the second last match arm as before by virtue of
          39  +
/// calling `as_str` on `VideoFormat::NewFeature` also yielding `"NewFeature"`.
          40  +
///
          41  +
/// Explicitly matching on the `Unknown` variant should
          42  +
/// be avoided for two reasons:
          43  +
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
          44  +
/// - It might inadvertently shadow other intended match arms.
          45  +
///
          46  +
#[allow(missing_docs)] // documentation missing in model
          47  +
#[non_exhaustive]
          48  +
#[derive(
          49  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
          50  +
)]
          51  +
pub enum VideoFormat {
          52  +
    #[allow(missing_docs)] // documentation missing in model
          53  +
    Flv,
          54  +
    #[allow(missing_docs)] // documentation missing in model
          55  +
    Mkv,
          56  +
    #[allow(missing_docs)] // documentation missing in model
          57  +
    Mov,
          58  +
    #[allow(missing_docs)] // documentation missing in model
          59  +
    Mp4,
          60  +
    #[allow(missing_docs)] // documentation missing in model
          61  +
    Mpeg,
          62  +
    #[allow(missing_docs)] // documentation missing in model
          63  +
    Mpg,
          64  +
    #[allow(missing_docs)] // documentation missing in model
          65  +
    ThreeGp,
          66  +
    #[allow(missing_docs)] // documentation missing in model
          67  +
    Webm,
          68  +
    #[allow(missing_docs)] // documentation missing in model
          69  +
    Wmv,
          70  +
    /// `Unknown` contains new variants that have been added since this code was generated.
          71  +
    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
          72  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
          73  +
}
          74  +
impl ::std::convert::From<&str> for VideoFormat {
          75  +
    fn from(s: &str) -> Self {
          76  +
        match s {
          77  +
            "flv" => VideoFormat::Flv,
          78  +
            "mkv" => VideoFormat::Mkv,
          79  +
            "mov" => VideoFormat::Mov,
          80  +
            "mp4" => VideoFormat::Mp4,
          81  +
            "mpeg" => VideoFormat::Mpeg,
          82  +
            "mpg" => VideoFormat::Mpg,
          83  +
            "three_gp" => VideoFormat::ThreeGp,
          84  +
            "webm" => VideoFormat::Webm,
          85  +
            "wmv" => VideoFormat::Wmv,
          86  +
            other => VideoFormat::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          87  +
        }
          88  +
    }
          89  +
}
          90  +
impl ::std::str::FromStr for VideoFormat {
          91  +
    type Err = ::std::convert::Infallible;
          92  +
          93  +
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
          94  +
        ::std::result::Result::Ok(VideoFormat::from(s))
          95  +
    }
          96  +
}
          97  +
impl VideoFormat {
          98  +
    /// Returns the `&str` value of the enum member.
          99  +
    pub fn as_str(&self) -> &str {
         100  +
        match self {
         101  +
            VideoFormat::Flv => "flv",
         102  +
            VideoFormat::Mkv => "mkv",
         103  +
            VideoFormat::Mov => "mov",
         104  +
            VideoFormat::Mp4 => "mp4",
         105  +
            VideoFormat::Mpeg => "mpeg",
         106  +
            VideoFormat::Mpg => "mpg",
         107  +
            VideoFormat::ThreeGp => "three_gp",
         108  +
            VideoFormat::Webm => "webm",
         109  +
            VideoFormat::Wmv => "wmv",
         110  +
            VideoFormat::Unknown(value) => value.as_str(),
         111  +
        }
         112  +
    }
         113  +
    /// Returns all the `&str` representations of the enum members.
         114  +
    pub const fn values() -> &'static [&'static str] {
         115  +
        &["flv", "mkv", "mov", "mp4", "mpeg", "mpg", "three_gp", "webm", "wmv"]
         116  +
    }
         117  +
}
         118  +
impl ::std::convert::AsRef<str> for VideoFormat {
         119  +
    fn as_ref(&self) -> &str {
         120  +
        self.as_str()
         121  +
    }
         122  +
}
         123  +
impl VideoFormat {
         124  +
    /// Parses the enum value while disallowing unknown variants.
         125  +
    ///
         126  +
    /// Unknown variants will result in an error.
         127  +
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
         128  +
        match Self::from(value) {
         129  +
            #[allow(deprecated)]
         130  +
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
         131  +
            known => Ok(known),
         132  +
        }
         133  +
    }
         134  +
}
         135  +
impl ::std::fmt::Display for VideoFormat {
         136  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         137  +
        match self {
         138  +
            VideoFormat::Flv => write!(f, "flv"),
         139  +
            VideoFormat::Mkv => write!(f, "mkv"),
         140  +
            VideoFormat::Mov => write!(f, "mov"),
         141  +
            VideoFormat::Mp4 => write!(f, "mp4"),
         142  +
            VideoFormat::Mpeg => write!(f, "mpeg"),
         143  +
            VideoFormat::Mpg => write!(f, "mpg"),
         144  +
            VideoFormat::ThreeGp => write!(f, "three_gp"),
         145  +
            VideoFormat::Webm => write!(f, "webm"),
         146  +
            VideoFormat::Wmv => write!(f, "wmv"),
         147  +
            VideoFormat::Unknown(value) => write!(f, "{}", value),
         148  +
        }
         149  +
    }
         150  +
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/_video_source.rs

@@ -0,1 +0,52 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>A video source. You can upload a smaller video as a base64-encoded string as long as the encoded file is less than 25MB. You can also transfer videos up to 1GB in size from an S3 bucket.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub enum VideoSource {
           7  +
    /// <p>Video content encoded in base64.</p>
           8  +
    Bytes(::aws_smithy_types::Blob),
           9  +
    /// <p>The location of a video object in an Amazon S3 bucket. To see which models support S3 uploads, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html">Supported models and features for Converse</a>.</p>
          10  +
    S3Location(crate::types::S3Location),
          11  +
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          12  +
    /// An unknown enum variant
          13  +
    ///
          14  +
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
          15  +
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
          16  +
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
          17  +
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
          18  +
    #[non_exhaustive]
          19  +
    Unknown,
          20  +
}
          21  +
impl VideoSource {
          22  +
    /// Tries to convert the enum instance into [`Bytes`](crate::types::VideoSource::Bytes), extracting the inner [`Blob`](::aws_smithy_types::Blob).
          23  +
    /// Returns `Err(&Self)` if it can't be converted.
          24  +
    pub fn as_bytes(&self) -> ::std::result::Result<&::aws_smithy_types::Blob, &Self> {
          25  +
        if let VideoSource::Bytes(val) = &self {
          26  +
            ::std::result::Result::Ok(val)
          27  +
        } else {
          28  +
            ::std::result::Result::Err(self)
          29  +
        }
          30  +
    }
          31  +
    /// Returns true if this is a [`Bytes`](crate::types::VideoSource::Bytes).
          32  +
    pub fn is_bytes(&self) -> bool {
          33  +
        self.as_bytes().is_ok()
          34  +
    }
          35  +
    /// Tries to convert the enum instance into [`S3Location`](crate::types::VideoSource::S3Location), extracting the inner [`S3Location`](crate::types::S3Location).
          36  +
    /// Returns `Err(&Self)` if it can't be converted.
          37  +
    pub fn as_s3_location(&self) -> ::std::result::Result<&crate::types::S3Location, &Self> {
          38  +
        if let VideoSource::S3Location(val) = &self {
          39  +
            ::std::result::Result::Ok(val)
          40  +
        } else {
          41  +
            ::std::result::Result::Err(self)
          42  +
        }
          43  +
    }
          44  +
    /// Returns true if this is a [`S3Location`](crate::types::VideoSource::S3Location).
          45  +
    pub fn is_s3_location(&self) -> bool {
          46  +
        self.as_s3_location().is_ok()
          47  +
    }
          48  +
    /// Returns true if the enum instance is the `Unknown` variant.
          49  +
    pub fn is_unknown(&self) -> bool {
          50  +
        matches!(self, Self::Unknown)
          51  +
    }
          52  +
}

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

@@ -1,1 +0,140 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub use crate::types::_payload_part::PayloadPartBuilder;
    3      3   
           4  +
pub use crate::types::_bidirectional_output_payload_part::BidirectionalOutputPayloadPartBuilder;
           5  +
           6  +
pub use crate::types::_bidirectional_input_payload_part::BidirectionalInputPayloadPartBuilder;
           7  +
    4      8   
pub use crate::types::_converse_stream_metadata_event::ConverseStreamMetadataEventBuilder;
    5      9   
          10  +
pub use crate::types::_performance_configuration::PerformanceConfigurationBuilder;
          11  +
          12  +
pub use crate::types::_converse_stream_trace::ConverseStreamTraceBuilder;
          13  +
          14  +
pub use crate::types::_prompt_router_trace::PromptRouterTraceBuilder;
          15  +
          16  +
pub use crate::types::_guardrail_trace_assessment::GuardrailTraceAssessmentBuilder;
          17  +
          18  +
pub use crate::types::_guardrail_assessment::GuardrailAssessmentBuilder;
          19  +
          20  +
pub use crate::types::_guardrail_invocation_metrics::GuardrailInvocationMetricsBuilder;
          21  +
          22  +
pub use crate::types::_guardrail_coverage::GuardrailCoverageBuilder;
          23  +
          24  +
pub use crate::types::_guardrail_image_coverage::GuardrailImageCoverageBuilder;
          25  +
          26  +
pub use crate::types::_guardrail_text_characters_coverage::GuardrailTextCharactersCoverageBuilder;
          27  +
          28  +
pub use crate::types::_guardrail_usage::GuardrailUsageBuilder;
          29  +
          30  +
pub use crate::types::_guardrail_contextual_grounding_policy_assessment::GuardrailContextualGroundingPolicyAssessmentBuilder;
          31  +
          32  +
pub use crate::types::_guardrail_contextual_grounding_filter::GuardrailContextualGroundingFilterBuilder;
          33  +
          34  +
pub use crate::types::_guardrail_sensitive_information_policy_assessment::GuardrailSensitiveInformationPolicyAssessmentBuilder;
          35  +
          36  +
pub use crate::types::_guardrail_regex_filter::GuardrailRegexFilterBuilder;
          37  +
          38  +
pub use crate::types::_guardrail_pii_entity_filter::GuardrailPiiEntityFilterBuilder;
          39  +
          40  +
pub use crate::types::_guardrail_word_policy_assessment::GuardrailWordPolicyAssessmentBuilder;
          41  +
          42  +
pub use crate::types::_guardrail_managed_word::GuardrailManagedWordBuilder;
          43  +
          44  +
pub use crate::types::_guardrail_custom_word::GuardrailCustomWordBuilder;
          45  +
          46  +
pub use crate::types::_guardrail_content_policy_assessment::GuardrailContentPolicyAssessmentBuilder;
          47  +
          48  +
pub use crate::types::_guardrail_content_filter::GuardrailContentFilterBuilder;
          49  +
          50  +
pub use crate::types::_guardrail_topic_policy_assessment::GuardrailTopicPolicyAssessmentBuilder;
          51  +
          52  +
pub use crate::types::_guardrail_topic::GuardrailTopicBuilder;
          53  +
    6     54   
pub use crate::types::_converse_stream_metrics::ConverseStreamMetricsBuilder;
    7     55   
    8     56   
pub use crate::types::_token_usage::TokenUsageBuilder;
    9     57   
   10     58   
pub use crate::types::_message_stop_event::MessageStopEventBuilder;
   11     59   
   12     60   
pub use crate::types::_content_block_stop_event::ContentBlockStopEventBuilder;
   13     61   
   14     62   
pub use crate::types::_content_block_delta_event::ContentBlockDeltaEventBuilder;
   15     63   
          64  +
pub use crate::types::_citations_delta::CitationsDeltaBuilder;
          65  +
          66  +
pub use crate::types::_document_chunk_location::DocumentChunkLocationBuilder;
          67  +
          68  +
pub use crate::types::_document_page_location::DocumentPageLocationBuilder;
          69  +
          70  +
pub use crate::types::_document_char_location::DocumentCharLocationBuilder;
          71  +
          72  +
pub use crate::types::_citation_source_content_delta::CitationSourceContentDeltaBuilder;
          73  +
   16     74   
pub use crate::types::_tool_use_block_delta::ToolUseBlockDeltaBuilder;
   17     75   
   18     76   
pub use crate::types::_content_block_start_event::ContentBlockStartEventBuilder;
   19     77   
   20     78   
pub use crate::types::_tool_use_block_start::ToolUseBlockStartBuilder;
   21     79   
   22     80   
pub use crate::types::_message_start_event::MessageStartEventBuilder;
   23     81   
          82  +
pub use crate::types::_guardrail_stream_configuration::GuardrailStreamConfigurationBuilder;
          83  +
   24     84   
pub use crate::types::_tool_configuration::ToolConfigurationBuilder;
   25     85   
   26     86   
pub use crate::types::_specific_tool_choice::SpecificToolChoiceBuilder;
   27     87   
   28     88   
pub use crate::types::_any_tool_choice::AnyToolChoiceBuilder;
   29     89   
   30     90   
pub use crate::types::_auto_tool_choice::AutoToolChoiceBuilder;
   31     91   
          92  +
pub use crate::types::_cache_point_block::CachePointBlockBuilder;
          93  +
   32     94   
pub use crate::types::_tool_specification::ToolSpecificationBuilder;
   33     95   
   34     96   
pub use crate::types::_inference_configuration::InferenceConfigurationBuilder;
   35     97   
          98  +
pub use crate::types::_guardrail_converse_image_block::GuardrailConverseImageBlockBuilder;
          99  +
         100  +
pub use crate::types::_guardrail_converse_text_block::GuardrailConverseTextBlockBuilder;
         101  +
   36    102   
pub use crate::types::_message::MessageBuilder;
   37    103   
         104  +
pub use crate::types::_citations_content_block::CitationsContentBlockBuilder;
         105  +
         106  +
pub use crate::types::_citation::CitationBuilder;
         107  +
         108  +
pub use crate::types::_reasoning_text_block::ReasoningTextBlockBuilder;
         109  +
   38    110   
pub use crate::types::_tool_result_block::ToolResultBlockBuilder;
   39    111   
         112  +
pub use crate::types::_video_block::VideoBlockBuilder;
         113  +
         114  +
pub use crate::types::_s3_location::S3LocationBuilder;
         115  +
         116  +
pub use crate::types::_document_block::DocumentBlockBuilder;
         117  +
         118  +
pub use crate::types::_citations_config::CitationsConfigBuilder;
         119  +
   40    120   
pub use crate::types::_image_block::ImageBlockBuilder;
   41    121   
   42    122   
pub use crate::types::_tool_use_block::ToolUseBlockBuilder;
   43    123   
         124  +
pub use crate::types::_converse_trace::ConverseTraceBuilder;
         125  +
   44    126   
pub use crate::types::_converse_metrics::ConverseMetricsBuilder;
         127  +
         128  +
pub use crate::types::_guardrail_configuration::GuardrailConfigurationBuilder;
         129  +
         130  +
pub use crate::types::_guardrail_output_content::GuardrailOutputContentBuilder;
         131  +
         132  +
pub use crate::types::_guardrail_image_block::GuardrailImageBlockBuilder;
         133  +
         134  +
pub use crate::types::_guardrail_text_block::GuardrailTextBlockBuilder;
         135  +
         136  +
pub use crate::types::_tag::TagBuilder;
         137  +
         138  +
pub use crate::types::_async_invoke_s3_output_data_config::AsyncInvokeS3OutputDataConfigBuilder;
         139  +
         140  +
pub use crate::types::_async_invoke_summary::AsyncInvokeSummaryBuilder;

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/error.rs

@@ -1,1 +319,593 @@
    4      4   
pub use crate::types::error::_model_error_exception::ModelErrorException;
    5      5   
    6      6   
pub use crate::types::error::_model_not_ready_exception::ModelNotReadyException;
    7      7   
    8      8   
pub use crate::types::error::_validation_exception::ValidationException;
    9      9   
   10     10   
pub use crate::types::error::_model_stream_error_exception::ModelStreamErrorException;
   11     11   
   12     12   
pub use crate::types::error::_internal_server_exception::InternalServerException;
   13     13   
          14  +
pub use crate::types::error::_service_unavailable_exception::ServiceUnavailableException;
          15  +
   14     16   
pub use crate::types::error::_throttling_exception::ThrottlingException;
   15     17   
   16     18   
pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundException;
   17     19   
   18     20   
pub use crate::types::error::_access_denied_exception::AccessDeniedException;
   19     21   
   20     22   
pub use crate::types::error::_model_timeout_exception::ModelTimeoutException;
   21     23   
   22     24   
/// Error type for the `ResponseStreamError` operation.
   23     25   
#[non_exhaustive]
   24     26   
#[derive(::std::fmt::Debug)]
   25     27   
pub enum ResponseStreamError {
   26         -
    /// <p>An internal server error occurred. Retry your request.</p>
          28  +
    /// <p>An internal server error occurred. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
   27     29   
    InternalServerException(crate::types::error::InternalServerException),
   28     30   
    /// <p>An error occurred while streaming the response. Retry your request.</p>
   29     31   
    ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
   30         -
    /// <p>Input validation failed. Check your request parameters and retry the request.</p>
          32  +
    /// <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
   31     33   
    ValidationException(crate::types::error::ValidationException),
   32         -
    /// <p>The number of requests exceeds the limit. Resubmit your request later.</p>
          34  +
    /// <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
   33     35   
    ThrottlingException(crate::types::error::ThrottlingException),
   34     36   
    /// <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
   35     37   
    ModelTimeoutException(crate::types::error::ModelTimeoutException),
          38  +
    /// <p>The service isn't currently available. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable">ServiceUnavailable</a> in the Amazon Bedrock User Guide</p>
          39  +
    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
   36     40   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
   37     41   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
   38     42   
    variable wildcard pattern and check `.code()`:
   39     43   
     \
   40     44   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
   41     45   
     \
   42     46   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ResponseStreamError) for what information is available for the error.")]
   43     47   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
   44     48   
}
   45     49   
impl ResponseStreamError {
   46     50   
    /// Creates the `ResponseStreamError::Unhandled` variant from any error type.
   47     51   
    pub fn unhandled(
   48     52   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
   49     53   
    ) -> Self {
   50     54   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
   51     55   
            source: err.into(),
   52     56   
            meta: ::std::default::Default::default(),
   53     57   
        })
   54     58   
    }
   55     59   
   56     60   
    /// Creates the `ResponseStreamError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
   57     61   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
   58     62   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
   59     63   
            source: err.clone().into(),
   60     64   
            meta: err,
   61     65   
        })
   62     66   
    }
   63     67   
    ///
   64     68   
    /// Returns error metadata, which includes the error code, message,
   65     69   
    /// request ID, and potentially additional information.
   66     70   
    ///
   67     71   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
   68     72   
        match self {
   69     73   
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
   70     74   
            Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
   71     75   
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
   72     76   
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
   73     77   
            Self::ModelTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
          78  +
            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
   74     79   
            Self::Unhandled(e) => &e.meta,
   75     80   
        }
   76     81   
    }
   77     82   
    /// Returns `true` if the error kind is `ResponseStreamError::InternalServerException`.
   78     83   
    pub fn is_internal_server_exception(&self) -> bool {
   79     84   
        matches!(self, Self::InternalServerException(_))
   80     85   
    }
   81     86   
    /// Returns `true` if the error kind is `ResponseStreamError::ModelStreamErrorException`.
   82     87   
    pub fn is_model_stream_error_exception(&self) -> bool {
   83     88   
        matches!(self, Self::ModelStreamErrorException(_))
   84     89   
    }
   85     90   
    /// Returns `true` if the error kind is `ResponseStreamError::ValidationException`.
   86     91   
    pub fn is_validation_exception(&self) -> bool {
   87     92   
        matches!(self, Self::ValidationException(_))
   88     93   
    }
   89     94   
    /// Returns `true` if the error kind is `ResponseStreamError::ThrottlingException`.
   90     95   
    pub fn is_throttling_exception(&self) -> bool {
   91     96   
        matches!(self, Self::ThrottlingException(_))
   92     97   
    }
   93     98   
    /// Returns `true` if the error kind is `ResponseStreamError::ModelTimeoutException`.
   94     99   
    pub fn is_model_timeout_exception(&self) -> bool {
   95    100   
        matches!(self, Self::ModelTimeoutException(_))
   96    101   
    }
         102  +
    /// Returns `true` if the error kind is `ResponseStreamError::ServiceUnavailableException`.
         103  +
    pub fn is_service_unavailable_exception(&self) -> bool {
         104  +
        matches!(self, Self::ServiceUnavailableException(_))
         105  +
    }
   97    106   
}
   98    107   
impl ::std::error::Error for ResponseStreamError {
   99    108   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  100    109   
        match self {
  101    110   
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
  102    111   
            Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
  103    112   
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
  104    113   
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
  105    114   
            Self::ModelTimeoutException(_inner) => ::std::option::Option::Some(_inner),
         115  +
            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
  106    116   
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  107    117   
        }
  108    118   
    }
  109    119   
}
  110    120   
impl ::std::fmt::Display for ResponseStreamError {
  111    121   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  112    122   
        match self {
  113    123   
            Self::InternalServerException(_inner) => _inner.fmt(f),
  114    124   
            Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
  115    125   
            Self::ValidationException(_inner) => _inner.fmt(f),
  116    126   
            Self::ThrottlingException(_inner) => _inner.fmt(f),
  117    127   
            Self::ModelTimeoutException(_inner) => _inner.fmt(f),
         128  +
            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
  118    129   
            Self::Unhandled(_inner) => {
  119    130   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  120    131   
                    write!(f, "unhandled error ({code})")
  121    132   
                } else {
  122    133   
                    f.write_str("unhandled error")
  123    134   
                }
  124    135   
            }
  125    136   
        }
  126    137   
    }
  127    138   
}
  128    139   
impl ::aws_smithy_types::retry::ProvideErrorKind for ResponseStreamError {
  129    140   
    fn code(&self) -> ::std::option::Option<&str> {
  130    141   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  131    142   
    }
  132    143   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  133    144   
        ::std::option::Option::None
  134    145   
    }
  135    146   
}
  136    147   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResponseStreamError {
  137    148   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  138    149   
        match self {
  139    150   
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  140    151   
            Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  141    152   
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  142    153   
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  143    154   
            Self::ModelTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         155  +
            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  144    156   
            Self::Unhandled(_inner) => &_inner.meta,
  145    157   
        }
  146    158   
    }
  147    159   
}
  148    160   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ResponseStreamError {
  149    161   
    fn create_unhandled_error(
  150    162   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  151    163   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  152    164   
    ) -> Self {
  153    165   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  154    166   
            source,
  155    167   
            meta: meta.unwrap_or_default(),
  156    168   
        })
  157    169   
    }
  158    170   
}
  159    171   
impl ::aws_types::request_id::RequestId for crate::types::error::ResponseStreamError {
  160    172   
    fn request_id(&self) -> Option<&str> {
  161    173   
        self.meta().request_id()
  162    174   
    }
  163    175   
}
  164    176   
         177  +
/// Error type for the `InvokeModelWithBidirectionalStreamOutputError` operation.
         178  +
#[non_exhaustive]
         179  +
#[derive(::std::fmt::Debug)]
         180  +
pub enum InvokeModelWithBidirectionalStreamOutputError {
         181  +
    /// <p>An internal server error occurred. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
         182  +
    InternalServerException(crate::types::error::InternalServerException),
         183  +
    /// <p>An error occurred while streaming the response. Retry your request.</p>
         184  +
    ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
         185  +
    /// <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
         186  +
    ValidationException(crate::types::error::ValidationException),
         187  +
    /// <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
         188  +
    ThrottlingException(crate::types::error::ThrottlingException),
         189  +
    /// <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
         190  +
    ModelTimeoutException(crate::types::error::ModelTimeoutException),
         191  +
    /// <p>The service isn't currently available. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable">ServiceUnavailable</a> in the Amazon Bedrock User Guide</p>
         192  +
    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
         193  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         194  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         195  +
    variable wildcard pattern and check `.code()`:
         196  +
     \
         197  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         198  +
     \
         199  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeModelWithBidirectionalStreamOutputError) for what information is available for the error.")]
         200  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         201  +
}
         202  +
impl InvokeModelWithBidirectionalStreamOutputError {
         203  +
    /// Creates the `InvokeModelWithBidirectionalStreamOutputError::Unhandled` variant from any error type.
         204  +
    pub fn unhandled(
         205  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         206  +
    ) -> Self {
         207  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         208  +
            source: err.into(),
         209  +
            meta: ::std::default::Default::default(),
         210  +
        })
         211  +
    }
         212  +
         213  +
    /// Creates the `InvokeModelWithBidirectionalStreamOutputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         214  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         215  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         216  +
            source: err.clone().into(),
         217  +
            meta: err,
         218  +
        })
         219  +
    }
         220  +
    ///
         221  +
    /// Returns error metadata, which includes the error code, message,
         222  +
    /// request ID, and potentially additional information.
         223  +
    ///
         224  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         225  +
        match self {
         226  +
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         227  +
            Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         228  +
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         229  +
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         230  +
            Self::ModelTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         231  +
            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         232  +
            Self::Unhandled(e) => &e.meta,
         233  +
        }
         234  +
    }
         235  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamOutputError::InternalServerException`.
         236  +
    pub fn is_internal_server_exception(&self) -> bool {
         237  +
        matches!(self, Self::InternalServerException(_))
         238  +
    }
         239  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamOutputError::ModelStreamErrorException`.
         240  +
    pub fn is_model_stream_error_exception(&self) -> bool {
         241  +
        matches!(self, Self::ModelStreamErrorException(_))
         242  +
    }
         243  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamOutputError::ValidationException`.
         244  +
    pub fn is_validation_exception(&self) -> bool {
         245  +
        matches!(self, Self::ValidationException(_))
         246  +
    }
         247  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamOutputError::ThrottlingException`.
         248  +
    pub fn is_throttling_exception(&self) -> bool {
         249  +
        matches!(self, Self::ThrottlingException(_))
         250  +
    }
         251  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamOutputError::ModelTimeoutException`.
         252  +
    pub fn is_model_timeout_exception(&self) -> bool {
         253  +
        matches!(self, Self::ModelTimeoutException(_))
         254  +
    }
         255  +
    /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamOutputError::ServiceUnavailableException`.
         256  +
    pub fn is_service_unavailable_exception(&self) -> bool {
         257  +
        matches!(self, Self::ServiceUnavailableException(_))
         258  +
    }
         259  +
}
         260  +
impl ::std::error::Error for InvokeModelWithBidirectionalStreamOutputError {
         261  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         262  +
        match self {
         263  +
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
         264  +
            Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
         265  +
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
         266  +
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
         267  +
            Self::ModelTimeoutException(_inner) => ::std::option::Option::Some(_inner),
         268  +
            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
         269  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         270  +
        }
         271  +
    }
         272  +
}
         273  +
impl ::std::fmt::Display for InvokeModelWithBidirectionalStreamOutputError {
         274  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         275  +
        match self {
         276  +
            Self::InternalServerException(_inner) => _inner.fmt(f),
         277  +
            Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
         278  +
            Self::ValidationException(_inner) => _inner.fmt(f),
         279  +
            Self::ThrottlingException(_inner) => _inner.fmt(f),
         280  +
            Self::ModelTimeoutException(_inner) => _inner.fmt(f),
         281  +
            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
         282  +
            Self::Unhandled(_inner) => {
         283  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         284  +
                    write!(f, "unhandled error ({code})")
         285  +
                } else {
         286  +
                    f.write_str("unhandled error")
         287  +
                }
         288  +
            }
         289  +
        }
         290  +
    }
         291  +
}
         292  +
impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeModelWithBidirectionalStreamOutputError {
         293  +
    fn code(&self) -> ::std::option::Option<&str> {
         294  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         295  +
    }
         296  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         297  +
        ::std::option::Option::None
         298  +
    }
         299  +
}
         300  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeModelWithBidirectionalStreamOutputError {
         301  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         302  +
        match self {
         303  +
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         304  +
            Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         305  +
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         306  +
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         307  +
            Self::ModelTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         308  +
            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         309  +
            Self::Unhandled(_inner) => &_inner.meta,
         310  +
        }
         311  +
    }
         312  +
}
         313  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeModelWithBidirectionalStreamOutputError {
         314  +
    fn create_unhandled_error(
         315  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         316  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         317  +
    ) -> Self {
         318  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         319  +
            source,
         320  +
            meta: meta.unwrap_or_default(),
         321  +
        })
         322  +
    }
         323  +
}
         324  +
impl ::aws_types::request_id::RequestId for crate::types::error::InvokeModelWithBidirectionalStreamOutputError {
         325  +
    fn request_id(&self) -> Option<&str> {
         326  +
        self.meta().request_id()
         327  +
    }
         328  +
}
         329  +
         330  +
/// Error type for the `InvokeModelWithBidirectionalStreamInputError` operation.
         331  +
#[non_exhaustive]
         332  +
#[derive(::std::fmt::Debug)]
         333  +
pub enum InvokeModelWithBidirectionalStreamInputError {
         334  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         335  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         336  +
    variable wildcard pattern and check `.code()`:
         337  +
     \
         338  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         339  +
     \
         340  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeModelWithBidirectionalStreamInputError) for what information is available for the error.")]
         341  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         342  +
}
         343  +
impl InvokeModelWithBidirectionalStreamInputError {
         344  +
    /// Creates the `InvokeModelWithBidirectionalStreamInputError::Unhandled` variant from any error type.
         345  +
    pub fn unhandled(
         346  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         347  +
    ) -> Self {
         348  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         349  +
            source: err.into(),
         350  +
            meta: ::std::default::Default::default(),
         351  +
        })
         352  +
    }
         353  +
         354  +
    /// Creates the `InvokeModelWithBidirectionalStreamInputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         355  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         356  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         357  +
            source: err.clone().into(),
         358  +
            meta: err,
         359  +
        })
         360  +
    }
         361  +
    ///
         362  +
    /// Returns error metadata, which includes the error code, message,
         363  +
    /// request ID, and potentially additional information.
         364  +
    ///
         365  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         366  +
        match self {
         367  +
            Self::Unhandled(e) => &e.meta,
         368  +
        }
         369  +
    }
         370  +
}
         371  +
impl ::std::error::Error for InvokeModelWithBidirectionalStreamInputError {
         372  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         373  +
        match self {
         374  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         375  +
        }
         376  +
    }
         377  +
}
         378  +
impl ::std::fmt::Display for InvokeModelWithBidirectionalStreamInputError {
         379  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         380  +
        match self {
         381  +
            Self::Unhandled(_inner) => {
         382  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         383  +
                    write!(f, "unhandled error ({code})")
         384  +
                } else {
         385  +
                    f.write_str("unhandled error")
         386  +
                }
         387  +
            }
         388  +
        }
         389  +
    }
         390  +
}
         391  +
impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeModelWithBidirectionalStreamInputError {
         392  +
    fn code(&self) -> ::std::option::Option<&str> {
         393  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         394  +
    }
         395  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         396  +
        ::std::option::Option::None
         397  +
    }
         398  +
}
         399  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeModelWithBidirectionalStreamInputError {
         400  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         401  +
        match self {
         402  +
            Self::Unhandled(_inner) => &_inner.meta,
         403  +
        }
         404  +
    }
         405  +
}
         406  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeModelWithBidirectionalStreamInputError {
         407  +
    fn create_unhandled_error(
         408  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         409  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         410  +
    ) -> Self {
         411  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         412  +
            source,
         413  +
            meta: meta.unwrap_or_default(),
         414  +
        })
         415  +
    }
         416  +
}
         417  +
impl ::aws_types::request_id::RequestId for crate::types::error::InvokeModelWithBidirectionalStreamInputError {
         418  +
    fn request_id(&self) -> Option<&str> {
         419  +
        self.meta().request_id()
         420  +
    }
         421  +
}
         422  +
  165    423   
/// Error type for the `ConverseStreamOutputError` operation.
  166    424   
#[non_exhaustive]
  167    425   
#[derive(::std::fmt::Debug)]
  168    426   
pub enum ConverseStreamOutputError {
  169         -
    /// <p>An internal server error occurred. Retry your request.</p>
         427  +
    /// <p>An internal server error occurred. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
  170    428   
    InternalServerException(crate::types::error::InternalServerException),
  171    429   
    /// <p>An error occurred while streaming the response. Retry your request.</p>
  172    430   
    ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
  173         -
    /// <p>Input validation failed. Check your request parameters and retry the request.</p>
         431  +
    /// <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
  174    432   
    ValidationException(crate::types::error::ValidationException),
  175         -
    /// <p>The number of requests exceeds the limit. Resubmit your request later.</p>
         433  +
    /// <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
  176    434   
    ThrottlingException(crate::types::error::ThrottlingException),
         435  +
    /// <p>The service isn't currently available. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable">ServiceUnavailable</a> in the Amazon Bedrock User Guide</p>
         436  +
    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
  177    437   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  178    438   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  179    439   
    variable wildcard pattern and check `.code()`:
  180    440   
     \
  181    441   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  182    442   
     \
  183    443   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ConverseStreamOutputError) for what information is available for the error.")]
  184    444   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
  185    445   
}
  186    446   
impl ConverseStreamOutputError {
  187    447   
    /// Creates the `ConverseStreamOutputError::Unhandled` variant from any error type.
  188    448   
    pub fn unhandled(
  189    449   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  190    450   
    ) -> Self {
  191    451   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  192    452   
            source: err.into(),
  193    453   
            meta: ::std::default::Default::default(),
  194    454   
        })
  195    455   
    }
  196    456   
  197    457   
    /// Creates the `ConverseStreamOutputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  198    458   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  199    459   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  200    460   
            source: err.clone().into(),
  201    461   
            meta: err,
  202    462   
        })
  203    463   
    }
  204    464   
    ///
  205    465   
    /// Returns error metadata, which includes the error code, message,
  206    466   
    /// request ID, and potentially additional information.
  207    467   
    ///
  208    468   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  209    469   
        match self {
  210    470   
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  211    471   
            Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  212    472   
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  213    473   
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         474  +
            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  214    475   
            Self::Unhandled(e) => &e.meta,
  215    476   
        }
  216    477   
    }
  217    478   
    /// Returns `true` if the error kind is `ConverseStreamOutputError::InternalServerException`.
  218    479   
    pub fn is_internal_server_exception(&self) -> bool {
  219    480   
        matches!(self, Self::InternalServerException(_))
  220    481   
    }
  221    482   
    /// Returns `true` if the error kind is `ConverseStreamOutputError::ModelStreamErrorException`.
  222    483   
    pub fn is_model_stream_error_exception(&self) -> bool {
  223    484   
        matches!(self, Self::ModelStreamErrorException(_))
  224    485   
    }
  225    486   
    /// Returns `true` if the error kind is `ConverseStreamOutputError::ValidationException`.
  226    487   
    pub fn is_validation_exception(&self) -> bool {
  227    488   
        matches!(self, Self::ValidationException(_))
  228    489   
    }
  229    490   
    /// Returns `true` if the error kind is `ConverseStreamOutputError::ThrottlingException`.
  230    491   
    pub fn is_throttling_exception(&self) -> bool {
  231    492   
        matches!(self, Self::ThrottlingException(_))
  232    493   
    }
         494  +
    /// Returns `true` if the error kind is `ConverseStreamOutputError::ServiceUnavailableException`.
         495  +
    pub fn is_service_unavailable_exception(&self) -> bool {
         496  +
        matches!(self, Self::ServiceUnavailableException(_))
         497  +
    }
  233    498   
}
  234    499   
impl ::std::error::Error for ConverseStreamOutputError {
  235    500   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  236    501   
        match self {
  237    502   
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
  238    503   
            Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
  239    504   
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
  240    505   
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
         506  +
            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
  241    507   
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  242    508   
        }
  243    509   
    }
  244    510   
}
  245    511   
impl ::std::fmt::Display for ConverseStreamOutputError {
  246    512   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  247    513   
        match self {
  248    514   
            Self::InternalServerException(_inner) => _inner.fmt(f),
  249    515   
            Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
  250    516   
            Self::ValidationException(_inner) => _inner.fmt(f),
  251    517   
            Self::ThrottlingException(_inner) => _inner.fmt(f),
         518  +
            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
  252    519   
            Self::Unhandled(_inner) => {
  253    520   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  254    521   
                    write!(f, "unhandled error ({code})")
  255    522   
                } else {
  256    523   
                    f.write_str("unhandled error")
  257    524   
                }
  258    525   
            }
  259    526   
        }
  260    527   
    }
  261    528   
}
  262    529   
impl ::aws_smithy_types::retry::ProvideErrorKind for ConverseStreamOutputError {
  263    530   
    fn code(&self) -> ::std::option::Option<&str> {
  264    531   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  265    532   
    }
  266    533   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  267    534   
        ::std::option::Option::None
  268    535   
    }
  269    536   
}
  270    537   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ConverseStreamOutputError {
  271    538   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  272    539   
        match self {
  273    540   
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  274    541   
            Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  275    542   
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  276    543   
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         544  +
            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  277    545   
            Self::Unhandled(_inner) => &_inner.meta,
  278    546   
        }
  279    547   
    }
  280    548   
}
  281    549   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ConverseStreamOutputError {
  282    550   
    fn create_unhandled_error(
  283    551   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  284    552   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  285    553   
    ) -> Self {
  286    554   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  287    555   
            source,
  288    556   
            meta: meta.unwrap_or_default(),
  289    557   
        })
  290    558   
    }
  291    559   
}
  292    560   
impl ::aws_types::request_id::RequestId for crate::types::error::ConverseStreamOutputError {
  293    561   
    fn request_id(&self) -> Option<&str> {
  294    562   
        self.meta().request_id()
  295    563   
    }
  296    564   
}
  297    565   
         566  +
pub use crate::types::error::_conflict_exception::ConflictException;
         567  +
  298    568   
mod _access_denied_exception;
  299    569   
         570  +
mod _conflict_exception;
         571  +
  300    572   
mod _internal_server_exception;
  301    573   
  302    574   
mod _model_error_exception;
  303    575   
  304    576   
mod _model_not_ready_exception;
  305    577   
  306    578   
mod _model_stream_error_exception;
  307    579   
  308    580   
mod _model_timeout_exception;
  309    581   
  310    582   
mod _resource_not_found_exception;
  311    583   
  312    584   
mod _service_quota_exceeded_exception;
  313    585   
         586  +
mod _service_unavailable_exception;
         587  +
  314    588   
mod _throttling_exception;
  315    589   
  316    590   
mod _validation_exception;
  317    591   
  318    592   
/// Builders
  319    593   
pub mod builders;

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/error/_access_denied_exception.rs

@@ -1,1 +33,33 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// <p>The request is denied because of missing access permissions.</p>
           3  +
/// <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied">AccessDeniedException</a> in the Amazon Bedrock User Guide</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub struct AccessDeniedException {
    7      7   
    #[allow(missing_docs)] // documentation missing in model
    8      8   
    pub message: ::std::option::Option<::std::string::String>,
    9      9   
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
   10     10   
}
   11     11   
impl AccessDeniedException {
   12     12   
    /// Returns the error message.
   13     13   
    pub fn message(&self) -> ::std::option::Option<&str> {

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/error/_conflict_exception.rs

@@ -0,1 +0,87 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Error occurred because of a conflict while performing an operation.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct ConflictException {
           7  +
    #[allow(missing_docs)] // documentation missing in model
           8  +
    pub message: ::std::option::Option<::std::string::String>,
           9  +
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          10  +
}
          11  +
impl ConflictException {
          12  +
    /// Returns the error message.
          13  +
    pub fn message(&self) -> ::std::option::Option<&str> {
          14  +
        self.message.as_deref()
          15  +
    }
          16  +
}
          17  +
impl ::std::fmt::Display for ConflictException {
          18  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          19  +
        ::std::write!(f, "ConflictException")?;
          20  +
        if let ::std::option::Option::Some(inner_1) = &self.message {
          21  +
            {
          22  +
                ::std::write!(f, ": {}", inner_1)?;
          23  +
            }
          24  +
        }
          25  +
        Ok(())
          26  +
    }
          27  +
}
          28  +
impl ::std::error::Error for ConflictException {}
          29  +
impl ::aws_types::request_id::RequestId for crate::types::error::ConflictException {
          30  +
    fn request_id(&self) -> Option<&str> {
          31  +
        use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
          32  +
        self.meta().request_id()
          33  +
    }
          34  +
}
          35  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ConflictException {
          36  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
          37  +
        &self.meta
          38  +
    }
          39  +
}
          40  +
impl ConflictException {
          41  +
    /// Creates a new builder-style object to manufacture [`ConflictException`](crate::types::error::ConflictException).
          42  +
    pub fn builder() -> crate::types::error::builders::ConflictExceptionBuilder {
          43  +
        crate::types::error::builders::ConflictExceptionBuilder::default()
          44  +
    }
          45  +
}
          46  +
          47  +
/// A builder for [`ConflictException`](crate::types::error::ConflictException).
          48  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          49  +
#[non_exhaustive]
          50  +
pub struct ConflictExceptionBuilder {
          51  +
    pub(crate) message: ::std::option::Option<::std::string::String>,
          52  +
    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          53  +
}
          54  +
impl ConflictExceptionBuilder {
          55  +
    #[allow(missing_docs)] // documentation missing in model
          56  +
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          57  +
        self.message = ::std::option::Option::Some(input.into());
          58  +
        self
          59  +
    }
          60  +
    #[allow(missing_docs)] // documentation missing in model
          61  +
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          62  +
        self.message = input;
          63  +
        self
          64  +
    }
          65  +
    #[allow(missing_docs)] // documentation missing in model
          66  +
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
          67  +
        &self.message
          68  +
    }
          69  +
    /// Sets error metadata
          70  +
    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
          71  +
        self.meta = Some(meta);
          72  +
        self
          73  +
    }
          74  +
          75  +
    /// Sets error metadata
          76  +
    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
          77  +
        self.meta = meta;
          78  +
        self
          79  +
    }
          80  +
    /// Consumes the builder and constructs a [`ConflictException`](crate::types::error::ConflictException).
          81  +
    pub fn build(self) -> crate::types::error::ConflictException {
          82  +
        crate::types::error::ConflictException {
          83  +
            message: self.message,
          84  +
            meta: self.meta.unwrap_or_default(),
          85  +
        }
          86  +
    }
          87  +
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/error/_internal_server_exception.rs

@@ -1,1 +33,33 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// <p>An internal server error occurred. Retry your request.</p>
           3  +
/// <p>An internal server error occurred. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub struct InternalServerException {
    7      7   
    #[allow(missing_docs)] // documentation missing in model
    8      8   
    pub message: ::std::option::Option<::std::string::String>,
    9      9   
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
   10     10   
}
   11     11   
impl InternalServerException {
   12     12   
    /// Returns the error message.
   13     13   
    pub fn message(&self) -> ::std::option::Option<&str> {

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/error/_model_not_ready_exception.rs

@@ -1,1 +41,45 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// <p>The model specified in the request is not ready to serve inference requests.</p>
           3  +
/// <p>The model specified in the request is not ready to serve inference requests. The AWS SDK will automatically retry the operation up to 5 times. For information about configuring automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i> reference guide.</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub struct ModelNotReadyException {
    7      7   
    #[allow(missing_docs)] // documentation missing in model
    8      8   
    pub message: ::std::option::Option<::std::string::String>,
    9      9   
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
   10     10   
}
   11     11   
impl ModelNotReadyException {
          12  +
    /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`.
          13  +
    pub fn retryable_error_kind(&self) -> ::aws_smithy_types::retry::ErrorKind {
          14  +
        ::aws_smithy_types::retry::ErrorKind::ClientError
          15  +
    }
   12     16   
    /// Returns the error message.
   13     17   
    pub fn message(&self) -> ::std::option::Option<&str> {
   14     18   
        self.message.as_deref()
   15     19   
    }
   16     20   
}
   17     21   
impl ::std::fmt::Display for ModelNotReadyException {
   18     22   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   19     23   
        ::std::write!(f, "ModelNotReadyException")?;
   20     24   
        if let ::std::option::Option::Some(inner_1) = &self.message {
   21     25   
            {

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/error/_resource_not_found_exception.rs

@@ -1,1 +33,33 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
           3  +
/// <p>The specified resource ARN was not found. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found">ResourceNotFound</a> in the Amazon Bedrock User Guide</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub struct ResourceNotFoundException {
    7      7   
    #[allow(missing_docs)] // documentation missing in model
    8      8   
    pub message: ::std::option::Option<::std::string::String>,
    9      9   
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
   10     10   
}
   11     11   
impl ResourceNotFoundException {
   12     12   
    /// Returns the error message.
   13     13   
    pub fn message(&self) -> ::std::option::Option<&str> {

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/error/_service_quota_exceeded_exception.rs

@@ -1,1 +33,33 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
           3  +
/// <p>Your request exceeds the service quota for your account. You can view your quotas at <a href="https://docs.aws.amazon.com/servicequotas/latest/userguide/gs-request-quota.html">Viewing service quotas</a>. You can resubmit your request later.</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub struct ServiceQuotaExceededException {
    7      7   
    #[allow(missing_docs)] // documentation missing in model
    8      8   
    pub message: ::std::option::Option<::std::string::String>,
    9      9   
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
   10     10   
}
   11     11   
impl ServiceQuotaExceededException {
   12     12   
    /// Returns the error message.
   13     13   
    pub fn message(&self) -> ::std::option::Option<&str> {

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/error/_service_unavailable_exception.rs

@@ -0,1 +0,87 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>The service isn't currently available. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable">ServiceUnavailable</a> in the Amazon Bedrock User Guide</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct ServiceUnavailableException {
           7  +
    #[allow(missing_docs)] // documentation missing in model
           8  +
    pub message: ::std::option::Option<::std::string::String>,
           9  +
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          10  +
}
          11  +
impl ServiceUnavailableException {
          12  +
    /// Returns the error message.
          13  +
    pub fn message(&self) -> ::std::option::Option<&str> {
          14  +
        self.message.as_deref()
          15  +
    }
          16  +
}
          17  +
impl ::std::fmt::Display for ServiceUnavailableException {
          18  +
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          19  +
        ::std::write!(f, "ServiceUnavailableException")?;
          20  +
        if let ::std::option::Option::Some(inner_1) = &self.message {
          21  +
            {
          22  +
                ::std::write!(f, ": {}", inner_1)?;
          23  +
            }
          24  +
        }
          25  +
        Ok(())
          26  +
    }
          27  +
}
          28  +
impl ::std::error::Error for ServiceUnavailableException {}
          29  +
impl ::aws_types::request_id::RequestId for crate::types::error::ServiceUnavailableException {
          30  +
    fn request_id(&self) -> Option<&str> {
          31  +
        use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
          32  +
        self.meta().request_id()
          33  +
    }
          34  +
}
          35  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ServiceUnavailableException {
          36  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
          37  +
        &self.meta
          38  +
    }
          39  +
}
          40  +
impl ServiceUnavailableException {
          41  +
    /// Creates a new builder-style object to manufacture [`ServiceUnavailableException`](crate::types::error::ServiceUnavailableException).
          42  +
    pub fn builder() -> crate::types::error::builders::ServiceUnavailableExceptionBuilder {
          43  +
        crate::types::error::builders::ServiceUnavailableExceptionBuilder::default()
          44  +
    }
          45  +
}
          46  +
          47  +
/// A builder for [`ServiceUnavailableException`](crate::types::error::ServiceUnavailableException).
          48  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          49  +
#[non_exhaustive]
          50  +
pub struct ServiceUnavailableExceptionBuilder {
          51  +
    pub(crate) message: ::std::option::Option<::std::string::String>,
          52  +
    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          53  +
}
          54  +
impl ServiceUnavailableExceptionBuilder {
          55  +
    #[allow(missing_docs)] // documentation missing in model
          56  +
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          57  +
        self.message = ::std::option::Option::Some(input.into());
          58  +
        self
          59  +
    }
          60  +
    #[allow(missing_docs)] // documentation missing in model
          61  +
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          62  +
        self.message = input;
          63  +
        self
          64  +
    }
          65  +
    #[allow(missing_docs)] // documentation missing in model
          66  +
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
          67  +
        &self.message
          68  +
    }
          69  +
    /// Sets error metadata
          70  +
    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
          71  +
        self.meta = Some(meta);
          72  +
        self
          73  +
    }
          74  +
          75  +
    /// Sets error metadata
          76  +
    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
          77  +
        self.meta = meta;
          78  +
        self
          79  +
    }
          80  +
    /// Consumes the builder and constructs a [`ServiceUnavailableException`](crate::types::error::ServiceUnavailableException).
          81  +
    pub fn build(self) -> crate::types::error::ServiceUnavailableException {
          82  +
        crate::types::error::ServiceUnavailableException {
          83  +
            message: self.message,
          84  +
            meta: self.meta.unwrap_or_default(),
          85  +
        }
          86  +
    }
          87  +
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/error/_throttling_exception.rs

@@ -1,1 +33,33 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// <p>The number of requests exceeds the limit. Resubmit your request later.</p>
           3  +
/// <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub struct ThrottlingException {
    7      7   
    #[allow(missing_docs)] // documentation missing in model
    8      8   
    pub message: ::std::option::Option<::std::string::String>,
    9      9   
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
   10     10   
}
   11     11   
impl ThrottlingException {
   12     12   
    /// Returns the error message.
   13     13   
    pub fn message(&self) -> ::std::option::Option<&str> {

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/error/_validation_exception.rs

@@ -1,1 +33,33 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// <p>Input validation failed. Check your request parameters and retry the request.</p>
           3  +
/// <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub struct ValidationException {
    7      7   
    #[allow(missing_docs)] // documentation missing in model
    8      8   
    pub message: ::std::option::Option<::std::string::String>,
    9      9   
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
   10     10   
}
   11     11   
impl ValidationException {
   12     12   
    /// Returns the error message.
   13     13   
    pub fn message(&self) -> ::std::option::Option<&str> {

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/error/builders.rs

@@ -1,1 +0,24 @@
    4      4   
pub use crate::types::error::_model_error_exception::ModelErrorExceptionBuilder;
    5      5   
    6      6   
pub use crate::types::error::_model_not_ready_exception::ModelNotReadyExceptionBuilder;
    7      7   
    8      8   
pub use crate::types::error::_validation_exception::ValidationExceptionBuilder;
    9      9   
   10     10   
pub use crate::types::error::_model_stream_error_exception::ModelStreamErrorExceptionBuilder;
   11     11   
   12     12   
pub use crate::types::error::_internal_server_exception::InternalServerExceptionBuilder;
   13     13   
          14  +
pub use crate::types::error::_service_unavailable_exception::ServiceUnavailableExceptionBuilder;
          15  +
   14     16   
pub use crate::types::error::_throttling_exception::ThrottlingExceptionBuilder;
   15     17   
   16     18   
pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundExceptionBuilder;
   17     19   
   18     20   
pub use crate::types::error::_access_denied_exception::AccessDeniedExceptionBuilder;
   19     21   
   20     22   
pub use crate::types::error::_model_timeout_exception::ModelTimeoutExceptionBuilder;
          23  +
          24  +
pub use crate::types::error::_conflict_exception::ConflictExceptionBuilder;

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/tests/environment_token_provider.rs

@@ -0,1 +0,149 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
           6  +
use aws_runtime::env_config::EnvConfigValue;
           7  +
use aws_runtime::user_agent::test_util::{
           8  +
    assert_ua_contains_metric_values, assert_ua_does_not_contain_metric_values,
           9  +
};
          10  +
use aws_sdk_bedrockruntime::config::{Region, Token};
          11  +
use aws_sdk_bedrockruntime::error::DisplayErrorContext;
          12  +
use aws_smithy_http_client::test_util::capture_request;
          13  +
use aws_smithy_runtime::assert_str_contains;
          14  +
use aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID;
          15  +
use aws_types::origin::Origin;
          16  +
use aws_types::os_shim_internal::Env;
          17  +
use aws_types::service_config::{LoadServiceConfig, ServiceConfigKey};
          18  +
use aws_types::SdkConfig;
          19  +
          20  +
#[derive(Debug)]
          21  +
struct TestEnv {
          22  +
    env: Env,
          23  +
}
          24  +
          25  +
impl LoadServiceConfig for TestEnv {
          26  +
    fn load_config(&self, key: ServiceConfigKey<'_>) -> Option<String> {
          27  +
        let (value, _source) = EnvConfigValue::new()
          28  +
            .env(key.env())
          29  +
            .profile(key.profile())
          30  +
            .service_id(key.service_id())
          31  +
            .load(&self.env, None)?;
          32  +
          33  +
        Some(value.to_string())
          34  +
    }
          35  +
}
          36  +
          37  +
#[tokio::test]
          38  +
async fn test_valid_service_specific_token_configured() {
          39  +
    let (http_client, captured_request) = capture_request(None);
          40  +
    let expected_token = "bedrock-token";
          41  +
    let shared_config = SdkConfig::builder()
          42  +
        .region(Region::new("us-west-2"))
          43  +
        .http_client(http_client)
          44  +
        .service_config(TestEnv {
          45  +
            env: Env::from_slice(&[("AWS_BEARER_TOKEN_BEDROCK", expected_token)]),
          46  +
        })
          47  +
        .build();
          48  +
    let client = aws_sdk_bedrockruntime::Client::new(&shared_config);
          49  +
    let _ = client
          50  +
        .get_async_invoke()
          51  +
        .invocation_arn("arn:aws:bedrock:us-west-2:123456789012:invoke/ExampleModel")
          52  +
        .send()
          53  +
        .await;
          54  +
    let request = captured_request.expect_request();
          55  +
    let authorization_header = request.headers().get("authorization").unwrap();
          56  +
    assert!(authorization_header.starts_with(&format!("Bearer {expected_token}")));
          57  +
          58  +
    // Verify that the user agent contains the expected metric value (BEARER_SERVICE_ENV_VARS: 3)
          59  +
    let user_agent = request.headers().get("x-amz-user-agent").unwrap();
          60  +
    assert_ua_contains_metric_values(user_agent, &["3"]);
          61  +
}
          62  +
          63  +
#[tokio::test]
          64  +
async fn test_token_configured_for_different_service() {
          65  +
    let (http_client, _) = capture_request(None);
          66  +
    let shared_config = SdkConfig::builder()
          67  +
        .region(Region::new("us-west-2"))
          68  +
        .http_client(http_client)
          69  +
        .service_config(TestEnv {
          70  +
            env: Env::from_slice(&[("AWS_BEARER_TOKEN_FOO", "foo-token")]),
          71  +
        })
          72  +
        .build();
          73  +
    let client = aws_sdk_bedrockruntime::Client::new(&shared_config);
          74  +
    let err = client
          75  +
        .get_async_invoke()
          76  +
        .invocation_arn("arn:aws:bedrock:us-west-2:123456789012:invoke/ExampleModel")
          77  +
        .send()
          78  +
        .await
          79  +
        .unwrap_err();
          80  +
    assert_str_contains!(
          81  +
        format!("{}", DisplayErrorContext(err)),
          82  +
        "failed to select an auth scheme to sign the request with."
          83  +
    );
          84  +
}
          85  +
          86  +
#[tokio::test]
          87  +
async fn test_token_configured_with_auth_scheme_preference_also_set_in_env() {
          88  +
    let (http_client, captured_request) = capture_request(None);
          89  +
    let expected_token = "bedrock-token";
          90  +
    let mut shared_config = SdkConfig::builder()
          91  +
        .region(Region::new("us-west-2"))
          92  +
        .http_client(http_client)
          93  +
        .service_config(TestEnv {
          94  +
            env: Env::from_slice(&[("AWS_BEARER_TOKEN_BEDROCK", expected_token)]),
          95  +
        })
          96  +
        .auth_scheme_preference([
          97  +
            aws_runtime::auth::sigv4::SCHEME_ID,
          98  +
            HTTP_BEARER_AUTH_SCHEME_ID,
          99  +
        ]);
         100  +
    // Pretend as if the auth scheme preference were set through the environment variable
         101  +
    shared_config.insert_origin(
         102  +
        "auth_scheme_preference",
         103  +
        Origin::shared_environment_variable(),
         104  +
    );
         105  +
    let shared_config = shared_config.build();
         106  +
    let client = aws_sdk_bedrockruntime::Client::new(&shared_config);
         107  +
    let _ = client
         108  +
        .get_async_invoke()
         109  +
        .invocation_arn("arn:aws:bedrock:us-west-2:123456789012:invoke/ExampleModel")
         110  +
        .send()
         111  +
        .await;
         112  +
    let request = captured_request.expect_request();
         113  +
    let authorization_header = request.headers().get("authorization").unwrap();
         114  +
    assert!(authorization_header.starts_with(&format!("Bearer {expected_token}")));
         115  +
         116  +
    // Verify that the user agent contains the expected metric value (BEARER_SERVICE_ENV_VARS: 3)
         117  +
    let user_agent = request.headers().get("x-amz-user-agent").unwrap();
         118  +
    assert_ua_contains_metric_values(user_agent, &["3"]);
         119  +
}
         120  +
         121  +
#[tokio::test]
         122  +
async fn test_explicit_service_config_takes_precedence() {
         123  +
    let (http_client, captured_request) = capture_request(None);
         124  +
    let shared_config = SdkConfig::builder()
         125  +
        .region(Region::new("us-west-2"))
         126  +
        .http_client(http_client)
         127  +
        .service_config(TestEnv {
         128  +
            env: Env::from_slice(&[("AWS_BEARER_TOKEN_BEDROCK", "bedrock-token")]),
         129  +
        })
         130  +
        .build();
         131  +
    let expected_token = "explicit-code-token";
         132  +
    let conf = aws_sdk_bedrockruntime::config::Builder::from(&shared_config)
         133  +
        .token_provider(Token::new(expected_token, None))
         134  +
        .build();
         135  +
    let client = aws_sdk_bedrockruntime::Client::from_conf(conf);
         136  +
    let _ = client
         137  +
        .get_async_invoke()
         138  +
        .invocation_arn("arn:aws:bedrock:us-west-2:123456789012:invoke/ExampleModel")
         139  +
        .send()
         140  +
        .await;
         141  +
    let request = captured_request.expect_request();
         142  +
    let authorization_header = request.headers().get("authorization").unwrap();
         143  +
    assert!(authorization_header.starts_with(&format!("Bearer {expected_token}")));
         144  +
         145  +
    // Verify that the user agent does NOT contain the expected metric value (BEARER_SERVICE_ENV_VARS: 3)
         146  +
    // since the token explicitly set in code was used.
         147  +
    let user_agent = request.headers().get("x-amz-user-agent").unwrap();
         148  +
    assert_ua_does_not_contain_metric_values(user_agent, &["3"]);
         149  +
}