AWS SDK

AWS SDK

rev. ba98f30b52e51c6e715b0ae469e7a2e988c27d9a (ignoring whitespace)

Files changed:

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

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

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

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

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

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

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

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

@@ -1,1 +68,38 @@
    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),
   12      7   
    /// <p>A system prompt for the model.</p>
   13      8   
    Text(::std::string::String),
   14      9   
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
   15     10   
    /// An unknown enum variant
   16     11   
    ///
   17     12   
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
   18     13   
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
   19     14   
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
   20     15   
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
   21     16   
    #[non_exhaustive]
   22     17   
    Unknown,
   23     18   
}
   24     19   
impl SystemContentBlock {
   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         -
    }
          20  +
    #[allow(irrefutable_let_patterns)]
   51     21   
    /// Tries to convert the enum instance into [`Text`](crate::types::SystemContentBlock::Text), extracting the inner [`String`](::std::string::String).
   52     22   
    /// Returns `Err(&Self)` if it can't be converted.
   53     23   
    pub fn as_text(&self) -> ::std::result::Result<&::std::string::String, &Self> {
   54     24   
        if let SystemContentBlock::Text(val) = &self {
   55     25   
            ::std::result::Result::Ok(val)
   56     26   
        } else {
   57     27   
            ::std::result::Result::Err(self)
   58     28   
        }
   59     29   
    }
   60     30   
    /// Returns true if this is a [`Text`](crate::types::SystemContentBlock::Text).

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

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

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

@@ -1,1 +52,38 @@
    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. 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>
           3  +
/// <p>Information about a tool that you can use with the Converse API.</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),
    9      7   
    /// <p>The specfication for the tool.</p>
   10      8   
    ToolSpec(crate::types::ToolSpecification),
   11      9   
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
   12     10   
    /// An unknown enum variant
   13     11   
    ///
   14     12   
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
   15     13   
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
   16     14   
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
   17     15   
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
   18     16   
    #[non_exhaustive]
   19     17   
    Unknown,
   20     18   
}
   21     19   
impl Tool {
   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         -
    }
          20  +
    #[allow(irrefutable_let_patterns)]
   35     21   
    /// Tries to convert the enum instance into [`ToolSpec`](crate::types::Tool::ToolSpec), extracting the inner [`ToolSpecification`](crate::types::ToolSpecification).
   36     22   
    /// Returns `Err(&Self)` if it can't be converted.
   37     23   
    pub fn as_tool_spec(&self) -> ::std::result::Result<&crate::types::ToolSpecification, &Self> {
   38     24   
        if let Tool::ToolSpec(val) = &self {
   39     25   
            ::std::result::Result::Ok(val)
   40     26   
        } else {
   41     27   
            ::std::result::Result::Err(self)
   42     28   
        }
   43     29   
    }
   44     30   
    /// 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>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>
           3  +
/// <p>Forces a model to use a tool.</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>(Default). The Model automatically decides if a tool should be called or whether to generate text instead.</p>
           9  +
    /// <p>The Model automatically decides if a tool should be called or to whether to generate text instead.</p>
   10     10   
    Auto(crate::types::AutoToolChoice),
   11         -
    /// <p>The Model must request the specified tool. Only supported by Anthropic Claude 3 models.</p>
          11  +
    /// <p>The Model must request the specified tool.</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 +33,35 @@
    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. 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>
           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>
    4      6   
#[non_exhaustive]
    5      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      8   
pub struct ToolConfiguration {
    7      9   
    /// <p>An array of tools that you want to pass to a model.</p>
    8     10   
    pub tools: ::std::vec::Vec<crate::types::Tool>,
    9     11   
    /// <p>If supported by model, forces the model to request a tool.</p>
   10     12   
    pub tool_choice: ::std::option::Option<crate::types::ToolChoice>,
   11     13   
}
   12     14   
impl ToolConfiguration {
   13     15   
    /// <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 +99,69 @@
    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),
    9      7   
    /// <p>A tool result that is an image.</p><note>
   10      8   
    /// <p>This field is only supported by Anthropic Claude 3 models.</p>
   11      9   
    /// </note>
   12     10   
    Image(crate::types::ImageBlock),
   13     11   
    /// <p>A tool result that is JSON format data.</p>
   14     12   
    Json(::aws_smithy_types::Document),
   15     13   
    /// <p>A tool result that is text.</p>
   16     14   
    Text(::std::string::String),
   17         -
    /// <p>A tool result that is video.</p>
   18         -
    Video(crate::types::VideoBlock),
   19     15   
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
   20     16   
    /// An unknown enum variant
   21     17   
    ///
   22     18   
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
   23     19   
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
   24     20   
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
   25     21   
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
   26     22   
    #[non_exhaustive]
   27     23   
    Unknown,
   28     24   
}
   29     25   
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         -
    }
   43     26   
    /// Tries to convert the enum instance into [`Image`](crate::types::ToolResultContentBlock::Image), extracting the inner [`ImageBlock`](crate::types::ImageBlock).
   44     27   
    /// Returns `Err(&Self)` if it can't be converted.
   45     28   
    pub fn as_image(&self) -> ::std::result::Result<&crate::types::ImageBlock, &Self> {
   46     29   
        if let ToolResultContentBlock::Image(val) = &self {
   47     30   
            ::std::result::Result::Ok(val)
   48     31   
        } else {
   49     32   
            ::std::result::Result::Err(self)
   50     33   
        }
   51     34   
    }
   52     35   
    /// Returns true if this is a [`Image`](crate::types::ToolResultContentBlock::Image).
   53     36   
    pub fn is_image(&self) -> bool {
   54     37   
        self.as_image().is_ok()
   55     38   
    }
   56     39   
    /// Tries to convert the enum instance into [`Json`](crate::types::ToolResultContentBlock::Json), extracting the inner [`Document`](::aws_smithy_types::Document).
   57     40   
    /// Returns `Err(&Self)` if it can't be converted.
   58     41   
    pub fn as_json(&self) -> ::std::result::Result<&::aws_smithy_types::Document, &Self> {
   59     42   
        if let ToolResultContentBlock::Json(val) = &self {
   60     43   
            ::std::result::Result::Ok(val)
   61     44   
        } else {
   62     45   
            ::std::result::Result::Err(self)
   63     46   
        }
   64     47   
    }
   65     48   
    /// Returns true if this is a [`Json`](crate::types::ToolResultContentBlock::Json).
   66     49   
    pub fn is_json(&self) -> bool {
   67     50   
        self.as_json().is_ok()
   68     51   
    }
   69     52   
    /// Tries to convert the enum instance into [`Text`](crate::types::ToolResultContentBlock::Text), extracting the inner [`String`](::std::string::String).
   70     53   
    /// Returns `Err(&Self)` if it can't be converted.
   71     54   
    pub fn as_text(&self) -> ::std::result::Result<&::std::string::String, &Self> {
   72     55   
        if let ToolResultContentBlock::Text(val) = &self {
   73     56   
            ::std::result::Result::Ok(val)
   74     57   
        } else {
   75     58   
            ::std::result::Result::Err(self)
   76     59   
        }
   77     60   
    }
   78     61   
    /// Returns true if this is a [`Text`](crate::types::ToolResultContentBlock::Text).
   79     62   
    pub fn is_text(&self) -> bool {
   80     63   
        self.as_text().is_ok()
   81     64   
    }
   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         -
    }
   95     65   
    /// Returns true if the enum instance is the `Unknown` variant.
   96     66   
    pub fn is_unknown(&self) -> bool {
   97     67   
        matches!(self, Self::Unknown)
   98     68   
    }
   99     69   
}

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

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