AWS SDK

AWS SDK

rev. ba98f30b52e51c6e715b0ae469e7a2e988c27d9a

Files changed:

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

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

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

@@ -1,0 +52,0 @@
    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 +140,0 @@
    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         -
    8      4   
pub use crate::types::_converse_stream_metadata_event::ConverseStreamMetadataEventBuilder;
    9      5   
   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         -
   54      6   
pub use crate::types::_converse_stream_metrics::ConverseStreamMetricsBuilder;
   55      7   
   56      8   
pub use crate::types::_token_usage::TokenUsageBuilder;
   57      9   
   58     10   
pub use crate::types::_message_stop_event::MessageStopEventBuilder;
   59     11   
   60     12   
pub use crate::types::_content_block_stop_event::ContentBlockStopEventBuilder;
   61     13   
   62     14   
pub use crate::types::_content_block_delta_event::ContentBlockDeltaEventBuilder;
   63     15   
   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         -
   74     16   
pub use crate::types::_tool_use_block_delta::ToolUseBlockDeltaBuilder;
   75     17   
   76     18   
pub use crate::types::_content_block_start_event::ContentBlockStartEventBuilder;
   77     19   
   78     20   
pub use crate::types::_tool_use_block_start::ToolUseBlockStartBuilder;
   79     21   
   80     22   
pub use crate::types::_message_start_event::MessageStartEventBuilder;
   81     23   
   82         -
pub use crate::types::_guardrail_stream_configuration::GuardrailStreamConfigurationBuilder;
   83         -
   84     24   
pub use crate::types::_tool_configuration::ToolConfigurationBuilder;
   85     25   
   86     26   
pub use crate::types::_specific_tool_choice::SpecificToolChoiceBuilder;
   87     27   
   88     28   
pub use crate::types::_any_tool_choice::AnyToolChoiceBuilder;
   89     29   
   90     30   
pub use crate::types::_auto_tool_choice::AutoToolChoiceBuilder;
   91     31   
   92         -
pub use crate::types::_cache_point_block::CachePointBlockBuilder;
   93         -
   94     32   
pub use crate::types::_tool_specification::ToolSpecificationBuilder;
   95     33   
   96     34   
pub use crate::types::_inference_configuration::InferenceConfigurationBuilder;
   97     35   
   98         -
pub use crate::types::_guardrail_converse_image_block::GuardrailConverseImageBlockBuilder;
   99         -
  100         -
pub use crate::types::_guardrail_converse_text_block::GuardrailConverseTextBlockBuilder;
  101         -
  102     36   
pub use crate::types::_message::MessageBuilder;
  103     37   
  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         -
  110     38   
pub use crate::types::_tool_result_block::ToolResultBlockBuilder;
  111     39   
  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         -
  120     40   
pub use crate::types::_image_block::ImageBlockBuilder;
  121     41   
  122     42   
pub use crate::types::_tool_use_block::ToolUseBlockBuilder;
  123     43   
  124         -
pub use crate::types::_converse_trace::ConverseTraceBuilder;
  125         -
  126     44   
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 +593,319 @@
    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         -
   16     14   
pub use crate::types::error::_throttling_exception::ThrottlingException;
   17     15   
   18     16   
pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundException;
   19     17   
   20     18   
pub use crate::types::error::_access_denied_exception::AccessDeniedException;
   21     19   
   22     20   
pub use crate::types::error::_model_timeout_exception::ModelTimeoutException;
   23     21   
   24     22   
/// Error type for the `ResponseStreamError` operation.
   25     23   
#[non_exhaustive]
   26     24   
#[derive(::std::fmt::Debug)]
   27     25   
pub enum ResponseStreamError {
   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>
          26  +
    /// <p>An internal server error occurred. Retry your request.</p>
   29     27   
    InternalServerException(crate::types::error::InternalServerException),
   30     28   
    /// <p>An error occurred while streaming the response. Retry your request.</p>
   31     29   
    ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
   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>
          30  +
    /// <p>Input validation failed. Check your request parameters and retry the request.</p>
   33     31   
    ValidationException(crate::types::error::ValidationException),
   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>
          32  +
    /// <p>The number of requests exceeds the limit. Resubmit your request later.</p>
   35     33   
    ThrottlingException(crate::types::error::ThrottlingException),
   36     34   
    /// <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
   37     35   
    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),
   40     36   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
   41     37   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
   42     38   
    variable wildcard pattern and check `.code()`:
   43     39   
     \
   44     40   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
   45     41   
     \
   46     42   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ResponseStreamError) for what information is available for the error.")]
   47     43   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
   48     44   
}
   49     45   
impl ResponseStreamError {
   50     46   
    /// Creates the `ResponseStreamError::Unhandled` variant from any error type.
   51     47   
    pub fn unhandled(
   52     48   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
   53     49   
    ) -> Self {
   54     50   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
   55     51   
            source: err.into(),
   56     52   
            meta: ::std::default::Default::default(),
   57     53   
        })
   58     54   
    }
   59     55   
   60     56   
    /// Creates the `ResponseStreamError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
   61     57   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
   62     58   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
   63     59   
            source: err.clone().into(),
   64     60   
            meta: err,
   65     61   
        })
   66     62   
    }
   67     63   
    ///
   68     64   
    /// Returns error metadata, which includes the error code, message,
   69     65   
    /// request ID, and potentially additional information.
   70     66   
    ///
   71     67   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
   72     68   
        match self {
   73     69   
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
   74     70   
            Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
   75     71   
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
   76     72   
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
   77     73   
            Self::ModelTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
   78         -
            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
   79     74   
            Self::Unhandled(e) => &e.meta,
   80     75   
        }
   81     76   
    }
   82     77   
    /// Returns `true` if the error kind is `ResponseStreamError::InternalServerException`.
   83     78   
    pub fn is_internal_server_exception(&self) -> bool {
   84     79   
        matches!(self, Self::InternalServerException(_))
   85     80   
    }
   86     81   
    /// Returns `true` if the error kind is `ResponseStreamError::ModelStreamErrorException`.
   87     82   
    pub fn is_model_stream_error_exception(&self) -> bool {
   88     83   
        matches!(self, Self::ModelStreamErrorException(_))
   89     84   
    }
   90     85   
    /// Returns `true` if the error kind is `ResponseStreamError::ValidationException`.
   91     86   
    pub fn is_validation_exception(&self) -> bool {
   92     87   
        matches!(self, Self::ValidationException(_))
   93     88   
    }
   94     89   
    /// Returns `true` if the error kind is `ResponseStreamError::ThrottlingException`.
   95     90   
    pub fn is_throttling_exception(&self) -> bool {
   96     91   
        matches!(self, Self::ThrottlingException(_))
   97     92   
    }
   98     93   
    /// Returns `true` if the error kind is `ResponseStreamError::ModelTimeoutException`.
   99     94   
    pub fn is_model_timeout_exception(&self) -> bool {
  100     95   
        matches!(self, Self::ModelTimeoutException(_))
  101     96   
    }
  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         -
    }
  106     97   
}
  107     98   
impl ::std::error::Error for ResponseStreamError {
  108     99   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  109    100   
        match self {
  110    101   
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
  111    102   
            Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
  112    103   
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
  113    104   
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
  114    105   
            Self::ModelTimeoutException(_inner) => ::std::option::Option::Some(_inner),
  115         -
            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
  116    106   
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  117    107   
        }
  118    108   
    }
  119    109   
}
  120    110   
impl ::std::fmt::Display for ResponseStreamError {
  121    111   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  122    112   
        match self {
  123    113   
            Self::InternalServerException(_inner) => _inner.fmt(f),
  124    114   
            Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
  125    115   
            Self::ValidationException(_inner) => _inner.fmt(f),
  126    116   
            Self::ThrottlingException(_inner) => _inner.fmt(f),
  127    117   
            Self::ModelTimeoutException(_inner) => _inner.fmt(f),
  128         -
            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
  129    118   
            Self::Unhandled(_inner) => {
  130    119   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  131    120   
                    write!(f, "unhandled error ({code})")
  132    121   
                } else {
  133    122   
                    f.write_str("unhandled error")
  134    123   
                }
  135    124   
            }
  136    125   
        }
  137    126   
    }
  138    127   
}
  139    128   
impl ::aws_smithy_types::retry::ProvideErrorKind for ResponseStreamError {
  140    129   
    fn code(&self) -> ::std::option::Option<&str> {
  141    130   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  142    131   
    }
  143    132   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  144    133   
        ::std::option::Option::None
  145    134   
    }
  146    135   
}
  147    136   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResponseStreamError {
  148    137   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  149    138   
        match self {
  150    139   
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  151    140   
            Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  152    141   
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  153    142   
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  154    143   
            Self::ModelTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  155         -
            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  156    144   
            Self::Unhandled(_inner) => &_inner.meta,
  157    145   
        }
  158    146   
    }
  159    147   
}
  160    148   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ResponseStreamError {
  161    149   
    fn create_unhandled_error(
  162    150   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  163    151   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  164    152   
    ) -> Self {
  165    153   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  166    154   
            source,
  167    155   
            meta: meta.unwrap_or_default(),
  168    156   
        })
  169    157   
    }
  170    158   
}
  171    159   
impl ::aws_types::request_id::RequestId for crate::types::error::ResponseStreamError {
  172    160   
    fn request_id(&self) -> Option<&str> {
  173    161   
        self.meta().request_id()
  174    162   
    }
  175    163   
}
  176    164   
  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         -
  423    165   
/// Error type for the `ConverseStreamOutputError` operation.
  424    166   
#[non_exhaustive]
  425    167   
#[derive(::std::fmt::Debug)]
  426    168   
pub enum ConverseStreamOutputError {
  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>
         169  +
    /// <p>An internal server error occurred. Retry your request.</p>
  428    170   
    InternalServerException(crate::types::error::InternalServerException),
  429    171   
    /// <p>An error occurred while streaming the response. Retry your request.</p>
  430    172   
    ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
  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>
         173  +
    /// <p>Input validation failed. Check your request parameters and retry the request.</p>
  432    174   
    ValidationException(crate::types::error::ValidationException),
  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>
         175  +
    /// <p>The number of requests exceeds the limit. Resubmit your request later.</p>
  434    176   
    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),
  437    177   
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
  438    178   
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
  439    179   
    variable wildcard pattern and check `.code()`:
  440    180   
     \
  441    181   
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
  442    182   
     \
  443    183   
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ConverseStreamOutputError) for what information is available for the error.")]
  444    184   
    Unhandled(crate::error::sealed_unhandled::Unhandled),
  445    185   
}
  446    186   
impl ConverseStreamOutputError {
  447    187   
    /// Creates the `ConverseStreamOutputError::Unhandled` variant from any error type.
  448    188   
    pub fn unhandled(
  449    189   
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
  450    190   
    ) -> Self {
  451    191   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  452    192   
            source: err.into(),
  453    193   
            meta: ::std::default::Default::default(),
  454    194   
        })
  455    195   
    }
  456    196   
  457    197   
    /// Creates the `ConverseStreamOutputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
  458    198   
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
  459    199   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  460    200   
            source: err.clone().into(),
  461    201   
            meta: err,
  462    202   
        })
  463    203   
    }
  464    204   
    ///
  465    205   
    /// Returns error metadata, which includes the error code, message,
  466    206   
    /// request ID, and potentially additional information.
  467    207   
    ///
  468    208   
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  469    209   
        match self {
  470    210   
            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  471    211   
            Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  472    212   
            Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  473    213   
            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  474         -
            Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
  475    214   
            Self::Unhandled(e) => &e.meta,
  476    215   
        }
  477    216   
    }
  478    217   
    /// Returns `true` if the error kind is `ConverseStreamOutputError::InternalServerException`.
  479    218   
    pub fn is_internal_server_exception(&self) -> bool {
  480    219   
        matches!(self, Self::InternalServerException(_))
  481    220   
    }
  482    221   
    /// Returns `true` if the error kind is `ConverseStreamOutputError::ModelStreamErrorException`.
  483    222   
    pub fn is_model_stream_error_exception(&self) -> bool {
  484    223   
        matches!(self, Self::ModelStreamErrorException(_))
  485    224   
    }
  486    225   
    /// Returns `true` if the error kind is `ConverseStreamOutputError::ValidationException`.
  487    226   
    pub fn is_validation_exception(&self) -> bool {
  488    227   
        matches!(self, Self::ValidationException(_))
  489    228   
    }
  490    229   
    /// Returns `true` if the error kind is `ConverseStreamOutputError::ThrottlingException`.
  491    230   
    pub fn is_throttling_exception(&self) -> bool {
  492    231   
        matches!(self, Self::ThrottlingException(_))
  493    232   
    }
  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         -
    }
  498    233   
}
  499    234   
impl ::std::error::Error for ConverseStreamOutputError {
  500    235   
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
  501    236   
        match self {
  502    237   
            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
  503    238   
            Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
  504    239   
            Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
  505    240   
            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
  506         -
            Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
  507    241   
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
  508    242   
        }
  509    243   
    }
  510    244   
}
  511    245   
impl ::std::fmt::Display for ConverseStreamOutputError {
  512    246   
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  513    247   
        match self {
  514    248   
            Self::InternalServerException(_inner) => _inner.fmt(f),
  515    249   
            Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
  516    250   
            Self::ValidationException(_inner) => _inner.fmt(f),
  517    251   
            Self::ThrottlingException(_inner) => _inner.fmt(f),
  518         -
            Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
  519    252   
            Self::Unhandled(_inner) => {
  520    253   
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
  521    254   
                    write!(f, "unhandled error ({code})")
  522    255   
                } else {
  523    256   
                    f.write_str("unhandled error")
  524    257   
                }
  525    258   
            }
  526    259   
        }
  527    260   
    }
  528    261   
}
  529    262   
impl ::aws_smithy_types::retry::ProvideErrorKind for ConverseStreamOutputError {
  530    263   
    fn code(&self) -> ::std::option::Option<&str> {
  531    264   
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
  532    265   
    }
  533    266   
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
  534    267   
        ::std::option::Option::None
  535    268   
    }
  536    269   
}
  537    270   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ConverseStreamOutputError {
  538    271   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
  539    272   
        match self {
  540    273   
            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  541    274   
            Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  542    275   
            Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  543    276   
            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  544         -
            Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
  545    277   
            Self::Unhandled(_inner) => &_inner.meta,
  546    278   
        }
  547    279   
    }
  548    280   
}
  549    281   
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ConverseStreamOutputError {
  550    282   
    fn create_unhandled_error(
  551    283   
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
  552    284   
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
  553    285   
    ) -> Self {
  554    286   
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
  555    287   
            source,
  556    288   
            meta: meta.unwrap_or_default(),
  557    289   
        })
  558    290   
    }
  559    291   
}
  560    292   
impl ::aws_types::request_id::RequestId for crate::types::error::ConverseStreamOutputError {
  561    293   
    fn request_id(&self) -> Option<&str> {
  562    294   
        self.meta().request_id()
  563    295   
    }
  564    296   
}
  565    297   
  566         -
pub use crate::types::error::_conflict_exception::ConflictException;
  567         -
  568    298   
mod _access_denied_exception;
  569    299   
  570         -
mod _conflict_exception;
  571         -
  572    300   
mod _internal_server_exception;
  573    301   
  574    302   
mod _model_error_exception;
  575    303   
  576    304   
mod _model_not_ready_exception;
  577    305   
  578    306   
mod _model_stream_error_exception;
  579    307   
  580    308   
mod _model_timeout_exception;
  581    309   
  582    310   
mod _resource_not_found_exception;
  583    311   
  584    312   
mod _service_quota_exceeded_exception;
  585    313   
  586         -
mod _service_unavailable_exception;
  587         -
  588    314   
mod _throttling_exception;
  589    315   
  590    316   
mod _validation_exception;
  591    317   
  592    318   
/// Builders
  593    319   
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 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>
           3  +
/// <p>The request is denied because of missing access permissions.</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

@@ -1,0 +87,0 @@
    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. 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>
           3  +
/// <p>An internal server error occurred. Retry your request.</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 +45,41 @@
    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. 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>
           3  +
/// <p>The model specified in the request is not ready to serve inference requests.</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         -
    }
   16     12   
    /// Returns the error message.
   17     13   
    pub fn message(&self) -> ::std::option::Option<&str> {
   18     14   
        self.message.as_deref()
   19     15   
    }
   20     16   
}
   21     17   
impl ::std::fmt::Display for ModelNotReadyException {
   22     18   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   23     19   
        ::std::write!(f, "ModelNotReadyException")?;
   24     20   
        if let ::std::option::Option::Some(inner_1) = &self.message {
   25     21   
            {

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. 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>
           3  +
/// <p>The specified resource ARN was not found. Check the ARN and try your request again.</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>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>
           3  +
/// <p>The number of requests exceeds the service quota. 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

@@ -1,0 +87,0 @@
    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>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>
           3  +
/// <p>The number of requests exceeds the limit. 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 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>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>
           3  +
/// <p>Input validation failed. Check your request parameters and retry the request.</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 +24,0 @@
    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         -
   16     14   
pub use crate::types::error::_throttling_exception::ThrottlingExceptionBuilder;
   17     15   
   18     16   
pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundExceptionBuilder;
   19     17   
   20     18   
pub use crate::types::error::_access_denied_exception::AccessDeniedExceptionBuilder;
   21     19   
   22     20   
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

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