AWS SDK

AWS SDK

rev. ba98f30b52e51c6e715b0ae469e7a2e988c27d9a (ignoring whitespace)

Files changed:

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

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

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

@@ -1,0 +281,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>A summary of an asynchronous invocation.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
    6         -
pub struct AsyncInvokeSummary {
    7         -
    /// <p>The invocation's ARN.</p>
    8         -
    pub invocation_arn: ::std::string::String,
    9         -
    /// <p>The invoked model's ARN.</p>
   10         -
    pub model_arn: ::std::string::String,
   11         -
    /// <p>The invocation's idempotency token.</p>
   12         -
    pub client_request_token: ::std::option::Option<::std::string::String>,
   13         -
    /// <p>The invocation's status.</p>
   14         -
    pub status: ::std::option::Option<crate::types::AsyncInvokeStatus>,
   15         -
    /// <p>An error message.</p>
   16         -
    pub failure_message: ::std::option::Option<::std::string::String>,
   17         -
    /// <p>When the invocation was submitted.</p>
   18         -
    pub submit_time: ::aws_smithy_types::DateTime,
   19         -
    /// <p>When the invocation was last modified.</p>
   20         -
    pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
   21         -
    /// <p>When the invocation ended.</p>
   22         -
    pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
   23         -
    /// <p>The invocation's output data settings.</p>
   24         -
    pub output_data_config: ::std::option::Option<crate::types::AsyncInvokeOutputDataConfig>,
   25         -
}
   26         -
impl AsyncInvokeSummary {
   27         -
    /// <p>The invocation's ARN.</p>
   28         -
    pub fn invocation_arn(&self) -> &str {
   29         -
        use std::ops::Deref;
   30         -
        self.invocation_arn.deref()
   31         -
    }
   32         -
    /// <p>The invoked model's ARN.</p>
   33         -
    pub fn model_arn(&self) -> &str {
   34         -
        use std::ops::Deref;
   35         -
        self.model_arn.deref()
   36         -
    }
   37         -
    /// <p>The invocation's idempotency token.</p>
   38         -
    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
   39         -
        self.client_request_token.as_deref()
   40         -
    }
   41         -
    /// <p>The invocation's status.</p>
   42         -
    pub fn status(&self) -> ::std::option::Option<&crate::types::AsyncInvokeStatus> {
   43         -
        self.status.as_ref()
   44         -
    }
   45         -
    /// <p>An error message.</p>
   46         -
    pub fn failure_message(&self) -> ::std::option::Option<&str> {
   47         -
        self.failure_message.as_deref()
   48         -
    }
   49         -
    /// <p>When the invocation was submitted.</p>
   50         -
    pub fn submit_time(&self) -> &::aws_smithy_types::DateTime {
   51         -
        &self.submit_time
   52         -
    }
   53         -
    /// <p>When the invocation was last modified.</p>
   54         -
    pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
   55         -
        self.last_modified_time.as_ref()
   56         -
    }
   57         -
    /// <p>When the invocation ended.</p>
   58         -
    pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
   59         -
        self.end_time.as_ref()
   60         -
    }
   61         -
    /// <p>The invocation's output data settings.</p>
   62         -
    pub fn output_data_config(&self) -> ::std::option::Option<&crate::types::AsyncInvokeOutputDataConfig> {
   63         -
        self.output_data_config.as_ref()
   64         -
    }
   65         -
}
   66         -
impl ::std::fmt::Debug for AsyncInvokeSummary {
   67         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
   68         -
        let mut formatter = f.debug_struct("AsyncInvokeSummary");
   69         -
        formatter.field("invocation_arn", &self.invocation_arn);
   70         -
        formatter.field("model_arn", &self.model_arn);
   71         -
        formatter.field("client_request_token", &self.client_request_token);
   72         -
        formatter.field("status", &self.status);
   73         -
        formatter.field("failure_message", &"*** Sensitive Data Redacted ***");
   74         -
        formatter.field("submit_time", &self.submit_time);
   75         -
        formatter.field("last_modified_time", &self.last_modified_time);
   76         -
        formatter.field("end_time", &self.end_time);
   77         -
        formatter.field("output_data_config", &self.output_data_config);
   78         -
        formatter.finish()
   79         -
    }
   80         -
}
   81         -
impl AsyncInvokeSummary {
   82         -
    /// Creates a new builder-style object to manufacture [`AsyncInvokeSummary`](crate::types::AsyncInvokeSummary).
   83         -
    pub fn builder() -> crate::types::builders::AsyncInvokeSummaryBuilder {
   84         -
        crate::types::builders::AsyncInvokeSummaryBuilder::default()
   85         -
    }
   86         -
}
   87         -
   88         -
/// A builder for [`AsyncInvokeSummary`](crate::types::AsyncInvokeSummary).
   89         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
   90         -
#[non_exhaustive]
   91         -
pub struct AsyncInvokeSummaryBuilder {
   92         -
    pub(crate) invocation_arn: ::std::option::Option<::std::string::String>,
   93         -
    pub(crate) model_arn: ::std::option::Option<::std::string::String>,
   94         -
    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
   95         -
    pub(crate) status: ::std::option::Option<crate::types::AsyncInvokeStatus>,
   96         -
    pub(crate) failure_message: ::std::option::Option<::std::string::String>,
   97         -
    pub(crate) submit_time: ::std::option::Option<::aws_smithy_types::DateTime>,
   98         -
    pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
   99         -
    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
  100         -
    pub(crate) output_data_config: ::std::option::Option<crate::types::AsyncInvokeOutputDataConfig>,
  101         -
}
  102         -
impl AsyncInvokeSummaryBuilder {
  103         -
    /// <p>The invocation's ARN.</p>
  104         -
    /// This field is required.
  105         -
    pub fn invocation_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  106         -
        self.invocation_arn = ::std::option::Option::Some(input.into());
  107         -
        self
  108         -
    }
  109         -
    /// <p>The invocation's ARN.</p>
  110         -
    pub fn set_invocation_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  111         -
        self.invocation_arn = input;
  112         -
        self
  113         -
    }
  114         -
    /// <p>The invocation's ARN.</p>
  115         -
    pub fn get_invocation_arn(&self) -> &::std::option::Option<::std::string::String> {
  116         -
        &self.invocation_arn
  117         -
    }
  118         -
    /// <p>The invoked model's ARN.</p>
  119         -
    /// This field is required.
  120         -
    pub fn model_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  121         -
        self.model_arn = ::std::option::Option::Some(input.into());
  122         -
        self
  123         -
    }
  124         -
    /// <p>The invoked model's ARN.</p>
  125         -
    pub fn set_model_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  126         -
        self.model_arn = input;
  127         -
        self
  128         -
    }
  129         -
    /// <p>The invoked model's ARN.</p>
  130         -
    pub fn get_model_arn(&self) -> &::std::option::Option<::std::string::String> {
  131         -
        &self.model_arn
  132         -
    }
  133         -
    /// <p>The invocation's idempotency token.</p>
  134         -
    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  135         -
        self.client_request_token = ::std::option::Option::Some(input.into());
  136         -
        self
  137         -
    }
  138         -
    /// <p>The invocation's idempotency token.</p>
  139         -
    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  140         -
        self.client_request_token = input;
  141         -
        self
  142         -
    }
  143         -
    /// <p>The invocation's idempotency token.</p>
  144         -
    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
  145         -
        &self.client_request_token
  146         -
    }
  147         -
    /// <p>The invocation's status.</p>
  148         -
    pub fn status(mut self, input: crate::types::AsyncInvokeStatus) -> Self {
  149         -
        self.status = ::std::option::Option::Some(input);
  150         -
        self
  151         -
    }
  152         -
    /// <p>The invocation's status.</p>
  153         -
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::AsyncInvokeStatus>) -> Self {
  154         -
        self.status = input;
  155         -
        self
  156         -
    }
  157         -
    /// <p>The invocation's status.</p>
  158         -
    pub fn get_status(&self) -> &::std::option::Option<crate::types::AsyncInvokeStatus> {
  159         -
        &self.status
  160         -
    }
  161         -
    /// <p>An error message.</p>
  162         -
    pub fn failure_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
  163         -
        self.failure_message = ::std::option::Option::Some(input.into());
  164         -
        self
  165         -
    }
  166         -
    /// <p>An error message.</p>
  167         -
    pub fn set_failure_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  168         -
        self.failure_message = input;
  169         -
        self
  170         -
    }
  171         -
    /// <p>An error message.</p>
  172         -
    pub fn get_failure_message(&self) -> &::std::option::Option<::std::string::String> {
  173         -
        &self.failure_message
  174         -
    }
  175         -
    /// <p>When the invocation was submitted.</p>
  176         -
    /// This field is required.
  177         -
    pub fn submit_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
  178         -
        self.submit_time = ::std::option::Option::Some(input);
  179         -
        self
  180         -
    }
  181         -
    /// <p>When the invocation was submitted.</p>
  182         -
    pub fn set_submit_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
  183         -
        self.submit_time = input;
  184         -
        self
  185         -
    }
  186         -
    /// <p>When the invocation was submitted.</p>
  187         -
    pub fn get_submit_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
  188         -
        &self.submit_time
  189         -
    }
  190         -
    /// <p>When the invocation was last modified.</p>
  191         -
    pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
  192         -
        self.last_modified_time = ::std::option::Option::Some(input);
  193         -
        self
  194         -
    }
  195         -
    /// <p>When the invocation was last modified.</p>
  196         -
    pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
  197         -
        self.last_modified_time = input;
  198         -
        self
  199         -
    }
  200         -
    /// <p>When the invocation was last modified.</p>
  201         -
    pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
  202         -
        &self.last_modified_time
  203         -
    }
  204         -
    /// <p>When the invocation ended.</p>
  205         -
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
  206         -
        self.end_time = ::std::option::Option::Some(input);
  207         -
        self
  208         -
    }
  209         -
    /// <p>When the invocation ended.</p>
  210         -
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
  211         -
        self.end_time = input;
  212         -
        self
  213         -
    }
  214         -
    /// <p>When the invocation ended.</p>
  215         -
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
  216         -
        &self.end_time
  217         -
    }
  218         -
    /// <p>The invocation's output data settings.</p>
  219         -
    /// This field is required.
  220         -
    pub fn output_data_config(mut self, input: crate::types::AsyncInvokeOutputDataConfig) -> Self {
  221         -
        self.output_data_config = ::std::option::Option::Some(input);
  222         -
        self
  223         -
    }
  224         -
    /// <p>The invocation's output data settings.</p>
  225         -
    pub fn set_output_data_config(mut self, input: ::std::option::Option<crate::types::AsyncInvokeOutputDataConfig>) -> Self {
  226         -
        self.output_data_config = input;
  227         -
        self
  228         -
    }
  229         -
    /// <p>The invocation's output data settings.</p>
  230         -
    pub fn get_output_data_config(&self) -> &::std::option::Option<crate::types::AsyncInvokeOutputDataConfig> {
  231         -
        &self.output_data_config
  232         -
    }
  233         -
    /// Consumes the builder and constructs a [`AsyncInvokeSummary`](crate::types::AsyncInvokeSummary).
  234         -
    /// This method will fail if any of the following fields are not set:
  235         -
    /// - [`invocation_arn`](crate::types::builders::AsyncInvokeSummaryBuilder::invocation_arn)
  236         -
    /// - [`model_arn`](crate::types::builders::AsyncInvokeSummaryBuilder::model_arn)
  237         -
    /// - [`submit_time`](crate::types::builders::AsyncInvokeSummaryBuilder::submit_time)
  238         -
    pub fn build(self) -> ::std::result::Result<crate::types::AsyncInvokeSummary, ::aws_smithy_types::error::operation::BuildError> {
  239         -
        ::std::result::Result::Ok(crate::types::AsyncInvokeSummary {
  240         -
            invocation_arn: self.invocation_arn.ok_or_else(|| {
  241         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  242         -
                    "invocation_arn",
  243         -
                    "invocation_arn was not specified but it is required when building AsyncInvokeSummary",
  244         -
                )
  245         -
            })?,
  246         -
            model_arn: self.model_arn.ok_or_else(|| {
  247         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  248         -
                    "model_arn",
  249         -
                    "model_arn was not specified but it is required when building AsyncInvokeSummary",
  250         -
                )
  251         -
            })?,
  252         -
            client_request_token: self.client_request_token,
  253         -
            status: self.status,
  254         -
            failure_message: self.failure_message,
  255         -
            submit_time: self.submit_time.ok_or_else(|| {
  256         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  257         -
                    "submit_time",
  258         -
                    "submit_time was not specified but it is required when building AsyncInvokeSummary",
  259         -
                )
  260         -
            })?,
  261         -
            last_modified_time: self.last_modified_time,
  262         -
            end_time: self.end_time,
  263         -
            output_data_config: self.output_data_config,
  264         -
        })
  265         -
    }
  266         -
}
  267         -
impl ::std::fmt::Debug for AsyncInvokeSummaryBuilder {
  268         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  269         -
        let mut formatter = f.debug_struct("AsyncInvokeSummaryBuilder");
  270         -
        formatter.field("invocation_arn", &self.invocation_arn);
  271         -
        formatter.field("model_arn", &self.model_arn);
  272         -
        formatter.field("client_request_token", &self.client_request_token);
  273         -
        formatter.field("status", &self.status);
  274         -
        formatter.field("failure_message", &"*** Sensitive Data Redacted ***");
  275         -
        formatter.field("submit_time", &self.submit_time);
  276         -
        formatter.field("last_modified_time", &self.last_modified_time);
  277         -
        formatter.field("end_time", &self.end_time);
  278         -
        formatter.field("output_data_config", &self.output_data_config);
  279         -
        formatter.finish()
  280         -
    }
  281         -
}

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

@@ -1,1 +23,23 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// <p>The Model automatically decides if a tool should be called or whether to generate text instead. For example, <code>{"auto" : {}}</code>.</p>
           3  +
/// <p>The Model automatically decides if a tool should be called or to whether to generate text instead.</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub struct AutoToolChoice {}
    7      7   
impl AutoToolChoice {
    8      8   
    /// Creates a new builder-style object to manufacture [`AutoToolChoice`](crate::types::AutoToolChoice).
    9      9   
    pub fn builder() -> crate::types::builders::AutoToolChoiceBuilder {
   10     10   
        crate::types::builders::AutoToolChoiceBuilder::default()
   11     11   
    }
   12     12   
}
   13     13   

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

@@ -1,0 +62,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>Payload content for the bidirectional input. The input is an audio stream.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
    6         -
pub struct BidirectionalInputPayloadPart {
    7         -
    /// <p>The audio content for the bidirectional input.</p>
    8         -
    pub bytes: ::std::option::Option<::aws_smithy_types::Blob>,
    9         -
}
   10         -
impl BidirectionalInputPayloadPart {
   11         -
    /// <p>The audio content for the bidirectional input.</p>
   12         -
    pub fn bytes(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
   13         -
        self.bytes.as_ref()
   14         -
    }
   15         -
}
   16         -
impl ::std::fmt::Debug for BidirectionalInputPayloadPart {
   17         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
   18         -
        let mut formatter = f.debug_struct("BidirectionalInputPayloadPart");
   19         -
        formatter.field("bytes", &"*** Sensitive Data Redacted ***");
   20         -
        formatter.finish()
   21         -
    }
   22         -
}
   23         -
impl BidirectionalInputPayloadPart {
   24         -
    /// Creates a new builder-style object to manufacture [`BidirectionalInputPayloadPart`](crate::types::BidirectionalInputPayloadPart).
   25         -
    pub fn builder() -> crate::types::builders::BidirectionalInputPayloadPartBuilder {
   26         -
        crate::types::builders::BidirectionalInputPayloadPartBuilder::default()
   27         -
    }
   28         -
}
   29         -
   30         -
/// A builder for [`BidirectionalInputPayloadPart`](crate::types::BidirectionalInputPayloadPart).
   31         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
   32         -
#[non_exhaustive]
   33         -
pub struct BidirectionalInputPayloadPartBuilder {
   34         -
    pub(crate) bytes: ::std::option::Option<::aws_smithy_types::Blob>,
   35         -
}
   36         -
impl BidirectionalInputPayloadPartBuilder {
   37         -
    /// <p>The audio content for the bidirectional input.</p>
   38         -
    pub fn bytes(mut self, input: ::aws_smithy_types::Blob) -> Self {
   39         -
        self.bytes = ::std::option::Option::Some(input);
   40         -
        self
   41         -
    }
   42         -
    /// <p>The audio content for the bidirectional input.</p>
   43         -
    pub fn set_bytes(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
   44         -
        self.bytes = input;
   45         -
        self
   46         -
    }
   47         -
    /// <p>The audio content for the bidirectional input.</p>
   48         -
    pub fn get_bytes(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
   49         -
        &self.bytes
   50         -
    }
   51         -
    /// Consumes the builder and constructs a [`BidirectionalInputPayloadPart`](crate::types::BidirectionalInputPayloadPart).
   52         -
    pub fn build(self) -> crate::types::BidirectionalInputPayloadPart {
   53         -
        crate::types::BidirectionalInputPayloadPart { bytes: self.bytes }
   54         -
    }
   55         -
}
   56         -
impl ::std::fmt::Debug for BidirectionalInputPayloadPartBuilder {
   57         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
   58         -
        let mut formatter = f.debug_struct("BidirectionalInputPayloadPartBuilder");
   59         -
        formatter.field("bytes", &"*** Sensitive Data Redacted ***");
   60         -
        formatter.finish()
   61         -
    }
   62         -
}

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

@@ -1,0 +62,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>Output from the bidirectional stream. The output is speech and a text transcription.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
    6         -
pub struct BidirectionalOutputPayloadPart {
    7         -
    /// <p>The speech output of the bidirectional stream.</p>
    8         -
    pub bytes: ::std::option::Option<::aws_smithy_types::Blob>,
    9         -
}
   10         -
impl BidirectionalOutputPayloadPart {
   11         -
    /// <p>The speech output of the bidirectional stream.</p>
   12         -
    pub fn bytes(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
   13         -
        self.bytes.as_ref()
   14         -
    }
   15         -
}
   16         -
impl ::std::fmt::Debug for BidirectionalOutputPayloadPart {
   17         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
   18         -
        let mut formatter = f.debug_struct("BidirectionalOutputPayloadPart");
   19         -
        formatter.field("bytes", &"*** Sensitive Data Redacted ***");
   20         -
        formatter.finish()
   21         -
    }
   22         -
}
   23         -
impl BidirectionalOutputPayloadPart {
   24         -
    /// Creates a new builder-style object to manufacture [`BidirectionalOutputPayloadPart`](crate::types::BidirectionalOutputPayloadPart).
   25         -
    pub fn builder() -> crate::types::builders::BidirectionalOutputPayloadPartBuilder {
   26         -
        crate::types::builders::BidirectionalOutputPayloadPartBuilder::default()
   27         -
    }
   28         -
}
   29         -
   30         -
/// A builder for [`BidirectionalOutputPayloadPart`](crate::types::BidirectionalOutputPayloadPart).
   31         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
   32         -
#[non_exhaustive]
   33         -
pub struct BidirectionalOutputPayloadPartBuilder {
   34         -
    pub(crate) bytes: ::std::option::Option<::aws_smithy_types::Blob>,
   35         -
}
   36         -
impl BidirectionalOutputPayloadPartBuilder {
   37         -
    /// <p>The speech output of the bidirectional stream.</p>
   38         -
    pub fn bytes(mut self, input: ::aws_smithy_types::Blob) -> Self {
   39         -
        self.bytes = ::std::option::Option::Some(input);
   40         -
        self
   41         -
    }
   42         -
    /// <p>The speech output of the bidirectional stream.</p>
   43         -
    pub fn set_bytes(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
   44         -
        self.bytes = input;
   45         -
        self
   46         -
    }
   47         -
    /// <p>The speech output of the bidirectional stream.</p>
   48         -
    pub fn get_bytes(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
   49         -
        &self.bytes
   50         -
    }
   51         -
    /// Consumes the builder and constructs a [`BidirectionalOutputPayloadPart`](crate::types::BidirectionalOutputPayloadPart).
   52         -
    pub fn build(self) -> crate::types::BidirectionalOutputPayloadPart {
   53         -
        crate::types::BidirectionalOutputPayloadPart { bytes: self.bytes }
   54         -
    }
   55         -
}
   56         -
impl ::std::fmt::Debug for BidirectionalOutputPayloadPartBuilder {
   57         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
   58         -
        let mut formatter = f.debug_struct("BidirectionalOutputPayloadPartBuilder");
   59         -
        formatter.field("bytes", &"*** Sensitive Data Redacted ***");
   60         -
        formatter.finish()
   61         -
    }
   62         -
}

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

@@ -1,0 +58,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>Defines a section of content to be cached for reuse in subsequent API calls.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct CachePointBlock {
    7         -
    /// <p>Specifies the type of cache point within the CachePointBlock.</p>
    8         -
    pub r#type: crate::types::CachePointType,
    9         -
}
   10         -
impl CachePointBlock {
   11         -
    /// <p>Specifies the type of cache point within the CachePointBlock.</p>
   12         -
    pub fn r#type(&self) -> &crate::types::CachePointType {
   13         -
        &self.r#type
   14         -
    }
   15         -
}
   16         -
impl CachePointBlock {
   17         -
    /// Creates a new builder-style object to manufacture [`CachePointBlock`](crate::types::CachePointBlock).
   18         -
    pub fn builder() -> crate::types::builders::CachePointBlockBuilder {
   19         -
        crate::types::builders::CachePointBlockBuilder::default()
   20         -
    }
   21         -
}
   22         -
   23         -
/// A builder for [`CachePointBlock`](crate::types::CachePointBlock).
   24         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   25         -
#[non_exhaustive]
   26         -
pub struct CachePointBlockBuilder {
   27         -
    pub(crate) r#type: ::std::option::Option<crate::types::CachePointType>,
   28         -
}
   29         -
impl CachePointBlockBuilder {
   30         -
    /// <p>Specifies the type of cache point within the CachePointBlock.</p>
   31         -
    /// This field is required.
   32         -
    pub fn r#type(mut self, input: crate::types::CachePointType) -> Self {
   33         -
        self.r#type = ::std::option::Option::Some(input);
   34         -
        self
   35         -
    }
   36         -
    /// <p>Specifies the type of cache point within the CachePointBlock.</p>
   37         -
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::CachePointType>) -> Self {
   38         -
        self.r#type = input;
   39         -
        self
   40         -
    }
   41         -
    /// <p>Specifies the type of cache point within the CachePointBlock.</p>
   42         -
    pub fn get_type(&self) -> &::std::option::Option<crate::types::CachePointType> {
   43         -
        &self.r#type
   44         -
    }
   45         -
    /// Consumes the builder and constructs a [`CachePointBlock`](crate::types::CachePointBlock).
   46         -
    /// This method will fail if any of the following fields are not set:
   47         -
    /// - [`r#type`](crate::types::builders::CachePointBlockBuilder::type)
   48         -
    pub fn build(self) -> ::std::result::Result<crate::types::CachePointBlock, ::aws_smithy_types::error::operation::BuildError> {
   49         -
        ::std::result::Result::Ok(crate::types::CachePointBlock {
   50         -
            r#type: self.r#type.ok_or_else(|| {
   51         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   52         -
                    "r#type",
   53         -
                    "r#type was not specified but it is required when building CachePointBlock",
   54         -
                )
   55         -
            })?,
   56         -
        })
   57         -
    }
   58         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/types/_cache_point_type.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 `CachePointType`, 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 cachepointtype = unimplemented!();
   14         -
/// match cachepointtype {
   15         -
///     CachePointType::Default => { /* ... */ },
   16         -
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
   17         -
///     _ => { /* ... */ },
   18         -
/// }
   19         -
/// ```
   20         -
/// The above code demonstrates that when `cachepointtype` represents
   21         -
/// `NewFeature`, the execution path will lead to the second last match arm,
   22         -
/// even though the enum does not contain a variant `CachePointType::NewFeature`
   23         -
/// in the current version of SDK. The reason is that the variable `other`,
   24         -
/// created by the `@` operator, is bound to
   25         -
/// `CachePointType::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 `CachePointType::NewFeature` is defined.
   29         -
/// Specifically, when `cachepointtype` represents `NewFeature`,
   30         -
/// the execution path will hit the second last match arm as before by virtue of
   31         -
/// calling `as_str` on `CachePointType::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 CachePointType {
   44         -
    #[allow(missing_docs)] // documentation missing in model
   45         -
    Default,
   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 CachePointType {
   51         -
    fn from(s: &str) -> Self {
   52         -
        match s {
   53         -
            "default" => CachePointType::Default,
   54         -
            other => CachePointType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
   55         -
        }
   56         -
    }
   57         -
}
   58         -
impl ::std::str::FromStr for CachePointType {
   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(CachePointType::from(s))
   63         -
    }
   64         -
}
   65         -
impl CachePointType {
   66         -
    /// Returns the `&str` value of the enum member.
   67         -
    pub fn as_str(&self) -> &str {
   68         -
        match self {
   69         -
            CachePointType::Default => "default",
   70         -
            CachePointType::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         -
        &["default"]
   76         -
    }
   77         -
}
   78         -
impl ::std::convert::AsRef<str> for CachePointType {
   79         -
    fn as_ref(&self) -> &str {
   80         -
        self.as_str()
   81         -
    }
   82         -
}
   83         -
impl CachePointType {
   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 CachePointType {
   96         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
   97         -
        match self {
   98         -
            CachePointType::Default => write!(f, "default"),
   99         -
            CachePointType::Unknown(value) => write!(f, "{}", value),
  100         -
        }
  101         -
    }
  102         -
}

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

@@ -1,0 +102,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>Contains information about a citation that references a specific source document. Citations provide traceability between the model's generated response and the source documents that informed that response.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct Citation {
    7         -
    /// <p>The title or identifier of the source document being cited.</p>
    8         -
    pub title: ::std::option::Option<::std::string::String>,
    9         -
    /// <p>The specific content from the source document that was referenced or cited in the generated response.</p>
   10         -
    pub source_content: ::std::option::Option<::std::vec::Vec<crate::types::CitationSourceContent>>,
   11         -
    /// <p>The precise location within the source document where the cited content can be found, including character positions, page numbers, or chunk identifiers.</p>
   12         -
    pub location: ::std::option::Option<crate::types::CitationLocation>,
   13         -
}
   14         -
impl Citation {
   15         -
    /// <p>The title or identifier of the source document being cited.</p>
   16         -
    pub fn title(&self) -> ::std::option::Option<&str> {
   17         -
        self.title.as_deref()
   18         -
    }
   19         -
    /// <p>The specific content from the source document that was referenced or cited in the generated response.</p>
   20         -
    ///
   21         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.source_content.is_none()`.
   22         -
    pub fn source_content(&self) -> &[crate::types::CitationSourceContent] {
   23         -
        self.source_content.as_deref().unwrap_or_default()
   24         -
    }
   25         -
    /// <p>The precise location within the source document where the cited content can be found, including character positions, page numbers, or chunk identifiers.</p>
   26         -
    pub fn location(&self) -> ::std::option::Option<&crate::types::CitationLocation> {
   27         -
        self.location.as_ref()
   28         -
    }
   29         -
}
   30         -
impl Citation {
   31         -
    /// Creates a new builder-style object to manufacture [`Citation`](crate::types::Citation).
   32         -
    pub fn builder() -> crate::types::builders::CitationBuilder {
   33         -
        crate::types::builders::CitationBuilder::default()
   34         -
    }
   35         -
}
   36         -
   37         -
/// A builder for [`Citation`](crate::types::Citation).
   38         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   39         -
#[non_exhaustive]
   40         -
pub struct CitationBuilder {
   41         -
    pub(crate) title: ::std::option::Option<::std::string::String>,
   42         -
    pub(crate) source_content: ::std::option::Option<::std::vec::Vec<crate::types::CitationSourceContent>>,
   43         -
    pub(crate) location: ::std::option::Option<crate::types::CitationLocation>,
   44         -
}
   45         -
impl CitationBuilder {
   46         -
    /// <p>The title or identifier of the source document being cited.</p>
   47         -
    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
   48         -
        self.title = ::std::option::Option::Some(input.into());
   49         -
        self
   50         -
    }
   51         -
    /// <p>The title or identifier of the source document being cited.</p>
   52         -
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
   53         -
        self.title = input;
   54         -
        self
   55         -
    }
   56         -
    /// <p>The title or identifier of the source document being cited.</p>
   57         -
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
   58         -
        &self.title
   59         -
    }
   60         -
    /// Appends an item to `source_content`.
   61         -
    ///
   62         -
    /// To override the contents of this collection use [`set_source_content`](Self::set_source_content).
   63         -
    ///
   64         -
    /// <p>The specific content from the source document that was referenced or cited in the generated response.</p>
   65         -
    pub fn source_content(mut self, input: crate::types::CitationSourceContent) -> Self {
   66         -
        let mut v = self.source_content.unwrap_or_default();
   67         -
        v.push(input);
   68         -
        self.source_content = ::std::option::Option::Some(v);
   69         -
        self
   70         -
    }
   71         -
    /// <p>The specific content from the source document that was referenced or cited in the generated response.</p>
   72         -
    pub fn set_source_content(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CitationSourceContent>>) -> Self {
   73         -
        self.source_content = input;
   74         -
        self
   75         -
    }
   76         -
    /// <p>The specific content from the source document that was referenced or cited in the generated response.</p>
   77         -
    pub fn get_source_content(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CitationSourceContent>> {
   78         -
        &self.source_content
   79         -
    }
   80         -
    /// <p>The precise location within the source document where the cited content can be found, including character positions, page numbers, or chunk identifiers.</p>
   81         -
    pub fn location(mut self, input: crate::types::CitationLocation) -> Self {
   82         -
        self.location = ::std::option::Option::Some(input);
   83         -
        self
   84         -
    }
   85         -
    /// <p>The precise location within the source document where the cited content can be found, including character positions, page numbers, or chunk identifiers.</p>
   86         -
    pub fn set_location(mut self, input: ::std::option::Option<crate::types::CitationLocation>) -> Self {
   87         -
        self.location = input;
   88         -
        self
   89         -
    }
   90         -
    /// <p>The precise location within the source document where the cited content can be found, including character positions, page numbers, or chunk identifiers.</p>
   91         -
    pub fn get_location(&self) -> &::std::option::Option<crate::types::CitationLocation> {
   92         -
        &self.location
   93         -
    }
   94         -
    /// Consumes the builder and constructs a [`Citation`](crate::types::Citation).
   95         -
    pub fn build(self) -> crate::types::Citation {
   96         -
        crate::types::Citation {
   97         -
            title: self.title,
   98         -
            source_content: self.source_content,
   99         -
            location: self.location,
  100         -
        }
  101         -
    }
  102         -
}

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

@@ -1,0 +38,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>Contains the generated text content that corresponds to or is supported by a citation from a source document.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub enum CitationGeneratedContent {
    7         -
    /// <p>The text content that was generated by the model and is supported by the associated citation.</p>
    8         -
    Text(::std::string::String),
    9         -
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
   10         -
    /// An unknown enum variant
   11         -
    ///
   12         -
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
   13         -
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
   14         -
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
   15         -
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
   16         -
    #[non_exhaustive]
   17         -
    Unknown,
   18         -
}
   19         -
impl CitationGeneratedContent {
   20         -
    #[allow(irrefutable_let_patterns)]
   21         -
    /// Tries to convert the enum instance into [`Text`](crate::types::CitationGeneratedContent::Text), extracting the inner [`String`](::std::string::String).
   22         -
    /// Returns `Err(&Self)` if it can't be converted.
   23         -
    pub fn as_text(&self) -> ::std::result::Result<&::std::string::String, &Self> {
   24         -
        if let CitationGeneratedContent::Text(val) = &self {
   25         -
            ::std::result::Result::Ok(val)
   26         -
        } else {
   27         -
            ::std::result::Result::Err(self)
   28         -
        }
   29         -
    }
   30         -
    /// Returns true if this is a [`Text`](crate::types::CitationGeneratedContent::Text).
   31         -
    pub fn is_text(&self) -> bool {
   32         -
        self.as_text().is_ok()
   33         -
    }
   34         -
    /// Returns true if the enum instance is the `Unknown` variant.
   35         -
    pub fn is_unknown(&self) -> bool {
   36         -
        matches!(self, Self::Unknown)
   37         -
    }
   38         -
}

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

@@ -1,0 +67,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>Specifies the precise location within a source document where cited content can be found. This can include character-level positions, page numbers, or document chunks depending on the document type and indexing method.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub enum CitationLocation {
    7         -
    /// <p>The character-level location within the document where the cited content is found.</p>
    8         -
    DocumentChar(crate::types::DocumentCharLocation),
    9         -
    /// <p>The chunk-level location within the document where the cited content is found, typically used for documents that have been segmented into logical chunks.</p>
   10         -
    DocumentChunk(crate::types::DocumentChunkLocation),
   11         -
    /// <p>The page-level location within the document where the cited content is found.</p>
   12         -
    DocumentPage(crate::types::DocumentPageLocation),
   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 CitationLocation {
   24         -
    /// Tries to convert the enum instance into [`DocumentChar`](crate::types::CitationLocation::DocumentChar), extracting the inner [`DocumentCharLocation`](crate::types::DocumentCharLocation).
   25         -
    /// Returns `Err(&Self)` if it can't be converted.
   26         -
    pub fn as_document_char(&self) -> ::std::result::Result<&crate::types::DocumentCharLocation, &Self> {
   27         -
        if let CitationLocation::DocumentChar(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 [`DocumentChar`](crate::types::CitationLocation::DocumentChar).
   34         -
    pub fn is_document_char(&self) -> bool {
   35         -
        self.as_document_char().is_ok()
   36         -
    }
   37         -
    /// Tries to convert the enum instance into [`DocumentChunk`](crate::types::CitationLocation::DocumentChunk), extracting the inner [`DocumentChunkLocation`](crate::types::DocumentChunkLocation).
   38         -
    /// Returns `Err(&Self)` if it can't be converted.
   39         -
    pub fn as_document_chunk(&self) -> ::std::result::Result<&crate::types::DocumentChunkLocation, &Self> {
   40         -
        if let CitationLocation::DocumentChunk(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 [`DocumentChunk`](crate::types::CitationLocation::DocumentChunk).
   47         -
    pub fn is_document_chunk(&self) -> bool {
   48         -
        self.as_document_chunk().is_ok()
   49         -
    }
   50         -
    /// Tries to convert the enum instance into [`DocumentPage`](crate::types::CitationLocation::DocumentPage), extracting the inner [`DocumentPageLocation`](crate::types::DocumentPageLocation).
   51         -
    /// Returns `Err(&Self)` if it can't be converted.
   52         -
    pub fn as_document_page(&self) -> ::std::result::Result<&crate::types::DocumentPageLocation, &Self> {
   53         -
        if let CitationLocation::DocumentPage(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 [`DocumentPage`](crate::types::CitationLocation::DocumentPage).
   60         -
    pub fn is_document_page(&self) -> bool {
   61         -
        self.as_document_page().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         -
}

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

@@ -1,0 +38,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>Contains the actual text content from a source document that is being cited or referenced in the model's response.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub enum CitationSourceContent {
    7         -
    /// <p>The text content from the source document that is being cited.</p>
    8         -
    Text(::std::string::String),
    9         -
    /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
   10         -
    /// An unknown enum variant
   11         -
    ///
   12         -
    /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
   13         -
    /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
   14         -
    /// by the client. This can happen when the server adds new functionality, but the client has not been updated.
   15         -
    /// To investigate this, consider turning on debug logging to print the raw HTTP response.
   16         -
    #[non_exhaustive]
   17         -
    Unknown,
   18         -
}
   19         -
impl CitationSourceContent {
   20         -
    #[allow(irrefutable_let_patterns)]
   21         -
    /// Tries to convert the enum instance into [`Text`](crate::types::CitationSourceContent::Text), extracting the inner [`String`](::std::string::String).
   22         -
    /// Returns `Err(&Self)` if it can't be converted.
   23         -
    pub fn as_text(&self) -> ::std::result::Result<&::std::string::String, &Self> {
   24         -
        if let CitationSourceContent::Text(val) = &self {
   25         -
            ::std::result::Result::Ok(val)
   26         -
        } else {
   27         -
            ::std::result::Result::Err(self)
   28         -
        }
   29         -
    }
   30         -
    /// Returns true if this is a [`Text`](crate::types::CitationSourceContent::Text).
   31         -
    pub fn is_text(&self) -> bool {
   32         -
        self.as_text().is_ok()
   33         -
    }
   34         -
    /// Returns true if the enum instance is the `Unknown` variant.
   35         -
    pub fn is_unknown(&self) -> bool {
   36         -
        matches!(self, Self::Unknown)
   37         -
    }
   38         -
}

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

@@ -1,0 +48,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>Contains incremental updates to the source content text during streaming responses, allowing clients to build up the cited content progressively.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct CitationSourceContentDelta {
    7         -
    /// <p>An incremental update to the text content from the source document that is being cited.</p>
    8         -
    pub text: ::std::option::Option<::std::string::String>,
    9         -
}
   10         -
impl CitationSourceContentDelta {
   11         -
    /// <p>An incremental update to the text content from the source document that is being cited.</p>
   12         -
    pub fn text(&self) -> ::std::option::Option<&str> {
   13         -
        self.text.as_deref()
   14         -
    }
   15         -
}
   16         -
impl CitationSourceContentDelta {
   17         -
    /// Creates a new builder-style object to manufacture [`CitationSourceContentDelta`](crate::types::CitationSourceContentDelta).
   18         -
    pub fn builder() -> crate::types::builders::CitationSourceContentDeltaBuilder {
   19         -
        crate::types::builders::CitationSourceContentDeltaBuilder::default()
   20         -
    }
   21         -
}
   22         -
   23         -
/// A builder for [`CitationSourceContentDelta`](crate::types::CitationSourceContentDelta).
   24         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   25         -
#[non_exhaustive]
   26         -
pub struct CitationSourceContentDeltaBuilder {
   27         -
    pub(crate) text: ::std::option::Option<::std::string::String>,
   28         -
}
   29         -
impl CitationSourceContentDeltaBuilder {
   30         -
    /// <p>An incremental update to the text content from the source document that is being cited.</p>
   31         -
    pub fn text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
   32         -
        self.text = ::std::option::Option::Some(input.into());
   33         -
        self
   34         -
    }
   35         -
    /// <p>An incremental update to the text content from the source document that is being cited.</p>
   36         -
    pub fn set_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
   37         -
        self.text = input;
   38         -
        self
   39         -
    }
   40         -
    /// <p>An incremental update to the text content from the source document that is being cited.</p>
   41         -
    pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
   42         -
        &self.text
   43         -
    }
   44         -
    /// Consumes the builder and constructs a [`CitationSourceContentDelta`](crate::types::CitationSourceContentDelta).
   45         -
    pub fn build(self) -> crate::types::CitationSourceContentDelta {
   46         -
        crate::types::CitationSourceContentDelta { text: self.text }
   47         -
    }
   48         -
}

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

@@ -1,0 +58,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>Configuration settings for enabling and controlling document citations in Converse API responses. When enabled, the model can include citation information that links generated content back to specific source documents.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct CitationsConfig {
    7         -
    /// <p>Specifies whether document citations should be included in the model's response. When set to true, the model can generate citations that reference the source documents used to inform the response.</p>
    8         -
    pub enabled: bool,
    9         -
}
   10         -
impl CitationsConfig {
   11         -
    /// <p>Specifies whether document citations should be included in the model's response. When set to true, the model can generate citations that reference the source documents used to inform the response.</p>
   12         -
    pub fn enabled(&self) -> bool {
   13         -
        self.enabled
   14         -
    }
   15         -
}
   16         -
impl CitationsConfig {
   17         -
    /// Creates a new builder-style object to manufacture [`CitationsConfig`](crate::types::CitationsConfig).
   18         -
    pub fn builder() -> crate::types::builders::CitationsConfigBuilder {
   19         -
        crate::types::builders::CitationsConfigBuilder::default()
   20         -
    }
   21         -
}
   22         -
   23         -
/// A builder for [`CitationsConfig`](crate::types::CitationsConfig).
   24         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   25         -
#[non_exhaustive]
   26         -
pub struct CitationsConfigBuilder {
   27         -
    pub(crate) enabled: ::std::option::Option<bool>,
   28         -
}
   29         -
impl CitationsConfigBuilder {
   30         -
    /// <p>Specifies whether document citations should be included in the model's response. When set to true, the model can generate citations that reference the source documents used to inform the response.</p>
   31         -
    /// This field is required.
   32         -
    pub fn enabled(mut self, input: bool) -> Self {
   33         -
        self.enabled = ::std::option::Option::Some(input);
   34         -
        self
   35         -
    }
   36         -
    /// <p>Specifies whether document citations should be included in the model's response. When set to true, the model can generate citations that reference the source documents used to inform the response.</p>
   37         -
    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
   38         -
        self.enabled = input;
   39         -
        self
   40         -
    }
   41         -
    /// <p>Specifies whether document citations should be included in the model's response. When set to true, the model can generate citations that reference the source documents used to inform the response.</p>
   42         -
    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
   43         -
        &self.enabled
   44         -
    }
   45         -
    /// Consumes the builder and constructs a [`CitationsConfig`](crate::types::CitationsConfig).
   46         -
    /// This method will fail if any of the following fields are not set:
   47         -
    /// - [`enabled`](crate::types::builders::CitationsConfigBuilder::enabled)
   48         -
    pub fn build(self) -> ::std::result::Result<crate::types::CitationsConfig, ::aws_smithy_types::error::operation::BuildError> {
   49         -
        ::std::result::Result::Ok(crate::types::CitationsConfig {
   50         -
            enabled: self.enabled.ok_or_else(|| {
   51         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   52         -
                    "enabled",
   53         -
                    "enabled was not specified but it is required when building CitationsConfig",
   54         -
                )
   55         -
            })?,
   56         -
        })
   57         -
    }
   58         -
}