AWS SDK

AWS SDK

rev. db10d8b7d1ddffb641e5651cb5b4c7c7d63bda6a (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,57 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Contains content regarding the reasoning that is carried out by the model with respect to the content in the content block. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
           6  +
pub enum ReasoningContentBlock {
           7  +
    /// <p>The reasoning that the model used to return the output.</p>
           8  +
    ReasoningText(crate::types::ReasoningTextBlock),
           9  +
    /// <p>The content in the reasoning that was encrypted by the model provider for safety reasons. The encryption doesn't affect the quality of responses.</p>
          10  +
    RedactedContent(::aws_smithy_types::Blob),
          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 ReasoningContentBlock {
          22  +
    /// Tries to convert the enum instance into [`ReasoningText`](crate::types::ReasoningContentBlock::ReasoningText), extracting the inner [`ReasoningTextBlock`](crate::types::ReasoningTextBlock).
          23  +
    /// Returns `Err(&Self)` if it can't be converted.
          24  +
    pub fn as_reasoning_text(&self) -> ::std::result::Result<&crate::types::ReasoningTextBlock, &Self> {
          25  +
        if let ReasoningContentBlock::ReasoningText(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 [`ReasoningText`](crate::types::ReasoningContentBlock::ReasoningText).
          32  +
    pub fn is_reasoning_text(&self) -> bool {
          33  +
        self.as_reasoning_text().is_ok()
          34  +
    }
          35  +
    /// Tries to convert the enum instance into [`RedactedContent`](crate::types::ReasoningContentBlock::RedactedContent), extracting the inner [`Blob`](::aws_smithy_types::Blob).
          36  +
    /// Returns `Err(&Self)` if it can't be converted.
          37  +
    pub fn as_redacted_content(&self) -> ::std::result::Result<&::aws_smithy_types::Blob, &Self> {
          38  +
        if let ReasoningContentBlock::RedactedContent(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 [`RedactedContent`](crate::types::ReasoningContentBlock::RedactedContent).
          45  +
    pub fn is_redacted_content(&self) -> bool {
          46  +
        self.as_redacted_content().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  +
}
          53  +
impl ::std::fmt::Debug for ReasoningContentBlock {
          54  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
          55  +
        ::std::write!(f, "*** Sensitive Data Redacted ***")
          56  +
    }
          57  +
}

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

@@ -0,1 +0,72 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Contains content regarding the reasoning that is carried out by the model with respect to the content in the content block. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
           6  +
pub enum ReasoningContentBlockDelta {
           7  +
    /// <p>The content in the reasoning that was encrypted by the model provider for safety reasons. The encryption doesn't affect the quality of responses.</p>
           8  +
    RedactedContent(::aws_smithy_types::Blob),
           9  +
    /// <p>A token that verifies that the reasoning text was generated by the model. If you pass a reasoning block back to the API in a multi-turn conversation, include the text and its signature unmodified.</p>
          10  +
    Signature(::std::string::String),
          11  +
    /// <p>The reasoning that the model used to return the output.</p>
          12  +
    Text(::std::string::String),
          13  +
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
          14  +
    /// An unknown enum variant
          15  +
    ///
          16  +
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
          17  +
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
          18  +
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
          19  +
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
          20  +
    #[non_exhaustive]
          21  +
    Unknown,
          22  +
}
          23  +
impl ReasoningContentBlockDelta {
          24  +
    /// Tries to convert the enum instance into [`RedactedContent`](crate::types::ReasoningContentBlockDelta::RedactedContent), extracting the inner [`Blob`](::aws_smithy_types::Blob).
          25  +
    /// Returns `Err(&Self)` if it can't be converted.
          26  +
    pub fn as_redacted_content(&self) -> ::std::result::Result<&::aws_smithy_types::Blob, &Self> {
          27  +
        if let ReasoningContentBlockDelta::RedactedContent(val) = &self {
          28  +
            ::std::result::Result::Ok(val)
          29  +
        } else {
          30  +
            ::std::result::Result::Err(self)
          31  +
        }
          32  +
    }
          33  +
    /// Returns true if this is a [`RedactedContent`](crate::types::ReasoningContentBlockDelta::RedactedContent).
          34  +
    pub fn is_redacted_content(&self) -> bool {
          35  +
        self.as_redacted_content().is_ok()
          36  +
    }
          37  +
    /// Tries to convert the enum instance into [`Signature`](crate::types::ReasoningContentBlockDelta::Signature), extracting the inner [`String`](::std::string::String).
          38  +
    /// Returns `Err(&Self)` if it can't be converted.
          39  +
    pub fn as_signature(&self) -> ::std::result::Result<&::std::string::String, &Self> {
          40  +
        if let ReasoningContentBlockDelta::Signature(val) = &self {
          41  +
            ::std::result::Result::Ok(val)
          42  +
        } else {
          43  +
            ::std::result::Result::Err(self)
          44  +
        }
          45  +
    }
          46  +
    /// Returns true if this is a [`Signature`](crate::types::ReasoningContentBlockDelta::Signature).
          47  +
    pub fn is_signature(&self) -> bool {
          48  +
        self.as_signature().is_ok()
          49  +
    }
          50  +
    /// Tries to convert the enum instance into [`Text`](crate::types::ReasoningContentBlockDelta::Text), extracting the inner [`String`](::std::string::String).
          51  +
    /// Returns `Err(&Self)` if it can't be converted.
          52  +
    pub fn as_text(&self) -> ::std::result::Result<&::std::string::String, &Self> {
          53  +
        if let ReasoningContentBlockDelta::Text(val) = &self {
          54  +
            ::std::result::Result::Ok(val)
          55  +
        } else {
          56  +
            ::std::result::Result::Err(self)
          57  +
        }
          58  +
    }
          59  +
    /// Returns true if this is a [`Text`](crate::types::ReasoningContentBlockDelta::Text).
          60  +
    pub fn is_text(&self) -> bool {
          61  +
        self.as_text().is_ok()
          62  +
    }
          63  +
    /// Returns true if the enum instance is the `Unknown` variant.
          64  +
    pub fn is_unknown(&self) -> bool {
          65  +
        matches!(self, Self::Unknown)
          66  +
    }
          67  +
}
          68  +
impl ::std::fmt::Debug for ReasoningContentBlockDelta {
          69  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
          70  +
        ::std::write!(f, "*** Sensitive Data Redacted ***")
          71  +
    }
          72  +
}

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

@@ -0,1 +0,97 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Contains the reasoning that the model used to return the output.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
           6  +
pub struct ReasoningTextBlock {
           7  +
    /// <p>The reasoning that the model used to return the output.</p>
           8  +
    pub text: ::std::string::String,
           9  +
    /// <p>A token that verifies that the reasoning text was generated by the model. If you pass a reasoning block back to the API in a multi-turn conversation, include the text and its signature unmodified.</p>
          10  +
    pub signature: ::std::option::Option<::std::string::String>,
          11  +
}
          12  +
impl ReasoningTextBlock {
          13  +
    /// <p>The reasoning that the model used to return the output.</p>
          14  +
    pub fn text(&self) -> &str {
          15  +
        use std::ops::Deref;
          16  +
        self.text.deref()
          17  +
    }
          18  +
    /// <p>A token that verifies that the reasoning text was generated by the model. If you pass a reasoning block back to the API in a multi-turn conversation, include the text and its signature unmodified.</p>
          19  +
    pub fn signature(&self) -> ::std::option::Option<&str> {
          20  +
        self.signature.as_deref()
          21  +
    }
          22  +
}
          23  +
impl ::std::fmt::Debug for ReasoningTextBlock {
          24  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
          25  +
        let mut formatter = f.debug_struct("ReasoningTextBlock");
          26  +
        formatter.field("text", &"*** Sensitive Data Redacted ***");
          27  +
        formatter.field("signature", &"*** Sensitive Data Redacted ***");
          28  +
        formatter.finish()
          29  +
    }
          30  +
}
          31  +
impl ReasoningTextBlock {
          32  +
    /// Creates a new builder-style object to manufacture [`ReasoningTextBlock`](crate::types::ReasoningTextBlock).
          33  +
    pub fn builder() -> crate::types::builders::ReasoningTextBlockBuilder {
          34  +
        crate::types::builders::ReasoningTextBlockBuilder::default()
          35  +
    }
          36  +
}
          37  +
          38  +
/// A builder for [`ReasoningTextBlock`](crate::types::ReasoningTextBlock).
          39  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
          40  +
#[non_exhaustive]
          41  +
pub struct ReasoningTextBlockBuilder {
          42  +
    pub(crate) text: ::std::option::Option<::std::string::String>,
          43  +
    pub(crate) signature: ::std::option::Option<::std::string::String>,
          44  +
}
          45  +
impl ReasoningTextBlockBuilder {
          46  +
    /// <p>The reasoning that the model used to return the output.</p>
          47  +
    /// This field is required.
          48  +
    pub fn text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          49  +
        self.text = ::std::option::Option::Some(input.into());
          50  +
        self
          51  +
    }
          52  +
    /// <p>The reasoning that the model used to return the output.</p>
          53  +
    pub fn set_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          54  +
        self.text = input;
          55  +
        self
          56  +
    }
          57  +
    /// <p>The reasoning that the model used to return the output.</p>
          58  +
    pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
          59  +
        &self.text
          60  +
    }
          61  +
    /// <p>A token that verifies that the reasoning text was generated by the model. If you pass a reasoning block back to the API in a multi-turn conversation, include the text and its signature unmodified.</p>
          62  +
    pub fn signature(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          63  +
        self.signature = ::std::option::Option::Some(input.into());
          64  +
        self
          65  +
    }
          66  +
    /// <p>A token that verifies that the reasoning text was generated by the model. If you pass a reasoning block back to the API in a multi-turn conversation, include the text and its signature unmodified.</p>
          67  +
    pub fn set_signature(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          68  +
        self.signature = input;
          69  +
        self
          70  +
    }
          71  +
    /// <p>A token that verifies that the reasoning text was generated by the model. If you pass a reasoning block back to the API in a multi-turn conversation, include the text and its signature unmodified.</p>
          72  +
    pub fn get_signature(&self) -> &::std::option::Option<::std::string::String> {
          73  +
        &self.signature
          74  +
    }
          75  +
    /// Consumes the builder and constructs a [`ReasoningTextBlock`](crate::types::ReasoningTextBlock).
          76  +
    /// This method will fail if any of the following fields are not set:
          77  +
    /// - [`text`](crate::types::builders::ReasoningTextBlockBuilder::text)
          78  +
    pub fn build(self) -> ::std::result::Result<crate::types::ReasoningTextBlock, ::aws_smithy_types::error::operation::BuildError> {
          79  +
        ::std::result::Result::Ok(crate::types::ReasoningTextBlock {
          80  +
            text: self.text.ok_or_else(|| {
          81  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
          82  +
                    "text",
          83  +
                    "text was not specified but it is required when building ReasoningTextBlock",
          84  +
                )
          85  +
            })?,
          86  +
            signature: self.signature,
          87  +
        })
          88  +
    }
          89  +
}
          90  +
impl ::std::fmt::Debug for ReasoningTextBlockBuilder {
          91  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
          92  +
        let mut formatter = f.debug_struct("ReasoningTextBlockBuilder");
          93  +
        formatter.field("text", &"*** Sensitive Data Redacted ***");
          94  +
        formatter.field("signature", &"*** Sensitive Data Redacted ***");
          95  +
        formatter.finish()
          96  +
    }
          97  +
}

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

@@ -0,1 +0,81 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>A storage location in an Amazon S3 bucket.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct S3Location {
           7  +
    /// <p>An object URI starting with <code>s3://</code>.</p>
           8  +
    pub uri: ::std::string::String,
           9  +
    /// <p>If the bucket belongs to another AWS account, specify that account's ID.</p>
          10  +
    pub bucket_owner: ::std::option::Option<::std::string::String>,
          11  +
}
          12  +
impl S3Location {
          13  +
    /// <p>An object URI starting with <code>s3://</code>.</p>
          14  +
    pub fn uri(&self) -> &str {
          15  +
        use std::ops::Deref;
          16  +
        self.uri.deref()
          17  +
    }
          18  +
    /// <p>If the bucket belongs to another AWS account, specify that account's ID.</p>
          19  +
    pub fn bucket_owner(&self) -> ::std::option::Option<&str> {
          20  +
        self.bucket_owner.as_deref()
          21  +
    }
          22  +
}
          23  +
impl S3Location {
          24  +
    /// Creates a new builder-style object to manufacture [`S3Location`](crate::types::S3Location).
          25  +
    pub fn builder() -> crate::types::builders::S3LocationBuilder {
          26  +
        crate::types::builders::S3LocationBuilder::default()
          27  +
    }
          28  +
}
          29  +
          30  +
/// A builder for [`S3Location`](crate::types::S3Location).
          31  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          32  +
#[non_exhaustive]
          33  +
pub struct S3LocationBuilder {
          34  +
    pub(crate) uri: ::std::option::Option<::std::string::String>,
          35  +
    pub(crate) bucket_owner: ::std::option::Option<::std::string::String>,
          36  +
}
          37  +
impl S3LocationBuilder {
          38  +
    /// <p>An object URI starting with <code>s3://</code>.</p>
          39  +
    /// This field is required.
          40  +
    pub fn uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          41  +
        self.uri = ::std::option::Option::Some(input.into());
          42  +
        self
          43  +
    }
          44  +
    /// <p>An object URI starting with <code>s3://</code>.</p>
          45  +
    pub fn set_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          46  +
        self.uri = input;
          47  +
        self
          48  +
    }
          49  +
    /// <p>An object URI starting with <code>s3://</code>.</p>
          50  +
    pub fn get_uri(&self) -> &::std::option::Option<::std::string::String> {
          51  +
        &self.uri
          52  +
    }
          53  +
    /// <p>If the bucket belongs to another AWS account, specify that account's ID.</p>
          54  +
    pub fn bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          55  +
        self.bucket_owner = ::std::option::Option::Some(input.into());
          56  +
        self
          57  +
    }
          58  +
    /// <p>If the bucket belongs to another AWS account, specify that account's ID.</p>
          59  +
    pub fn set_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          60  +
        self.bucket_owner = input;
          61  +
        self
          62  +
    }
          63  +
    /// <p>If the bucket belongs to another AWS account, specify that account's ID.</p>
          64  +
    pub fn get_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
          65  +
        &self.bucket_owner
          66  +
    }
          67  +
    /// Consumes the builder and constructs a [`S3Location`](crate::types::S3Location).
          68  +
    /// This method will fail if any of the following fields are not set:
          69  +
    /// - [`uri`](crate::types::builders::S3LocationBuilder::uri)
          70  +
    pub fn build(self) -> ::std::result::Result<crate::types::S3Location, ::aws_smithy_types::error::operation::BuildError> {
          71  +
        ::std::result::Result::Ok(crate::types::S3Location {
          72  +
            uri: self.uri.ok_or_else(|| {
          73  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
          74  +
                    "uri",
          75  +
                    "uri was not specified but it is required when building S3Location",
          76  +
                )
          77  +
            })?,
          78  +
            bucket_owner: self.bucket_owner,
          79  +
        })
          80  +
    }
          81  +
}

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

@@ -0,1 +0,102 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// When writing a match expression against `SortAsyncInvocationBy`, 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 sortasyncinvocationby = unimplemented!();
          14  +
/// match sortasyncinvocationby {
          15  +
///     SortAsyncInvocationBy::SubmissionTime => { /* ... */ },
          16  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          17  +
///     _ => { /* ... */ },
          18  +
/// }
          19  +
/// ```
          20  +
/// The above code demonstrates that when `sortasyncinvocationby` represents
          21  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          22  +
/// even though the enum does not contain a variant `SortAsyncInvocationBy::NewFeature`
          23  +
/// in the current version of SDK. The reason is that the variable `other`,
          24  +
/// created by the `@` operator, is bound to
          25  +
/// `SortAsyncInvocationBy::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
          26  +
/// and calling `as_str` on it yields `"NewFeature"`.
          27  +
/// This match expression is forward-compatible when executed with a newer
          28  +
/// version of SDK where the variant `SortAsyncInvocationBy::NewFeature` is defined.
          29  +
/// Specifically, when `sortasyncinvocationby` represents `NewFeature`,
          30  +
/// the execution path will hit the second last match arm as before by virtue of
          31  +
/// calling `as_str` on `SortAsyncInvocationBy::NewFeature` also yielding `"NewFeature"`.
          32  +
///
          33  +
/// Explicitly matching on the `Unknown` variant should
          34  +
/// be avoided for two reasons:
          35  +
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
          36  +
/// - It might inadvertently shadow other intended match arms.
          37  +
///
          38  +
#[allow(missing_docs)] // documentation missing in model
          39  +
#[non_exhaustive]
          40  +
#[derive(
          41  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
          42  +
)]
          43  +
pub enum SortAsyncInvocationBy {
          44  +
    #[allow(missing_docs)] // documentation missing in model
          45  +
    SubmissionTime,
          46  +
    /// `Unknown` contains new variants that have been added since this code was generated.
          47  +
    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
          48  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
          49  +
}
          50  +
impl ::std::convert::From<&str> for SortAsyncInvocationBy {
          51  +
    fn from(s: &str) -> Self {
          52  +
        match s {
          53  +
            "SubmissionTime" => SortAsyncInvocationBy::SubmissionTime,
          54  +
            other => SortAsyncInvocationBy::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          55  +
        }
          56  +
    }
          57  +
}
          58  +
impl ::std::str::FromStr for SortAsyncInvocationBy {
          59  +
    type Err = ::std::convert::Infallible;
          60  +
          61  +
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
          62  +
        ::std::result::Result::Ok(SortAsyncInvocationBy::from(s))
          63  +
    }
          64  +
}
          65  +
impl SortAsyncInvocationBy {
          66  +
    /// Returns the `&str` value of the enum member.
          67  +
    pub fn as_str(&self) -> &str {
          68  +
        match self {
          69  +
            SortAsyncInvocationBy::SubmissionTime => "SubmissionTime",
          70  +
            SortAsyncInvocationBy::Unknown(value) => value.as_str(),
          71  +
        }
          72  +
    }
          73  +
    /// Returns all the `&str` representations of the enum members.
          74  +
    pub const fn values() -> &'static [&'static str] {
          75  +
        &["SubmissionTime"]
          76  +
    }
          77  +
}
          78  +
impl ::std::convert::AsRef<str> for SortAsyncInvocationBy {
          79  +
    fn as_ref(&self) -> &str {
          80  +
        self.as_str()
          81  +
    }
          82  +
}
          83  +
impl SortAsyncInvocationBy {
          84  +
    /// Parses the enum value while disallowing unknown variants.
          85  +
    ///
          86  +
    /// Unknown variants will result in an error.
          87  +
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
          88  +
        match Self::from(value) {
          89  +
            #[allow(deprecated)]
          90  +
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
          91  +
            known => Ok(known),
          92  +
        }
          93  +
    }
          94  +
}
          95  +
impl ::std::fmt::Display for SortAsyncInvocationBy {
          96  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
          97  +
        match self {
          98  +
            SortAsyncInvocationBy::SubmissionTime => write!(f, "SubmissionTime"),
          99  +
            SortAsyncInvocationBy::Unknown(value) => write!(f, "{}", value),
         100  +
        }
         101  +
    }
         102  +
}

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

@@ -0,1 +0,108 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// When writing a match expression against `SortOrder`, 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 sortorder = unimplemented!();
          14  +
/// match sortorder {
          15  +
///     SortOrder::Ascending => { /* ... */ },
          16  +
///     SortOrder::Descending => { /* ... */ },
          17  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          18  +
///     _ => { /* ... */ },
          19  +
/// }
          20  +
/// ```
          21  +
/// The above code demonstrates that when `sortorder` represents
          22  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          23  +
/// even though the enum does not contain a variant `SortOrder::NewFeature`
          24  +
/// in the current version of SDK. The reason is that the variable `other`,
          25  +
/// created by the `@` operator, is bound to
          26  +
/// `SortOrder::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
          27  +
/// and calling `as_str` on it yields `"NewFeature"`.
          28  +
/// This match expression is forward-compatible when executed with a newer
          29  +
/// version of SDK where the variant `SortOrder::NewFeature` is defined.
          30  +
/// Specifically, when `sortorder` represents `NewFeature`,
          31  +
/// the execution path will hit the second last match arm as before by virtue of
          32  +
/// calling `as_str` on `SortOrder::NewFeature` also yielding `"NewFeature"`.
          33  +
///
          34  +
/// Explicitly matching on the `Unknown` variant should
          35  +
/// be avoided for two reasons:
          36  +
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
          37  +
/// - It might inadvertently shadow other intended match arms.
          38  +
///
          39  +
#[allow(missing_docs)] // documentation missing in model
          40  +
#[non_exhaustive]
          41  +
#[derive(
          42  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
          43  +
)]
          44  +
pub enum SortOrder {
          45  +
    #[allow(missing_docs)] // documentation missing in model
          46  +
    Ascending,
          47  +
    #[allow(missing_docs)] // documentation missing in model
          48  +
    Descending,
          49  +
    /// `Unknown` contains new variants that have been added since this code was generated.
          50  +
    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
          51  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
          52  +
}
          53  +
impl ::std::convert::From<&str> for SortOrder {
          54  +
    fn from(s: &str) -> Self {
          55  +
        match s {
          56  +
            "Ascending" => SortOrder::Ascending,
          57  +
            "Descending" => SortOrder::Descending,
          58  +
            other => SortOrder::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          59  +
        }
          60  +
    }
          61  +
}
          62  +
impl ::std::str::FromStr for SortOrder {
          63  +
    type Err = ::std::convert::Infallible;
          64  +
          65  +
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
          66  +
        ::std::result::Result::Ok(SortOrder::from(s))
          67  +
    }
          68  +
}
          69  +
impl SortOrder {
          70  +
    /// Returns the `&str` value of the enum member.
          71  +
    pub fn as_str(&self) -> &str {
          72  +
        match self {
          73  +
            SortOrder::Ascending => "Ascending",
          74  +
            SortOrder::Descending => "Descending",
          75  +
            SortOrder::Unknown(value) => value.as_str(),
          76  +
        }
          77  +
    }
          78  +
    /// Returns all the `&str` representations of the enum members.
          79  +
    pub const fn values() -> &'static [&'static str] {
          80  +
        &["Ascending", "Descending"]
          81  +
    }
          82  +
}
          83  +
impl ::std::convert::AsRef<str> for SortOrder {
          84  +
    fn as_ref(&self) -> &str {
          85  +
        self.as_str()
          86  +
    }
          87  +
}
          88  +
impl SortOrder {
          89  +
    /// Parses the enum value while disallowing unknown variants.
          90  +
    ///
          91  +
    /// Unknown variants will result in an error.
          92  +
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
          93  +
        match Self::from(value) {
          94  +
            #[allow(deprecated)]
          95  +
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
          96  +
            known => Ok(known),
          97  +
        }
          98  +
    }
          99  +
}
         100  +
impl ::std::fmt::Display for SortOrder {
         101  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         102  +
        match self {
         103  +
            SortOrder::Ascending => write!(f, "Ascending"),
         104  +
            SortOrder::Descending => write!(f, "Descending"),
         105  +
            SortOrder::Unknown(value) => write!(f, "{}", value),
         106  +
        }
         107  +
    }
         108  +
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/_specific_tool_choice.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 model must request a specific tool.</p><note>
           3  +
/// <p>The model must request a specific tool. For example, <code>{"tool" : {"name" : "Your tool name"}}</code>.</p><note>
    4      4   
/// <p>This field is only supported by Anthropic Claude 3 models.</p>
    5      5   
/// </note>
    6      6   
#[non_exhaustive]
    7      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    8      8   
pub struct SpecificToolChoice {
    9      9   
    /// <p>The name of the tool that the model must request.</p>
   10     10   
    pub name: ::std::string::String,
   11     11   
}
   12     12   
impl SpecificToolChoice {
   13     13   
    /// <p>The name of the tool that the model must request.</p>

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

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

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

@@ -1,1 +38,68 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// <p>A system content block</p>
           3  +
/// <p>A system content block.</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub enum SystemContentBlock {
           7  +
    /// <p>CachePoint to include in the system prompt.</p>
           8  +
    CachePoint(crate::types::CachePointBlock),
           9  +
    /// <p>A content block to assess with the guardrail. Use with the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> or <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a> API operations.</p>
          10  +
    /// <p>For more information, see <i>Use a guardrail with the Converse API</i> in the <i>Amazon Bedrock User Guide</i>.</p>
          11  +
    GuardContent(crate::types::GuardrailConverseContentBlock),
    7     12   
    /// <p>A system prompt for the model.</p>
    8     13   
    Text(::std::string::String),
    9     14   
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
   10     15   
    /// An unknown enum variant
   11     16   
    ///
   12     17   
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
   13     18   
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
   14     19   
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
   15     20   
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
   16     21   
    #[non_exhaustive]
   17     22   
    Unknown,
   18     23   
}
   19     24   
impl SystemContentBlock {
   20         -
    #[allow(irrefutable_let_patterns)]
          25  +
    /// Tries to convert the enum instance into [`CachePoint`](crate::types::SystemContentBlock::CachePoint), extracting the inner [`CachePointBlock`](crate::types::CachePointBlock).
          26  +
    /// Returns `Err(&Self)` if it can't be converted.
          27  +
    pub fn as_cache_point(&self) -> ::std::result::Result<&crate::types::CachePointBlock, &Self> {
          28  +
        if let SystemContentBlock::CachePoint(val) = &self {
          29  +
            ::std::result::Result::Ok(val)
          30  +
        } else {
          31  +
            ::std::result::Result::Err(self)
          32  +
        }
          33  +
    }
          34  +
    /// Returns true if this is a [`CachePoint`](crate::types::SystemContentBlock::CachePoint).
          35  +
    pub fn is_cache_point(&self) -> bool {
          36  +
        self.as_cache_point().is_ok()
          37  +
    }
          38  +
    /// Tries to convert the enum instance into [`GuardContent`](crate::types::SystemContentBlock::GuardContent), extracting the inner [`GuardrailConverseContentBlock`](crate::types::GuardrailConverseContentBlock).
          39  +
    /// Returns `Err(&Self)` if it can't be converted.
          40  +
    pub fn as_guard_content(&self) -> ::std::result::Result<&crate::types::GuardrailConverseContentBlock, &Self> {
          41  +
        if let SystemContentBlock::GuardContent(val) = &self {
          42  +
            ::std::result::Result::Ok(val)
          43  +
        } else {
          44  +
            ::std::result::Result::Err(self)
          45  +
        }
          46  +
    }
          47  +
    /// Returns true if this is a [`GuardContent`](crate::types::SystemContentBlock::GuardContent).
          48  +
    pub fn is_guard_content(&self) -> bool {
          49  +
        self.as_guard_content().is_ok()
          50  +
    }
   21     51   
    /// Tries to convert the enum instance into [`Text`](crate::types::SystemContentBlock::Text), extracting the inner [`String`](::std::string::String).
   22     52   
    /// Returns `Err(&Self)` if it can't be converted.
   23     53   
    pub fn as_text(&self) -> ::std::result::Result<&::std::string::String, &Self> {
   24     54   
        if let SystemContentBlock::Text(val) = &self {
   25     55   
            ::std::result::Result::Ok(val)
   26     56   
        } else {
   27     57   
            ::std::result::Result::Err(self)
   28     58   
        }
   29     59   
    }
   30     60   
    /// Returns true if this is a [`Text`](crate::types::SystemContentBlock::Text).

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

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

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

@@ -1,1 +116,160 @@
    3      3   
/// <p>The tokens used in a message API inference call.</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub struct TokenUsage {
    7      7   
    /// <p>The number of tokens sent in the request to the model.</p>
    8      8   
    pub input_tokens: i32,
    9      9   
    /// <p>The number of tokens that the model generated for the request.</p>
   10     10   
    pub output_tokens: i32,
   11     11   
    /// <p>The total of input tokens and tokens generated by the model.</p>
   12     12   
    pub total_tokens: i32,
          13  +
    /// <p>The number of input tokens read from the cache for the request.</p>
          14  +
    pub cache_read_input_tokens: ::std::option::Option<i32>,
          15  +
    /// <p>The number of input tokens written to the cache for the request.</p>
          16  +
    pub cache_write_input_tokens: ::std::option::Option<i32>,
   13     17   
}
   14     18   
impl TokenUsage {
   15     19   
    /// <p>The number of tokens sent in the request to the model.</p>
   16     20   
    pub fn input_tokens(&self) -> i32 {
   17     21   
        self.input_tokens
   18     22   
    }
   19     23   
    /// <p>The number of tokens that the model generated for the request.</p>
   20     24   
    pub fn output_tokens(&self) -> i32 {
   21     25   
        self.output_tokens
   22     26   
    }
   23     27   
    /// <p>The total of input tokens and tokens generated by the model.</p>
   24     28   
    pub fn total_tokens(&self) -> i32 {
   25     29   
        self.total_tokens
   26     30   
    }
          31  +
    /// <p>The number of input tokens read from the cache for the request.</p>
          32  +
    pub fn cache_read_input_tokens(&self) -> ::std::option::Option<i32> {
          33  +
        self.cache_read_input_tokens
          34  +
    }
          35  +
    /// <p>The number of input tokens written to the cache for the request.</p>
          36  +
    pub fn cache_write_input_tokens(&self) -> ::std::option::Option<i32> {
          37  +
        self.cache_write_input_tokens
          38  +
    }
   27     39   
}
   28     40   
impl TokenUsage {
   29     41   
    /// Creates a new builder-style object to manufacture [`TokenUsage`](crate::types::TokenUsage).
   30     42   
    pub fn builder() -> crate::types::builders::TokenUsageBuilder {
   31     43   
        crate::types::builders::TokenUsageBuilder::default()
   32     44   
    }
   33     45   
}
   34     46   
   35     47   
/// A builder for [`TokenUsage`](crate::types::TokenUsage).
   36     48   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   37     49   
#[non_exhaustive]
   38     50   
pub struct TokenUsageBuilder {
   39     51   
    pub(crate) input_tokens: ::std::option::Option<i32>,
   40     52   
    pub(crate) output_tokens: ::std::option::Option<i32>,
   41     53   
    pub(crate) total_tokens: ::std::option::Option<i32>,
          54  +
    pub(crate) cache_read_input_tokens: ::std::option::Option<i32>,
          55  +
    pub(crate) cache_write_input_tokens: ::std::option::Option<i32>,
   42     56   
}
   43     57   
impl TokenUsageBuilder {
   44     58   
    /// <p>The number of tokens sent in the request to the model.</p>
   45     59   
    /// This field is required.
   46     60   
    pub fn input_tokens(mut self, input: i32) -> Self {
   47     61   
        self.input_tokens = ::std::option::Option::Some(input);
   48     62   
        self
   49     63   
    }
   50     64   
    /// <p>The number of tokens sent in the request to the model.</p>
   51     65   
    pub fn set_input_tokens(mut self, input: ::std::option::Option<i32>) -> Self {
   52     66   
        self.input_tokens = input;
   53     67   
        self
   54     68   
    }
   55     69   
    /// <p>The number of tokens sent in the request to the model.</p>
   56     70   
    pub fn get_input_tokens(&self) -> &::std::option::Option<i32> {
   57     71   
        &self.input_tokens
   58     72   
    }
   59     73   
    /// <p>The number of tokens that the model generated for the request.</p>
   60     74   
    /// This field is required.
   61     75   
    pub fn output_tokens(mut self, input: i32) -> Self {
   62     76   
        self.output_tokens = ::std::option::Option::Some(input);
   63     77   
        self
   64     78   
    }
   65     79   
    /// <p>The number of tokens that the model generated for the request.</p>
   66     80   
    pub fn set_output_tokens(mut self, input: ::std::option::Option<i32>) -> Self {
   67     81   
        self.output_tokens = input;
   68     82   
        self
   69     83   
    }
   70     84   
    /// <p>The number of tokens that the model generated for the request.</p>
   71     85   
    pub fn get_output_tokens(&self) -> &::std::option::Option<i32> {
   72     86   
        &self.output_tokens
   73     87   
    }
   74     88   
    /// <p>The total of input tokens and tokens generated by the model.</p>
   75     89   
    /// This field is required.
   76     90   
    pub fn total_tokens(mut self, input: i32) -> Self {
   77     91   
        self.total_tokens = ::std::option::Option::Some(input);
   78     92   
        self
   79     93   
    }
   80     94   
    /// <p>The total of input tokens and tokens generated by the model.</p>
   81     95   
    pub fn set_total_tokens(mut self, input: ::std::option::Option<i32>) -> Self {
   82     96   
        self.total_tokens = input;
   83     97   
        self
   84     98   
    }
   85     99   
    /// <p>The total of input tokens and tokens generated by the model.</p>
   86    100   
    pub fn get_total_tokens(&self) -> &::std::option::Option<i32> {
   87    101   
        &self.total_tokens
   88    102   
    }
         103  +
    /// <p>The number of input tokens read from the cache for the request.</p>
         104  +
    pub fn cache_read_input_tokens(mut self, input: i32) -> Self {
         105  +
        self.cache_read_input_tokens = ::std::option::Option::Some(input);
         106  +
        self
         107  +
    }
         108  +
    /// <p>The number of input tokens read from the cache for the request.</p>
         109  +
    pub fn set_cache_read_input_tokens(mut self, input: ::std::option::Option<i32>) -> Self {
         110  +
        self.cache_read_input_tokens = input;
         111  +
        self
         112  +
    }
         113  +
    /// <p>The number of input tokens read from the cache for the request.</p>
         114  +
    pub fn get_cache_read_input_tokens(&self) -> &::std::option::Option<i32> {
         115  +
        &self.cache_read_input_tokens
         116  +
    }
         117  +
    /// <p>The number of input tokens written to the cache for the request.</p>
         118  +
    pub fn cache_write_input_tokens(mut self, input: i32) -> Self {
         119  +
        self.cache_write_input_tokens = ::std::option::Option::Some(input);
         120  +
        self
         121  +
    }
         122  +
    /// <p>The number of input tokens written to the cache for the request.</p>
         123  +
    pub fn set_cache_write_input_tokens(mut self, input: ::std::option::Option<i32>) -> Self {
         124  +
        self.cache_write_input_tokens = input;
         125  +
        self
         126  +
    }
         127  +
    /// <p>The number of input tokens written to the cache for the request.</p>
         128  +
    pub fn get_cache_write_input_tokens(&self) -> &::std::option::Option<i32> {
         129  +
        &self.cache_write_input_tokens
         130  +
    }
   89    131   
    /// Consumes the builder and constructs a [`TokenUsage`](crate::types::TokenUsage).
   90    132   
    /// This method will fail if any of the following fields are not set:
   91    133   
    /// - [`input_tokens`](crate::types::builders::TokenUsageBuilder::input_tokens)
   92    134   
    /// - [`output_tokens`](crate::types::builders::TokenUsageBuilder::output_tokens)
   93    135   
    /// - [`total_tokens`](crate::types::builders::TokenUsageBuilder::total_tokens)
   94    136   
    pub fn build(self) -> ::std::result::Result<crate::types::TokenUsage, ::aws_smithy_types::error::operation::BuildError> {
   95    137   
        ::std::result::Result::Ok(crate::types::TokenUsage {
   96    138   
            input_tokens: self.input_tokens.ok_or_else(|| {
   97    139   
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   98    140   
                    "input_tokens",
   99    141   
                    "input_tokens was not specified but it is required when building TokenUsage",
  100    142   
                )
  101    143   
            })?,
  102    144   
            output_tokens: self.output_tokens.ok_or_else(|| {
  103    145   
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  104    146   
                    "output_tokens",
  105    147   
                    "output_tokens was not specified but it is required when building TokenUsage",
  106    148   
                )
  107    149   
            })?,
  108    150   
            total_tokens: self.total_tokens.ok_or_else(|| {
  109    151   
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  110    152   
                    "total_tokens",
  111    153   
                    "total_tokens was not specified but it is required when building TokenUsage",
  112    154   
                )
  113    155   
            })?,
         156  +
            cache_read_input_tokens: self.cache_read_input_tokens,
         157  +
            cache_write_input_tokens: self.cache_write_input_tokens,
  114    158   
        })
  115    159   
    }
  116    160   
}

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

@@ -1,1 +38,52 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// <p>Information about a tool that you can use with the Converse API.</p>
           3  +
/// <p>Information about a tool that you can use with the Converse API. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html">Tool use (function calling)</a> in the Amazon Bedrock User Guide.</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub enum Tool {
           7  +
    /// <p>CachePoint to include in the tool configuration.</p>
           8  +
    CachePoint(crate::types::CachePointBlock),
    7      9   
    /// <p>The specfication for the tool.</p>
    8     10   
    ToolSpec(crate::types::ToolSpecification),
    9     11   
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
   10     12   
    /// An unknown enum variant
   11     13   
    ///
   12     14   
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
   13     15   
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
   14     16   
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
   15     17   
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
   16     18   
    #[non_exhaustive]
   17     19   
    Unknown,
   18     20   
}
   19     21   
impl Tool {
   20         -
    #[allow(irrefutable_let_patterns)]
          22  +
    /// Tries to convert the enum instance into [`CachePoint`](crate::types::Tool::CachePoint), extracting the inner [`CachePointBlock`](crate::types::CachePointBlock).
          23  +
    /// Returns `Err(&Self)` if it can't be converted.
          24  +
    pub fn as_cache_point(&self) -> ::std::result::Result<&crate::types::CachePointBlock, &Self> {
          25  +
        if let Tool::CachePoint(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 [`CachePoint`](crate::types::Tool::CachePoint).
          32  +
    pub fn is_cache_point(&self) -> bool {
          33  +
        self.as_cache_point().is_ok()
          34  +
    }
   21     35   
    /// Tries to convert the enum instance into [`ToolSpec`](crate::types::Tool::ToolSpec), extracting the inner [`ToolSpecification`](crate::types::ToolSpecification).
   22     36   
    /// Returns `Err(&Self)` if it can't be converted.
   23     37   
    pub fn as_tool_spec(&self) -> ::std::result::Result<&crate::types::ToolSpecification, &Self> {
   24     38   
        if let Tool::ToolSpec(val) = &self {
   25     39   
            ::std::result::Result::Ok(val)
   26     40   
        } else {
   27     41   
            ::std::result::Result::Err(self)
   28     42   
        }
   29     43   
    }
   30     44   
    /// Returns true if this is a [`ToolSpec`](crate::types::Tool::ToolSpec).

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

@@ -1,1 +41,41 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// <p>Forces a model to use a tool.</p>
           3  +
/// <p>Determines which tools the model should request in a call to <code>Converse</code> or <code>ConverseStream</code>. <code>ToolChoice</code> is only supported by Anthropic Claude 3 models and by Mistral AI Mistral Large.</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub enum ToolChoice {
    7      7   
    /// <p>The model must request at least one tool (no text is generated).</p>
    8      8   
    Any(crate::types::AnyToolChoice),
    9         -
    /// <p>The Model automatically decides if a tool should be called or to whether to generate text instead.</p>
           9  +
    /// <p>(Default). The Model automatically decides if a tool should be called or whether to generate text instead.</p>
   10     10   
    Auto(crate::types::AutoToolChoice),
   11         -
    /// <p>The Model must request the specified tool.</p>
          11  +
    /// <p>The Model must request the specified tool. Only supported by Anthropic Claude 3 models.</p>
   12     12   
    Tool(crate::types::SpecificToolChoice),
   13     13   
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
   14     14   
    /// An unknown enum variant
   15     15   
    ///
   16     16   
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
   17     17   
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
   18     18   
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
   19     19   
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
   20     20   
    #[non_exhaustive]
   21     21   
    Unknown,

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

@@ -1,1 +35,33 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// <p>Configuration information for the tools that you pass to a model.</p><note>
    4         -
/// <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
    5         -
/// </note>
           3  +
/// <p>Configuration information for the tools that you pass to a model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html">Tool use (function calling)</a> in the Amazon Bedrock User Guide.</p>
    6      4   
#[non_exhaustive]
    7      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    8      6   
pub struct ToolConfiguration {
    9      7   
    /// <p>An array of tools that you want to pass to a model.</p>
   10      8   
    pub tools: ::std::vec::Vec<crate::types::Tool>,
   11      9   
    /// <p>If supported by model, forces the model to request a tool.</p>
   12     10   
    pub tool_choice: ::std::option::Option<crate::types::ToolChoice>,
   13     11   
}
   14     12   
impl ToolConfiguration {
   15     13   
    /// <p>An array of tools that you want to pass to a model.</p>

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

@@ -1,1 +69,99 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3      3   
/// <p>The tool result content block.</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub enum ToolResultContentBlock {
           7  +
    /// <p>A tool result that is a document.</p>
           8  +
    Document(crate::types::DocumentBlock),
    7      9   
    /// <p>A tool result that is an image.</p><note>
    8     10   
    /// <p>This field is only supported by Anthropic Claude 3 models.</p>
    9     11   
    /// </note>
   10     12   
    Image(crate::types::ImageBlock),
   11     13   
    /// <p>A tool result that is JSON format data.</p>
   12     14   
    Json(::aws_smithy_types::Document),
   13     15   
    /// <p>A tool result that is text.</p>
   14     16   
    Text(::std::string::String),
          17  +
    /// <p>A tool result that is video.</p>
          18  +
    Video(crate::types::VideoBlock),
   15     19   
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
   16     20   
    /// An unknown enum variant
   17     21   
    ///
   18     22   
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
   19     23   
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
   20     24   
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
   21     25   
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
   22     26   
    #[non_exhaustive]
   23     27   
    Unknown,
   24     28   
}
   25     29   
impl ToolResultContentBlock {
          30  +
    /// Tries to convert the enum instance into [`Document`](crate::types::ToolResultContentBlock::Document), extracting the inner [`DocumentBlock`](crate::types::DocumentBlock).
          31  +
    /// Returns `Err(&Self)` if it can't be converted.
          32  +
    pub fn as_document(&self) -> ::std::result::Result<&crate::types::DocumentBlock, &Self> {
          33  +
        if let ToolResultContentBlock::Document(val) = &self {
          34  +
            ::std::result::Result::Ok(val)
          35  +
        } else {
          36  +
            ::std::result::Result::Err(self)
          37  +
        }
          38  +
    }
          39  +
    /// Returns true if this is a [`Document`](crate::types::ToolResultContentBlock::Document).
          40  +
    pub fn is_document(&self) -> bool {
          41  +
        self.as_document().is_ok()
          42  +
    }
   26     43   
    /// Tries to convert the enum instance into [`Image`](crate::types::ToolResultContentBlock::Image), extracting the inner [`ImageBlock`](crate::types::ImageBlock).
   27     44   
    /// Returns `Err(&Self)` if it can't be converted.
   28     45   
    pub fn as_image(&self) -> ::std::result::Result<&crate::types::ImageBlock, &Self> {
   29     46   
        if let ToolResultContentBlock::Image(val) = &self {
   30     47   
            ::std::result::Result::Ok(val)
   31     48   
        } else {
   32     49   
            ::std::result::Result::Err(self)
   33     50   
        }
   34     51   
    }
   35     52   
    /// Returns true if this is a [`Image`](crate::types::ToolResultContentBlock::Image).
   36     53   
    pub fn is_image(&self) -> bool {
   37     54   
        self.as_image().is_ok()
   38     55   
    }
   39     56   
    /// Tries to convert the enum instance into [`Json`](crate::types::ToolResultContentBlock::Json), extracting the inner [`Document`](::aws_smithy_types::Document).
   40     57   
    /// Returns `Err(&Self)` if it can't be converted.
   41     58   
    pub fn as_json(&self) -> ::std::result::Result<&::aws_smithy_types::Document, &Self> {
   42     59   
        if let ToolResultContentBlock::Json(val) = &self {
   43     60   
            ::std::result::Result::Ok(val)
   44     61   
        } else {
   45     62   
            ::std::result::Result::Err(self)
   46     63   
        }
   47     64   
    }
   48     65   
    /// Returns true if this is a [`Json`](crate::types::ToolResultContentBlock::Json).
   49     66   
    pub fn is_json(&self) -> bool {
   50     67   
        self.as_json().is_ok()
   51     68   
    }
   52     69   
    /// Tries to convert the enum instance into [`Text`](crate::types::ToolResultContentBlock::Text), extracting the inner [`String`](::std::string::String).
   53     70   
    /// Returns `Err(&Self)` if it can't be converted.
   54     71   
    pub fn as_text(&self) -> ::std::result::Result<&::std::string::String, &Self> {
   55     72   
        if let ToolResultContentBlock::Text(val) = &self {
   56     73   
            ::std::result::Result::Ok(val)
   57     74   
        } else {
   58     75   
            ::std::result::Result::Err(self)
   59     76   
        }
   60     77   
    }
   61     78   
    /// Returns true if this is a [`Text`](crate::types::ToolResultContentBlock::Text).
   62     79   
    pub fn is_text(&self) -> bool {
   63     80   
        self.as_text().is_ok()
   64     81   
    }
          82  +
    /// Tries to convert the enum instance into [`Video`](crate::types::ToolResultContentBlock::Video), extracting the inner [`VideoBlock`](crate::types::VideoBlock).
          83  +
    /// Returns `Err(&Self)` if it can't be converted.
          84  +
    pub fn as_video(&self) -> ::std::result::Result<&crate::types::VideoBlock, &Self> {
          85  +
        if let ToolResultContentBlock::Video(val) = &self {
          86  +
            ::std::result::Result::Ok(val)
          87  +
        } else {
          88  +
            ::std::result::Result::Err(self)
          89  +
        }
          90  +
    }
          91  +
    /// Returns true if this is a [`Video`](crate::types::ToolResultContentBlock::Video).
          92  +
    pub fn is_video(&self) -> bool {
          93  +
        self.as_video().is_ok()
          94  +
    }
   65     95   
    /// Returns true if the enum instance is the `Unknown` variant.
   66     96   
    pub fn is_unknown(&self) -> bool {
   67     97   
        matches!(self, Self::Unknown)
   68     98   
    }
   69     99   
}

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

@@ -1,1 +108,114 @@
    7      7   
/// upgrade SDK to a future version in which the enum does include a variant for that
    8      8   
/// feature.
    9      9   
///
   10     10   
/// Here is an example of how you can make a match expression forward-compatible:
   11     11   
///
   12     12   
/// ```text
   13     13   
/// # let trace = unimplemented!();
   14     14   
/// match trace {
   15     15   
///     Trace::Disabled => { /* ... */ },
   16     16   
///     Trace::Enabled => { /* ... */ },
          17  +
///     Trace::EnabledFull => { /* ... */ },
   17     18   
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
   18     19   
///     _ => { /* ... */ },
   19     20   
/// }
   20     21   
/// ```
   21     22   
/// The above code demonstrates that when `trace` represents
   22     23   
/// `NewFeature`, the execution path will lead to the second last match arm,
   23     24   
/// even though the enum does not contain a variant `Trace::NewFeature`
   24     25   
/// in the current version of SDK. The reason is that the variable `other`,
   25     26   
/// created by the `@` operator, is bound to
   26     27   
/// `Trace::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
   27     28   
/// and calling `as_str` on it yields `"NewFeature"`.
   28     29   
/// This match expression is forward-compatible when executed with a newer
   29     30   
/// version of SDK where the variant `Trace::NewFeature` is defined.
   30     31   
/// Specifically, when `trace` represents `NewFeature`,
   31     32   
/// the execution path will hit the second last match arm as before by virtue of
   32     33   
/// calling `as_str` on `Trace::NewFeature` also yielding `"NewFeature"`.
   33     34   
///
   34     35   
/// Explicitly matching on the `Unknown` variant should
   35     36   
/// be avoided for two reasons:
   36     37   
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
   37     38   
/// - It might inadvertently shadow other intended match arms.
   38     39   
///
   39     40   
#[allow(missing_docs)] // documentation missing in model
   40     41   
#[non_exhaustive]
   41     42   
#[derive(
   42     43   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
   43     44   
)]
   44     45   
pub enum Trace {
   45     46   
    #[allow(missing_docs)] // documentation missing in model
   46     47   
    Disabled,
   47     48   
    #[allow(missing_docs)] // documentation missing in model
   48     49   
    Enabled,
          50  +
    #[allow(missing_docs)] // documentation missing in model
          51  +
    EnabledFull,
   49     52   
    /// `Unknown` contains new variants that have been added since this code was generated.
   50     53   
    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
   51     54   
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
   52     55   
}
   53     56   
impl ::std::convert::From<&str> for Trace {
   54     57   
    fn from(s: &str) -> Self {
   55     58   
        match s {
   56     59   
            "DISABLED" => Trace::Disabled,
   57     60   
            "ENABLED" => Trace::Enabled,
          61  +
            "ENABLED_FULL" => Trace::EnabledFull,
   58     62   
            other => Trace::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
   59     63   
        }
   60     64   
    }
   61     65   
}
   62     66   
impl ::std::str::FromStr for Trace {
   63     67   
    type Err = ::std::convert::Infallible;
   64     68   
   65     69   
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
   66     70   
        ::std::result::Result::Ok(Trace::from(s))
   67     71   
    }
   68     72   
}
   69     73   
impl Trace {
   70     74   
    /// Returns the `&str` value of the enum member.
   71     75   
    pub fn as_str(&self) -> &str {
   72     76   
        match self {
   73     77   
            Trace::Disabled => "DISABLED",
   74     78   
            Trace::Enabled => "ENABLED",
          79  +
            Trace::EnabledFull => "ENABLED_FULL",
   75     80   
            Trace::Unknown(value) => value.as_str(),
   76     81   
        }
   77     82   
    }
   78     83   
    /// Returns all the `&str` representations of the enum members.
   79     84   
    pub const fn values() -> &'static [&'static str] {
   80         -
        &["DISABLED", "ENABLED"]
          85  +
        &["DISABLED", "ENABLED", "ENABLED_FULL"]
   81     86   
    }
   82     87   
}
   83     88   
impl ::std::convert::AsRef<str> for Trace {
   84     89   
    fn as_ref(&self) -> &str {
   85     90   
        self.as_str()
   86     91   
    }
   87     92   
}
   88     93   
impl Trace {
   89     94   
    /// Parses the enum value while disallowing unknown variants.
   90     95   
    ///
   91     96   
    /// Unknown variants will result in an error.
   92     97   
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
   93     98   
        match Self::from(value) {
   94     99   
            #[allow(deprecated)]
   95    100   
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
   96    101   
            known => Ok(known),
   97    102   
        }
   98    103   
    }
   99    104   
}
  100    105   
impl ::std::fmt::Display for Trace {
  101    106   
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  102    107   
        match self {
  103    108   
            Trace::Disabled => write!(f, "DISABLED"),
  104    109   
            Trace::Enabled => write!(f, "ENABLED"),
         110  +
            Trace::EnabledFull => write!(f, "ENABLED_FULL"),
  105    111   
            Trace::Unknown(value) => write!(f, "{}", value),
  106    112   
        }
  107    113   
    }
  108    114   
}