AWS SDK

AWS SDK

rev. 5673a7a38b4a4a6973351c005d572863803729fe (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,154 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>A Top level guardrail trace object. For more information, see <code>ConverseTrace</code>.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct GuardrailTraceAssessment {
           7  +
    /// <p>The output from the model.</p>
           8  +
    pub model_output: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
           9  +
    /// <p>The input assessment.</p>
          10  +
    pub input_assessment: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::GuardrailAssessment>>,
          11  +
    /// <p>the output assessments.</p>
          12  +
    pub output_assessments:
          13  +
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::GuardrailAssessment>>>,
          14  +
    /// <p>Provides the reason for the action taken when harmful content is detected.</p>
          15  +
    pub action_reason: ::std::option::Option<::std::string::String>,
          16  +
}
          17  +
impl GuardrailTraceAssessment {
          18  +
    /// <p>The output from the model.</p>
          19  +
    ///
          20  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.model_output.is_none()`.
          21  +
    pub fn model_output(&self) -> &[::std::string::String] {
          22  +
        self.model_output.as_deref().unwrap_or_default()
          23  +
    }
          24  +
    /// <p>The input assessment.</p>
          25  +
    pub fn input_assessment(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::GuardrailAssessment>> {
          26  +
        self.input_assessment.as_ref()
          27  +
    }
          28  +
    /// <p>the output assessments.</p>
          29  +
    pub fn output_assessments(
          30  +
        &self,
          31  +
    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::GuardrailAssessment>>> {
          32  +
        self.output_assessments.as_ref()
          33  +
    }
          34  +
    /// <p>Provides the reason for the action taken when harmful content is detected.</p>
          35  +
    pub fn action_reason(&self) -> ::std::option::Option<&str> {
          36  +
        self.action_reason.as_deref()
          37  +
    }
          38  +
}
          39  +
impl GuardrailTraceAssessment {
          40  +
    /// Creates a new builder-style object to manufacture [`GuardrailTraceAssessment`](crate::types::GuardrailTraceAssessment).
          41  +
    pub fn builder() -> crate::types::builders::GuardrailTraceAssessmentBuilder {
          42  +
        crate::types::builders::GuardrailTraceAssessmentBuilder::default()
          43  +
    }
          44  +
}
          45  +
          46  +
/// A builder for [`GuardrailTraceAssessment`](crate::types::GuardrailTraceAssessment).
          47  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          48  +
#[non_exhaustive]
          49  +
pub struct GuardrailTraceAssessmentBuilder {
          50  +
    pub(crate) model_output: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          51  +
    pub(crate) input_assessment: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::GuardrailAssessment>>,
          52  +
    pub(crate) output_assessments:
          53  +
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::GuardrailAssessment>>>,
          54  +
    pub(crate) action_reason: ::std::option::Option<::std::string::String>,
          55  +
}
          56  +
impl GuardrailTraceAssessmentBuilder {
          57  +
    /// Appends an item to `model_output`.
          58  +
    ///
          59  +
    /// To override the contents of this collection use [`set_model_output`](Self::set_model_output).
          60  +
    ///
          61  +
    /// <p>The output from the model.</p>
          62  +
    pub fn model_output(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          63  +
        let mut v = self.model_output.unwrap_or_default();
          64  +
        v.push(input.into());
          65  +
        self.model_output = ::std::option::Option::Some(v);
          66  +
        self
          67  +
    }
          68  +
    /// <p>The output from the model.</p>
          69  +
    pub fn set_model_output(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
          70  +
        self.model_output = input;
          71  +
        self
          72  +
    }
          73  +
    /// <p>The output from the model.</p>
          74  +
    pub fn get_model_output(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
          75  +
        &self.model_output
          76  +
    }
          77  +
    /// Adds a key-value pair to `input_assessment`.
          78  +
    ///
          79  +
    /// To override the contents of this collection use [`set_input_assessment`](Self::set_input_assessment).
          80  +
    ///
          81  +
    /// <p>The input assessment.</p>
          82  +
    pub fn input_assessment(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::GuardrailAssessment) -> Self {
          83  +
        let mut hash_map = self.input_assessment.unwrap_or_default();
          84  +
        hash_map.insert(k.into(), v);
          85  +
        self.input_assessment = ::std::option::Option::Some(hash_map);
          86  +
        self
          87  +
    }
          88  +
    /// <p>The input assessment.</p>
          89  +
    pub fn set_input_assessment(
          90  +
        mut self,
          91  +
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::GuardrailAssessment>>,
          92  +
    ) -> Self {
          93  +
        self.input_assessment = input;
          94  +
        self
          95  +
    }
          96  +
    /// <p>The input assessment.</p>
          97  +
    pub fn get_input_assessment(
          98  +
        &self,
          99  +
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::GuardrailAssessment>> {
         100  +
        &self.input_assessment
         101  +
    }
         102  +
    /// Adds a key-value pair to `output_assessments`.
         103  +
    ///
         104  +
    /// To override the contents of this collection use [`set_output_assessments`](Self::set_output_assessments).
         105  +
    ///
         106  +
    /// <p>the output assessments.</p>
         107  +
    pub fn output_assessments(
         108  +
        mut self,
         109  +
        k: impl ::std::convert::Into<::std::string::String>,
         110  +
        v: ::std::vec::Vec<crate::types::GuardrailAssessment>,
         111  +
    ) -> Self {
         112  +
        let mut hash_map = self.output_assessments.unwrap_or_default();
         113  +
        hash_map.insert(k.into(), v);
         114  +
        self.output_assessments = ::std::option::Option::Some(hash_map);
         115  +
        self
         116  +
    }
         117  +
    /// <p>the output assessments.</p>
         118  +
    pub fn set_output_assessments(
         119  +
        mut self,
         120  +
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::GuardrailAssessment>>>,
         121  +
    ) -> Self {
         122  +
        self.output_assessments = input;
         123  +
        self
         124  +
    }
         125  +
    /// <p>the output assessments.</p>
         126  +
    pub fn get_output_assessments(
         127  +
        &self,
         128  +
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::GuardrailAssessment>>> {
         129  +
        &self.output_assessments
         130  +
    }
         131  +
    /// <p>Provides the reason for the action taken when harmful content is detected.</p>
         132  +
    pub fn action_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         133  +
        self.action_reason = ::std::option::Option::Some(input.into());
         134  +
        self
         135  +
    }
         136  +
    /// <p>Provides the reason for the action taken when harmful content is detected.</p>
         137  +
    pub fn set_action_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         138  +
        self.action_reason = input;
         139  +
        self
         140  +
    }
         141  +
    /// <p>Provides the reason for the action taken when harmful content is detected.</p>
         142  +
    pub fn get_action_reason(&self) -> &::std::option::Option<::std::string::String> {
         143  +
        &self.action_reason
         144  +
    }
         145  +
    /// Consumes the builder and constructs a [`GuardrailTraceAssessment`](crate::types::GuardrailTraceAssessment).
         146  +
    pub fn build(self) -> crate::types::GuardrailTraceAssessment {
         147  +
        crate::types::GuardrailTraceAssessment {
         148  +
            model_output: self.model_output,
         149  +
            input_assessment: self.input_assessment,
         150  +
            output_assessments: self.output_assessments,
         151  +
            action_reason: self.action_reason,
         152  +
        }
         153  +
    }
         154  +
}

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

@@ -0,1 +0,225 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>The details on the use of the guardrail.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct GuardrailUsage {
           7  +
    /// <p>The topic policy units processed by the guardrail.</p>
           8  +
    pub topic_policy_units: i32,
           9  +
    /// <p>The content policy units processed by the guardrail.</p>
          10  +
    pub content_policy_units: i32,
          11  +
    /// <p>The word policy units processed by the guardrail.</p>
          12  +
    pub word_policy_units: i32,
          13  +
    /// <p>The sensitive information policy units processed by the guardrail.</p>
          14  +
    pub sensitive_information_policy_units: i32,
          15  +
    /// <p>The sensitive information policy free units processed by the guardrail.</p>
          16  +
    pub sensitive_information_policy_free_units: i32,
          17  +
    /// <p>The contextual grounding policy units processed by the guardrail.</p>
          18  +
    pub contextual_grounding_policy_units: i32,
          19  +
    /// <p>The content policy image units processed by the guardrail.</p>
          20  +
    pub content_policy_image_units: ::std::option::Option<i32>,
          21  +
}
          22  +
impl GuardrailUsage {
          23  +
    /// <p>The topic policy units processed by the guardrail.</p>
          24  +
    pub fn topic_policy_units(&self) -> i32 {
          25  +
        self.topic_policy_units
          26  +
    }
          27  +
    /// <p>The content policy units processed by the guardrail.</p>
          28  +
    pub fn content_policy_units(&self) -> i32 {
          29  +
        self.content_policy_units
          30  +
    }
          31  +
    /// <p>The word policy units processed by the guardrail.</p>
          32  +
    pub fn word_policy_units(&self) -> i32 {
          33  +
        self.word_policy_units
          34  +
    }
          35  +
    /// <p>The sensitive information policy units processed by the guardrail.</p>
          36  +
    pub fn sensitive_information_policy_units(&self) -> i32 {
          37  +
        self.sensitive_information_policy_units
          38  +
    }
          39  +
    /// <p>The sensitive information policy free units processed by the guardrail.</p>
          40  +
    pub fn sensitive_information_policy_free_units(&self) -> i32 {
          41  +
        self.sensitive_information_policy_free_units
          42  +
    }
          43  +
    /// <p>The contextual grounding policy units processed by the guardrail.</p>
          44  +
    pub fn contextual_grounding_policy_units(&self) -> i32 {
          45  +
        self.contextual_grounding_policy_units
          46  +
    }
          47  +
    /// <p>The content policy image units processed by the guardrail.</p>
          48  +
    pub fn content_policy_image_units(&self) -> ::std::option::Option<i32> {
          49  +
        self.content_policy_image_units
          50  +
    }
          51  +
}
          52  +
impl GuardrailUsage {
          53  +
    /// Creates a new builder-style object to manufacture [`GuardrailUsage`](crate::types::GuardrailUsage).
          54  +
    pub fn builder() -> crate::types::builders::GuardrailUsageBuilder {
          55  +
        crate::types::builders::GuardrailUsageBuilder::default()
          56  +
    }
          57  +
}
          58  +
          59  +
/// A builder for [`GuardrailUsage`](crate::types::GuardrailUsage).
          60  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          61  +
#[non_exhaustive]
          62  +
pub struct GuardrailUsageBuilder {
          63  +
    pub(crate) topic_policy_units: ::std::option::Option<i32>,
          64  +
    pub(crate) content_policy_units: ::std::option::Option<i32>,
          65  +
    pub(crate) word_policy_units: ::std::option::Option<i32>,
          66  +
    pub(crate) sensitive_information_policy_units: ::std::option::Option<i32>,
          67  +
    pub(crate) sensitive_information_policy_free_units: ::std::option::Option<i32>,
          68  +
    pub(crate) contextual_grounding_policy_units: ::std::option::Option<i32>,
          69  +
    pub(crate) content_policy_image_units: ::std::option::Option<i32>,
          70  +
}
          71  +
impl GuardrailUsageBuilder {
          72  +
    /// <p>The topic policy units processed by the guardrail.</p>
          73  +
    /// This field is required.
          74  +
    pub fn topic_policy_units(mut self, input: i32) -> Self {
          75  +
        self.topic_policy_units = ::std::option::Option::Some(input);
          76  +
        self
          77  +
    }
          78  +
    /// <p>The topic policy units processed by the guardrail.</p>
          79  +
    pub fn set_topic_policy_units(mut self, input: ::std::option::Option<i32>) -> Self {
          80  +
        self.topic_policy_units = input;
          81  +
        self
          82  +
    }
          83  +
    /// <p>The topic policy units processed by the guardrail.</p>
          84  +
    pub fn get_topic_policy_units(&self) -> &::std::option::Option<i32> {
          85  +
        &self.topic_policy_units
          86  +
    }
          87  +
    /// <p>The content policy units processed by the guardrail.</p>
          88  +
    /// This field is required.
          89  +
    pub fn content_policy_units(mut self, input: i32) -> Self {
          90  +
        self.content_policy_units = ::std::option::Option::Some(input);
          91  +
        self
          92  +
    }
          93  +
    /// <p>The content policy units processed by the guardrail.</p>
          94  +
    pub fn set_content_policy_units(mut self, input: ::std::option::Option<i32>) -> Self {
          95  +
        self.content_policy_units = input;
          96  +
        self
          97  +
    }
          98  +
    /// <p>The content policy units processed by the guardrail.</p>
          99  +
    pub fn get_content_policy_units(&self) -> &::std::option::Option<i32> {
         100  +
        &self.content_policy_units
         101  +
    }
         102  +
    /// <p>The word policy units processed by the guardrail.</p>
         103  +
    /// This field is required.
         104  +
    pub fn word_policy_units(mut self, input: i32) -> Self {
         105  +
        self.word_policy_units = ::std::option::Option::Some(input);
         106  +
        self
         107  +
    }
         108  +
    /// <p>The word policy units processed by the guardrail.</p>
         109  +
    pub fn set_word_policy_units(mut self, input: ::std::option::Option<i32>) -> Self {
         110  +
        self.word_policy_units = input;
         111  +
        self
         112  +
    }
         113  +
    /// <p>The word policy units processed by the guardrail.</p>
         114  +
    pub fn get_word_policy_units(&self) -> &::std::option::Option<i32> {
         115  +
        &self.word_policy_units
         116  +
    }
         117  +
    /// <p>The sensitive information policy units processed by the guardrail.</p>
         118  +
    /// This field is required.
         119  +
    pub fn sensitive_information_policy_units(mut self, input: i32) -> Self {
         120  +
        self.sensitive_information_policy_units = ::std::option::Option::Some(input);
         121  +
        self
         122  +
    }
         123  +
    /// <p>The sensitive information policy units processed by the guardrail.</p>
         124  +
    pub fn set_sensitive_information_policy_units(mut self, input: ::std::option::Option<i32>) -> Self {
         125  +
        self.sensitive_information_policy_units = input;
         126  +
        self
         127  +
    }
         128  +
    /// <p>The sensitive information policy units processed by the guardrail.</p>
         129  +
    pub fn get_sensitive_information_policy_units(&self) -> &::std::option::Option<i32> {
         130  +
        &self.sensitive_information_policy_units
         131  +
    }
         132  +
    /// <p>The sensitive information policy free units processed by the guardrail.</p>
         133  +
    /// This field is required.
         134  +
    pub fn sensitive_information_policy_free_units(mut self, input: i32) -> Self {
         135  +
        self.sensitive_information_policy_free_units = ::std::option::Option::Some(input);
         136  +
        self
         137  +
    }
         138  +
    /// <p>The sensitive information policy free units processed by the guardrail.</p>
         139  +
    pub fn set_sensitive_information_policy_free_units(mut self, input: ::std::option::Option<i32>) -> Self {
         140  +
        self.sensitive_information_policy_free_units = input;
         141  +
        self
         142  +
    }
         143  +
    /// <p>The sensitive information policy free units processed by the guardrail.</p>
         144  +
    pub fn get_sensitive_information_policy_free_units(&self) -> &::std::option::Option<i32> {
         145  +
        &self.sensitive_information_policy_free_units
         146  +
    }
         147  +
    /// <p>The contextual grounding policy units processed by the guardrail.</p>
         148  +
    /// This field is required.
         149  +
    pub fn contextual_grounding_policy_units(mut self, input: i32) -> Self {
         150  +
        self.contextual_grounding_policy_units = ::std::option::Option::Some(input);
         151  +
        self
         152  +
    }
         153  +
    /// <p>The contextual grounding policy units processed by the guardrail.</p>
         154  +
    pub fn set_contextual_grounding_policy_units(mut self, input: ::std::option::Option<i32>) -> Self {
         155  +
        self.contextual_grounding_policy_units = input;
         156  +
        self
         157  +
    }
         158  +
    /// <p>The contextual grounding policy units processed by the guardrail.</p>
         159  +
    pub fn get_contextual_grounding_policy_units(&self) -> &::std::option::Option<i32> {
         160  +
        &self.contextual_grounding_policy_units
         161  +
    }
         162  +
    /// <p>The content policy image units processed by the guardrail.</p>
         163  +
    pub fn content_policy_image_units(mut self, input: i32) -> Self {
         164  +
        self.content_policy_image_units = ::std::option::Option::Some(input);
         165  +
        self
         166  +
    }
         167  +
    /// <p>The content policy image units processed by the guardrail.</p>
         168  +
    pub fn set_content_policy_image_units(mut self, input: ::std::option::Option<i32>) -> Self {
         169  +
        self.content_policy_image_units = input;
         170  +
        self
         171  +
    }
         172  +
    /// <p>The content policy image units processed by the guardrail.</p>
         173  +
    pub fn get_content_policy_image_units(&self) -> &::std::option::Option<i32> {
         174  +
        &self.content_policy_image_units
         175  +
    }
         176  +
    /// Consumes the builder and constructs a [`GuardrailUsage`](crate::types::GuardrailUsage).
         177  +
    /// This method will fail if any of the following fields are not set:
         178  +
    /// - [`topic_policy_units`](crate::types::builders::GuardrailUsageBuilder::topic_policy_units)
         179  +
    /// - [`content_policy_units`](crate::types::builders::GuardrailUsageBuilder::content_policy_units)
         180  +
    /// - [`word_policy_units`](crate::types::builders::GuardrailUsageBuilder::word_policy_units)
         181  +
    /// - [`sensitive_information_policy_units`](crate::types::builders::GuardrailUsageBuilder::sensitive_information_policy_units)
         182  +
    /// - [`sensitive_information_policy_free_units`](crate::types::builders::GuardrailUsageBuilder::sensitive_information_policy_free_units)
         183  +
    /// - [`contextual_grounding_policy_units`](crate::types::builders::GuardrailUsageBuilder::contextual_grounding_policy_units)
         184  +
    pub fn build(self) -> ::std::result::Result<crate::types::GuardrailUsage, ::aws_smithy_types::error::operation::BuildError> {
         185  +
        ::std::result::Result::Ok(crate::types::GuardrailUsage {
         186  +
            topic_policy_units: self.topic_policy_units.ok_or_else(|| {
         187  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         188  +
                    "topic_policy_units",
         189  +
                    "topic_policy_units was not specified but it is required when building GuardrailUsage",
         190  +
                )
         191  +
            })?,
         192  +
            content_policy_units: self.content_policy_units.ok_or_else(|| {
         193  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         194  +
                    "content_policy_units",
         195  +
                    "content_policy_units was not specified but it is required when building GuardrailUsage",
         196  +
                )
         197  +
            })?,
         198  +
            word_policy_units: self.word_policy_units.ok_or_else(|| {
         199  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         200  +
                    "word_policy_units",
         201  +
                    "word_policy_units was not specified but it is required when building GuardrailUsage",
         202  +
                )
         203  +
            })?,
         204  +
            sensitive_information_policy_units: self.sensitive_information_policy_units.ok_or_else(|| {
         205  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         206  +
                    "sensitive_information_policy_units",
         207  +
                    "sensitive_information_policy_units was not specified but it is required when building GuardrailUsage",
         208  +
                )
         209  +
            })?,
         210  +
            sensitive_information_policy_free_units: self.sensitive_information_policy_free_units.ok_or_else(|| {
         211  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         212  +
                    "sensitive_information_policy_free_units",
         213  +
                    "sensitive_information_policy_free_units was not specified but it is required when building GuardrailUsage",
         214  +
                )
         215  +
            })?,
         216  +
            contextual_grounding_policy_units: self.contextual_grounding_policy_units.ok_or_else(|| {
         217  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         218  +
                    "contextual_grounding_policy_units",
         219  +
                    "contextual_grounding_policy_units was not specified but it is required when building GuardrailUsage",
         220  +
                )
         221  +
            })?,
         222  +
            content_policy_image_units: self.content_policy_image_units,
         223  +
        })
         224  +
    }
         225  +
}

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

@@ -0,1 +0,108 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// When writing a match expression against `GuardrailWordPolicyAction`, 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 guardrailwordpolicyaction = unimplemented!();
          14  +
/// match guardrailwordpolicyaction {
          15  +
///     GuardrailWordPolicyAction::Blocked => { /* ... */ },
          16  +
///     GuardrailWordPolicyAction::None => { /* ... */ },
          17  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          18  +
///     _ => { /* ... */ },
          19  +
/// }
          20  +
/// ```
          21  +
/// The above code demonstrates that when `guardrailwordpolicyaction` represents
          22  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          23  +
/// even though the enum does not contain a variant `GuardrailWordPolicyAction::NewFeature`
          24  +
/// in the current version of SDK. The reason is that the variable `other`,
          25  +
/// created by the `@` operator, is bound to
          26  +
/// `GuardrailWordPolicyAction::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 `GuardrailWordPolicyAction::NewFeature` is defined.
          30  +
/// Specifically, when `guardrailwordpolicyaction` represents `NewFeature`,
          31  +
/// the execution path will hit the second last match arm as before by virtue of
          32  +
/// calling `as_str` on `GuardrailWordPolicyAction::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 GuardrailWordPolicyAction {
          45  +
    #[allow(missing_docs)] // documentation missing in model
          46  +
    Blocked,
          47  +
    #[allow(missing_docs)] // documentation missing in model
          48  +
    None,
          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 GuardrailWordPolicyAction {
          54  +
    fn from(s: &str) -> Self {
          55  +
        match s {
          56  +
            "BLOCKED" => GuardrailWordPolicyAction::Blocked,
          57  +
            "NONE" => GuardrailWordPolicyAction::None,
          58  +
            other => GuardrailWordPolicyAction::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          59  +
        }
          60  +
    }
          61  +
}
          62  +
impl ::std::str::FromStr for GuardrailWordPolicyAction {
          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(GuardrailWordPolicyAction::from(s))
          67  +
    }
          68  +
}
          69  +
impl GuardrailWordPolicyAction {
          70  +
    /// Returns the `&str` value of the enum member.
          71  +
    pub fn as_str(&self) -> &str {
          72  +
        match self {
          73  +
            GuardrailWordPolicyAction::Blocked => "BLOCKED",
          74  +
            GuardrailWordPolicyAction::None => "NONE",
          75  +
            GuardrailWordPolicyAction::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  +
        &["BLOCKED", "NONE"]
          81  +
    }
          82  +
}
          83  +
impl ::std::convert::AsRef<str> for GuardrailWordPolicyAction {
          84  +
    fn as_ref(&self) -> &str {
          85  +
        self.as_str()
          86  +
    }
          87  +
}
          88  +
impl GuardrailWordPolicyAction {
          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 GuardrailWordPolicyAction {
         101  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         102  +
        match self {
         103  +
            GuardrailWordPolicyAction::Blocked => write!(f, "BLOCKED"),
         104  +
            GuardrailWordPolicyAction::None => write!(f, "NONE"),
         105  +
            GuardrailWordPolicyAction::Unknown(value) => write!(f, "{}", value),
         106  +
        }
         107  +
    }
         108  +
}

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

@@ -0,1 +0,99 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>The word policy assessment.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct GuardrailWordPolicyAssessment {
           7  +
    /// <p>Custom words in the assessment.</p>
           8  +
    pub custom_words: ::std::vec::Vec<crate::types::GuardrailCustomWord>,
           9  +
    /// <p>Managed word lists in the assessment.</p>
          10  +
    pub managed_word_lists: ::std::vec::Vec<crate::types::GuardrailManagedWord>,
          11  +
}
          12  +
impl GuardrailWordPolicyAssessment {
          13  +
    /// <p>Custom words in the assessment.</p>
          14  +
    pub fn custom_words(&self) -> &[crate::types::GuardrailCustomWord] {
          15  +
        use std::ops::Deref;
          16  +
        self.custom_words.deref()
          17  +
    }
          18  +
    /// <p>Managed word lists in the assessment.</p>
          19  +
    pub fn managed_word_lists(&self) -> &[crate::types::GuardrailManagedWord] {
          20  +
        use std::ops::Deref;
          21  +
        self.managed_word_lists.deref()
          22  +
    }
          23  +
}
          24  +
impl GuardrailWordPolicyAssessment {
          25  +
    /// Creates a new builder-style object to manufacture [`GuardrailWordPolicyAssessment`](crate::types::GuardrailWordPolicyAssessment).
          26  +
    pub fn builder() -> crate::types::builders::GuardrailWordPolicyAssessmentBuilder {
          27  +
        crate::types::builders::GuardrailWordPolicyAssessmentBuilder::default()
          28  +
    }
          29  +
}
          30  +
          31  +
/// A builder for [`GuardrailWordPolicyAssessment`](crate::types::GuardrailWordPolicyAssessment).
          32  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          33  +
#[non_exhaustive]
          34  +
pub struct GuardrailWordPolicyAssessmentBuilder {
          35  +
    pub(crate) custom_words: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailCustomWord>>,
          36  +
    pub(crate) managed_word_lists: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailManagedWord>>,
          37  +
}
          38  +
impl GuardrailWordPolicyAssessmentBuilder {
          39  +
    /// Appends an item to `custom_words`.
          40  +
    ///
          41  +
    /// To override the contents of this collection use [`set_custom_words`](Self::set_custom_words).
          42  +
    ///
          43  +
    /// <p>Custom words in the assessment.</p>
          44  +
    pub fn custom_words(mut self, input: crate::types::GuardrailCustomWord) -> Self {
          45  +
        let mut v = self.custom_words.unwrap_or_default();
          46  +
        v.push(input);
          47  +
        self.custom_words = ::std::option::Option::Some(v);
          48  +
        self
          49  +
    }
          50  +
    /// <p>Custom words in the assessment.</p>
          51  +
    pub fn set_custom_words(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailCustomWord>>) -> Self {
          52  +
        self.custom_words = input;
          53  +
        self
          54  +
    }
          55  +
    /// <p>Custom words in the assessment.</p>
          56  +
    pub fn get_custom_words(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GuardrailCustomWord>> {
          57  +
        &self.custom_words
          58  +
    }
          59  +
    /// Appends an item to `managed_word_lists`.
          60  +
    ///
          61  +
    /// To override the contents of this collection use [`set_managed_word_lists`](Self::set_managed_word_lists).
          62  +
    ///
          63  +
    /// <p>Managed word lists in the assessment.</p>
          64  +
    pub fn managed_word_lists(mut self, input: crate::types::GuardrailManagedWord) -> Self {
          65  +
        let mut v = self.managed_word_lists.unwrap_or_default();
          66  +
        v.push(input);
          67  +
        self.managed_word_lists = ::std::option::Option::Some(v);
          68  +
        self
          69  +
    }
          70  +
    /// <p>Managed word lists in the assessment.</p>
          71  +
    pub fn set_managed_word_lists(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailManagedWord>>) -> Self {
          72  +
        self.managed_word_lists = input;
          73  +
        self
          74  +
    }
          75  +
    /// <p>Managed word lists in the assessment.</p>
          76  +
    pub fn get_managed_word_lists(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GuardrailManagedWord>> {
          77  +
        &self.managed_word_lists
          78  +
    }
          79  +
    /// Consumes the builder and constructs a [`GuardrailWordPolicyAssessment`](crate::types::GuardrailWordPolicyAssessment).
          80  +
    /// This method will fail if any of the following fields are not set:
          81  +
    /// - [`custom_words`](crate::types::builders::GuardrailWordPolicyAssessmentBuilder::custom_words)
          82  +
    /// - [`managed_word_lists`](crate::types::builders::GuardrailWordPolicyAssessmentBuilder::managed_word_lists)
          83  +
    pub fn build(self) -> ::std::result::Result<crate::types::GuardrailWordPolicyAssessment, ::aws_smithy_types::error::operation::BuildError> {
          84  +
        ::std::result::Result::Ok(crate::types::GuardrailWordPolicyAssessment {
          85  +
            custom_words: self.custom_words.ok_or_else(|| {
          86  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
          87  +
                    "custom_words",
          88  +
                    "custom_words was not specified but it is required when building GuardrailWordPolicyAssessment",
          89  +
                )
          90  +
            })?,
          91  +
            managed_word_lists: self.managed_word_lists.ok_or_else(|| {
          92  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
          93  +
                    "managed_word_lists",
          94  +
                    "managed_word_lists was not specified but it is required when building GuardrailWordPolicyAssessment",
          95  +
                )
          96  +
            })?,
          97  +
        })
          98  +
    }
          99  +
}

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

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

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

@@ -1,1 +98,98 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3      3   
/// <p>Base inference parameters to pass to a model in a call to <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>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
    4      4   
/// <p>If you need to pass additional parameters that the model supports, use the <code>additionalModelRequestFields</code> request field in the call to <code>Converse</code> or <code>ConverseStream</code>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
    5      5   
#[non_exhaustive]
    6      6   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    7      7   
pub struct InferenceConfiguration {
    8         -
    /// <p>The maximum number of tokens to allow in the generated response. The default value is the maximum allowed value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundatio{ "messages": \[ { "role": "user", "content": \[ { "text": "what's the weather in Queens, NY and Austin, TX?" } \] }, { "role": "assistant", "content": \[ { "toolUse": { "toolUseId": "1", "name": "get_weather", "input": { "city": "Queens", "state": "NY" } } }, { "toolUse": { "toolUseId": "2", "name": "get_weather", "input": { "city": "Austin", "state": "TX" } } } \] }, { "role": "user", "content": \[ { "toolResult": { "toolUseId": "2", "content": \[ { "json": { "weather": "40" } } \] } }, { "text": "..." }, { "toolResult": { "toolUseId": "1", "content": \[ { "text": "result text" } \] } } \] } \], "toolConfig": { "tools": \[ { "name": "get_weather", "description": "Get weather", "inputSchema": { "type": "object", "properties": { "city": { "type": "string", "description": "City of location" }, "state": { "type": "string", "description": "State of location" } }, "required": \["city", "state"\] } } \] } } n models</a>.</p>
           8  +
    /// <p>The maximum number of tokens to allow in the generated response. The default value is the maximum allowed value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
    9      9   
    pub max_tokens: ::std::option::Option<i32>,
   10     10   
    /// <p>The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.</p>
   11     11   
    /// <p>The default value is the default value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
   12     12   
    pub temperature: ::std::option::Option<f32>,
   13     13   
    /// <p>The percentage of most-likely candidates that the model considers for the next token. For example, if you choose a value of 0.8 for <code>topP</code>, the model selects from the top 80% of the probability distribution of tokens that could be next in the sequence.</p>
   14     14   
    /// <p>The default value is the default value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
   15     15   
    pub top_p: ::std::option::Option<f32>,
   16     16   
    /// <p>A list of stop sequences. A stop sequence is a sequence of characters that causes the model to stop generating the response.</p>
   17     17   
    pub stop_sequences: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
   18     18   
}
   19     19   
impl InferenceConfiguration {
   20         -
    /// <p>The maximum number of tokens to allow in the generated response. The default value is the maximum allowed value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundatio{ "messages": \[ { "role": "user", "content": \[ { "text": "what's the weather in Queens, NY and Austin, TX?" } \] }, { "role": "assistant", "content": \[ { "toolUse": { "toolUseId": "1", "name": "get_weather", "input": { "city": "Queens", "state": "NY" } } }, { "toolUse": { "toolUseId": "2", "name": "get_weather", "input": { "city": "Austin", "state": "TX" } } } \] }, { "role": "user", "content": \[ { "toolResult": { "toolUseId": "2", "content": \[ { "json": { "weather": "40" } } \] } }, { "text": "..." }, { "toolResult": { "toolUseId": "1", "content": \[ { "text": "result text" } \] } } \] } \], "toolConfig": { "tools": \[ { "name": "get_weather", "description": "Get weather", "inputSchema": { "type": "object", "properties": { "city": { "type": "string", "description": "City of location" }, "state": { "type": "string", "description": "State of location" } }, "required": \["city", "state"\] } } \] } } n models</a>.</p>
          20  +
    /// <p>The maximum number of tokens to allow in the generated response. The default value is the maximum allowed value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
   21     21   
    pub fn max_tokens(&self) -> ::std::option::Option<i32> {
   22     22   
        self.max_tokens
   23     23   
    }
   24     24   
    /// <p>The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.</p>
   25     25   
    /// <p>The default value is the default value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
   26     26   
    pub fn temperature(&self) -> ::std::option::Option<f32> {
   27     27   
        self.temperature
   28     28   
    }
   29     29   
    /// <p>The percentage of most-likely candidates that the model considers for the next token. For example, if you choose a value of 0.8 for <code>topP</code>, the model selects from the top 80% of the probability distribution of tokens that could be next in the sequence.</p>
   30     30   
    /// <p>The default value is the default value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
   31     31   
    pub fn top_p(&self) -> ::std::option::Option<f32> {
   32     32   
        self.top_p
   33     33   
    }
   34     34   
    /// <p>A list of stop sequences. A stop sequence is a sequence of characters that causes the model to stop generating the response.</p>
   35     35   
    ///
   36     36   
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.stop_sequences.is_none()`.
   37     37   
    pub fn stop_sequences(&self) -> &[::std::string::String] {
   38     38   
        self.stop_sequences.as_deref().unwrap_or_default()
   39     39   
    }
   40     40   
}
   41     41   
impl InferenceConfiguration {
   42     42   
    /// Creates a new builder-style object to manufacture [`InferenceConfiguration`](crate::types::InferenceConfiguration).
   43     43   
    pub fn builder() -> crate::types::builders::InferenceConfigurationBuilder {
   44     44   
        crate::types::builders::InferenceConfigurationBuilder::default()
   45     45   
    }
   46     46   
}
   47     47   
   48     48   
/// A builder for [`InferenceConfiguration`](crate::types::InferenceConfiguration).
   49     49   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   50     50   
#[non_exhaustive]
   51     51   
pub struct InferenceConfigurationBuilder {
   52     52   
    pub(crate) max_tokens: ::std::option::Option<i32>,
   53     53   
    pub(crate) temperature: ::std::option::Option<f32>,
   54     54   
    pub(crate) top_p: ::std::option::Option<f32>,
   55     55   
    pub(crate) stop_sequences: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
   56     56   
}
   57     57   
impl InferenceConfigurationBuilder {
   58         -
    /// <p>The maximum number of tokens to allow in the generated response. The default value is the maximum allowed value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundatio{ "messages": \[ { "role": "user", "content": \[ { "text": "what's the weather in Queens, NY and Austin, TX?" } \] }, { "role": "assistant", "content": \[ { "toolUse": { "toolUseId": "1", "name": "get_weather", "input": { "city": "Queens", "state": "NY" } } }, { "toolUse": { "toolUseId": "2", "name": "get_weather", "input": { "city": "Austin", "state": "TX" } } } \] }, { "role": "user", "content": \[ { "toolResult": { "toolUseId": "2", "content": \[ { "json": { "weather": "40" } } \] } }, { "text": "..." }, { "toolResult": { "toolUseId": "1", "content": \[ { "text": "result text" } \] } } \] } \], "toolConfig": { "tools": \[ { "name": "get_weather", "description": "Get weather", "inputSchema": { "type": "object", "properties": { "city": { "type": "string", "description": "City of location" }, "state": { "type": "string", "description": "State of location" } }, "required": \["city", "state"\] } } \] } } n models</a>.</p>
          58  +
    /// <p>The maximum number of tokens to allow in the generated response. The default value is the maximum allowed value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
   59     59   
    pub fn max_tokens(mut self, input: i32) -> Self {
   60     60   
        self.max_tokens = ::std::option::Option::Some(input);
   61     61   
        self
   62     62   
    }
   63         -
    /// <p>The maximum number of tokens to allow in the generated response. The default value is the maximum allowed value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundatio{ "messages": \[ { "role": "user", "content": \[ { "text": "what's the weather in Queens, NY and Austin, TX?" } \] }, { "role": "assistant", "content": \[ { "toolUse": { "toolUseId": "1", "name": "get_weather", "input": { "city": "Queens", "state": "NY" } } }, { "toolUse": { "toolUseId": "2", "name": "get_weather", "input": { "city": "Austin", "state": "TX" } } } \] }, { "role": "user", "content": \[ { "toolResult": { "toolUseId": "2", "content": \[ { "json": { "weather": "40" } } \] } }, { "text": "..." }, { "toolResult": { "toolUseId": "1", "content": \[ { "text": "result text" } \] } } \] } \], "toolConfig": { "tools": \[ { "name": "get_weather", "description": "Get weather", "inputSchema": { "type": "object", "properties": { "city": { "type": "string", "description": "City of location" }, "state": { "type": "string", "description": "State of location" } }, "required": \["city", "state"\] } } \] } } n models</a>.</p>
          63  +
    /// <p>The maximum number of tokens to allow in the generated response. The default value is the maximum allowed value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
   64     64   
    pub fn set_max_tokens(mut self, input: ::std::option::Option<i32>) -> Self {
   65     65   
        self.max_tokens = input;
   66     66   
        self
   67     67   
    }
   68         -
    /// <p>The maximum number of tokens to allow in the generated response. The default value is the maximum allowed value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundatio{ "messages": \[ { "role": "user", "content": \[ { "text": "what's the weather in Queens, NY and Austin, TX?" } \] }, { "role": "assistant", "content": \[ { "toolUse": { "toolUseId": "1", "name": "get_weather", "input": { "city": "Queens", "state": "NY" } } }, { "toolUse": { "toolUseId": "2", "name": "get_weather", "input": { "city": "Austin", "state": "TX" } } } \] }, { "role": "user", "content": \[ { "toolResult": { "toolUseId": "2", "content": \[ { "json": { "weather": "40" } } \] } }, { "text": "..." }, { "toolResult": { "toolUseId": "1", "content": \[ { "text": "result text" } \] } } \] } \], "toolConfig": { "tools": \[ { "name": "get_weather", "description": "Get weather", "inputSchema": { "type": "object", "properties": { "city": { "type": "string", "description": "City of location" }, "state": { "type": "string", "description": "State of location" } }, "required": \["city", "state"\] } } \] } } n models</a>.</p>
          68  +
    /// <p>The maximum number of tokens to allow in the generated response. The default value is the maximum allowed value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
   69     69   
    pub fn get_max_tokens(&self) -> &::std::option::Option<i32> {
   70     70   
        &self.max_tokens
   71     71   
    }
   72     72   
    /// <p>The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.</p>
   73     73   
    /// <p>The default value is the default value for the model that you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
   74     74   
    pub fn temperature(mut self, input: f32) -> Self {
   75     75   
        self.temperature = ::std::option::Option::Some(input);
   76     76   
        self
   77     77   
    }
   78     78   
    /// <p>The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.</p>

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

@@ -0,1 +0,46 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Payload content, the speech chunk, for the bidirectional input of the invocation step.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
           6  +
pub enum InvokeModelWithBidirectionalStreamInput {
           7  +
    /// <p>The audio chunk that is used as input for the invocation step.</p>
           8  +
    Chunk(crate::types::BidirectionalInputPayloadPart),
           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 InvokeModelWithBidirectionalStreamInput {
          20  +
    #[allow(irrefutable_let_patterns)]
          21  +
    /// Tries to convert the enum instance into [`Chunk`](crate::types::InvokeModelWithBidirectionalStreamInput::Chunk), extracting the inner [`BidirectionalInputPayloadPart`](crate::types::BidirectionalInputPayloadPart).
          22  +
    /// Returns `Err(&Self)` if it can't be converted.
          23  +
    pub fn as_chunk(&self) -> ::std::result::Result<&crate::types::BidirectionalInputPayloadPart, &Self> {
          24  +
        if let InvokeModelWithBidirectionalStreamInput::Chunk(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 [`Chunk`](crate::types::InvokeModelWithBidirectionalStreamInput::Chunk).
          31  +
    pub fn is_chunk(&self) -> bool {
          32  +
        self.as_chunk().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  +
}
          39  +
impl ::std::fmt::Debug for InvokeModelWithBidirectionalStreamInput {
          40  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
          41  +
        match self {
          42  +
            InvokeModelWithBidirectionalStreamInput::Chunk(_) => f.debug_tuple("*** Sensitive Data Redacted ***").finish(),
          43  +
            InvokeModelWithBidirectionalStreamInput::Unknown => f.debug_tuple("Unknown").finish(),
          44  +
        }
          45  +
    }
          46  +
}

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

@@ -0,1 +0,46 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Output from the bidirectional stream that was used for model invocation.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
           6  +
pub enum InvokeModelWithBidirectionalStreamOutput {
           7  +
    /// <p>The speech chunk that was provided as output from the invocation step.</p>
           8  +
    Chunk(crate::types::BidirectionalOutputPayloadPart),
           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 InvokeModelWithBidirectionalStreamOutput {
          20  +
    #[allow(irrefutable_let_patterns)]
          21  +
    /// Tries to convert the enum instance into [`Chunk`](crate::types::InvokeModelWithBidirectionalStreamOutput::Chunk), extracting the inner [`BidirectionalOutputPayloadPart`](crate::types::BidirectionalOutputPayloadPart).
          22  +
    /// Returns `Err(&Self)` if it can't be converted.
          23  +
    pub fn as_chunk(&self) -> ::std::result::Result<&crate::types::BidirectionalOutputPayloadPart, &Self> {
          24  +
        if let InvokeModelWithBidirectionalStreamOutput::Chunk(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 [`Chunk`](crate::types::InvokeModelWithBidirectionalStreamOutput::Chunk).
          31  +
    pub fn is_chunk(&self) -> bool {
          32  +
        self.as_chunk().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  +
}
          39  +
impl ::std::fmt::Debug for InvokeModelWithBidirectionalStreamOutput {
          40  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
          41  +
        match self {
          42  +
            InvokeModelWithBidirectionalStreamOutput::Chunk(_) => f.debug_tuple("*** Sensitive Data Redacted ***").finish(),
          43  +
            InvokeModelWithBidirectionalStreamOutput::Unknown => f.debug_tuple("Unknown").finish(),
          44  +
        }
          45  +
    }
          46  +
}

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

@@ -1,1 +93,143 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3         -
/// <p>A message in the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Message.html">Message</a> field. Use to send a message in a call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a>.</p>
           3  +
/// <p>A message input, or returned from, a call to <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>.</p>
    4      4   
#[non_exhaustive]
    5      5   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6      6   
pub struct Message {
    7      7   
    /// <p>The role that the message plays in the message.</p>
    8      8   
    pub role: crate::types::ConversationRole,
    9         -
    /// <p>The message content.</p>
           9  +
    /// <p>The message content. Note the following restrictions:</p>
          10  +
    /// <ul>
          11  +
    /// <li>
          12  +
    /// <p>You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.</p></li>
          13  +
    /// <li>
          14  +
    /// <p>You can include up to five documents. Each document's size must be no more than 4.5 MB.</p></li>
          15  +
    /// <li>
          16  +
    /// <p>If you include a <code>ContentBlock</code> with a <code>document</code> field in the array, you must also include a <code>ContentBlock</code> with a <code>text</code> field.</p></li>
          17  +
    /// <li>
          18  +
    /// <p>You can only include images and documents if the <code>role</code> is <code>user</code>.</p></li>
          19  +
    /// </ul>
   10     20   
    pub content: ::std::vec::Vec<crate::types::ContentBlock>,
   11     21   
}
   12     22   
impl Message {
   13     23   
    /// <p>The role that the message plays in the message.</p>
   14     24   
    pub fn role(&self) -> &crate::types::ConversationRole {
   15     25   
        &self.role
   16     26   
    }
   17         -
    /// <p>The message content.</p>
          27  +
    /// <p>The message content. Note the following restrictions:</p>
          28  +
    /// <ul>
          29  +
    /// <li>
          30  +
    /// <p>You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.</p></li>
          31  +
    /// <li>
          32  +
    /// <p>You can include up to five documents. Each document's size must be no more than 4.5 MB.</p></li>
          33  +
    /// <li>
          34  +
    /// <p>If you include a <code>ContentBlock</code> with a <code>document</code> field in the array, you must also include a <code>ContentBlock</code> with a <code>text</code> field.</p></li>
          35  +
    /// <li>
          36  +
    /// <p>You can only include images and documents if the <code>role</code> is <code>user</code>.</p></li>
          37  +
    /// </ul>
   18     38   
    pub fn content(&self) -> &[crate::types::ContentBlock] {
   19     39   
        use std::ops::Deref;
   20     40   
        self.content.deref()
   21     41   
    }
   22     42   
}
   23     43   
impl Message {
   24     44   
    /// Creates a new builder-style object to manufacture [`Message`](crate::types::Message).
   25     45   
    pub fn builder() -> crate::types::builders::MessageBuilder {
   26     46   
        crate::types::builders::MessageBuilder::default()
   27     47   
    }
   28     48   
}
   29     49   
   30     50   
/// A builder for [`Message`](crate::types::Message).
   31     51   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   32     52   
#[non_exhaustive]
   33     53   
pub struct MessageBuilder {
   34     54   
    pub(crate) role: ::std::option::Option<crate::types::ConversationRole>,
   35     55   
    pub(crate) content: ::std::option::Option<::std::vec::Vec<crate::types::ContentBlock>>,
   36     56   
}
   37     57   
impl MessageBuilder {
   38     58   
    /// <p>The role that the message plays in the message.</p>
   39     59   
    /// This field is required.
   40     60   
    pub fn role(mut self, input: crate::types::ConversationRole) -> Self {
   41     61   
        self.role = ::std::option::Option::Some(input);
   42     62   
        self
   43     63   
    }
   44     64   
    /// <p>The role that the message plays in the message.</p>
   45     65   
    pub fn set_role(mut self, input: ::std::option::Option<crate::types::ConversationRole>) -> Self {
   46     66   
        self.role = input;
   47     67   
        self
   48     68   
    }
   49     69   
    /// <p>The role that the message plays in the message.</p>
   50     70   
    pub fn get_role(&self) -> &::std::option::Option<crate::types::ConversationRole> {
   51     71   
        &self.role
   52     72   
    }
   53     73   
    /// Appends an item to `content`.
   54     74   
    ///
   55     75   
    /// To override the contents of this collection use [`set_content`](Self::set_content).
   56     76   
    ///
   57         -
    /// <p>The message content.</p>
          77  +
    /// <p>The message content. Note the following restrictions:</p>
          78  +
    /// <ul>
          79  +
    /// <li>
          80  +
    /// <p>You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.</p></li>
          81  +
    /// <li>
          82  +
    /// <p>You can include up to five documents. Each document's size must be no more than 4.5 MB.</p></li>
          83  +
    /// <li>
          84  +
    /// <p>If you include a <code>ContentBlock</code> with a <code>document</code> field in the array, you must also include a <code>ContentBlock</code> with a <code>text</code> field.</p></li>
          85  +
    /// <li>
          86  +
    /// <p>You can only include images and documents if the <code>role</code> is <code>user</code>.</p></li>
          87  +
    /// </ul>
   58     88   
    pub fn content(mut self, input: crate::types::ContentBlock) -> Self {
   59     89   
        let mut v = self.content.unwrap_or_default();
   60     90   
        v.push(input);
   61     91   
        self.content = ::std::option::Option::Some(v);
   62     92   
        self
   63     93   
    }
   64         -
    /// <p>The message content.</p>
          94  +
    /// <p>The message content. Note the following restrictions:</p>
          95  +
    /// <ul>
          96  +
    /// <li>
          97  +
    /// <p>You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.</p></li>
          98  +
    /// <li>
          99  +
    /// <p>You can include up to five documents. Each document's size must be no more than 4.5 MB.</p></li>
         100  +
    /// <li>
         101  +
    /// <p>If you include a <code>ContentBlock</code> with a <code>document</code> field in the array, you must also include a <code>ContentBlock</code> with a <code>text</code> field.</p></li>
         102  +
    /// <li>
         103  +
    /// <p>You can only include images and documents if the <code>role</code> is <code>user</code>.</p></li>
         104  +
    /// </ul>
   65    105   
    pub fn set_content(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ContentBlock>>) -> Self {
   66    106   
        self.content = input;
   67    107   
        self
   68    108   
    }
   69         -
    /// <p>The message content.</p>
         109  +
    /// <p>The message content. Note the following restrictions:</p>
         110  +
    /// <ul>
         111  +
    /// <li>
         112  +
    /// <p>You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.</p></li>
         113  +
    /// <li>
         114  +
    /// <p>You can include up to five documents. Each document's size must be no more than 4.5 MB.</p></li>
         115  +
    /// <li>
         116  +
    /// <p>If you include a <code>ContentBlock</code> with a <code>document</code> field in the array, you must also include a <code>ContentBlock</code> with a <code>text</code> field.</p></li>
         117  +
    /// <li>
         118  +
    /// <p>You can only include images and documents if the <code>role</code> is <code>user</code>.</p></li>
         119  +
    /// </ul>
   70    120   
    pub fn get_content(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ContentBlock>> {
   71    121   
        &self.content
   72    122   
    }
   73    123   
    /// Consumes the builder and constructs a [`Message`](crate::types::Message).
   74    124   
    /// This method will fail if any of the following fields are not set:
   75    125   
    /// - [`role`](crate::types::builders::MessageBuilder::role)
   76    126   
    /// - [`content`](crate::types::builders::MessageBuilder::content)
   77    127   
    pub fn build(self) -> ::std::result::Result<crate::types::Message, ::aws_smithy_types::error::operation::BuildError> {
   78    128   
        ::std::result::Result::Ok(crate::types::Message {
   79    129   
            role: self.role.ok_or_else(|| {

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

@@ -0,1 +0,108 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// When writing a match expression against `PerformanceConfigLatency`, 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 performanceconfiglatency = unimplemented!();
          14  +
/// match performanceconfiglatency {
          15  +
///     PerformanceConfigLatency::Optimized => { /* ... */ },
          16  +
///     PerformanceConfigLatency::Standard => { /* ... */ },
          17  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          18  +
///     _ => { /* ... */ },
          19  +
/// }
          20  +
/// ```
          21  +
/// The above code demonstrates that when `performanceconfiglatency` represents
          22  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          23  +
/// even though the enum does not contain a variant `PerformanceConfigLatency::NewFeature`
          24  +
/// in the current version of SDK. The reason is that the variable `other`,
          25  +
/// created by the `@` operator, is bound to
          26  +
/// `PerformanceConfigLatency::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 `PerformanceConfigLatency::NewFeature` is defined.
          30  +
/// Specifically, when `performanceconfiglatency` represents `NewFeature`,
          31  +
/// the execution path will hit the second last match arm as before by virtue of
          32  +
/// calling `as_str` on `PerformanceConfigLatency::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 PerformanceConfigLatency {
          45  +
    #[allow(missing_docs)] // documentation missing in model
          46  +
    Optimized,
          47  +
    #[allow(missing_docs)] // documentation missing in model
          48  +
    Standard,
          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 PerformanceConfigLatency {
          54  +
    fn from(s: &str) -> Self {
          55  +
        match s {
          56  +
            "optimized" => PerformanceConfigLatency::Optimized,
          57  +
            "standard" => PerformanceConfigLatency::Standard,
          58  +
            other => PerformanceConfigLatency::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          59  +
        }
          60  +
    }
          61  +
}
          62  +
impl ::std::str::FromStr for PerformanceConfigLatency {
          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(PerformanceConfigLatency::from(s))
          67  +
    }
          68  +
}
          69  +
impl PerformanceConfigLatency {
          70  +
    /// Returns the `&str` value of the enum member.
          71  +
    pub fn as_str(&self) -> &str {
          72  +
        match self {
          73  +
            PerformanceConfigLatency::Optimized => "optimized",
          74  +
            PerformanceConfigLatency::Standard => "standard",
          75  +
            PerformanceConfigLatency::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  +
        &["optimized", "standard"]
          81  +
    }
          82  +
}
          83  +
impl ::std::convert::AsRef<str> for PerformanceConfigLatency {
          84  +
    fn as_ref(&self) -> &str {
          85  +
        self.as_str()
          86  +
    }
          87  +
}
          88  +
impl PerformanceConfigLatency {
          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 PerformanceConfigLatency {
         101  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
         102  +
        match self {
         103  +
            PerformanceConfigLatency::Optimized => write!(f, "optimized"),
         104  +
            PerformanceConfigLatency::Standard => write!(f, "standard"),
         105  +
            PerformanceConfigLatency::Unknown(value) => write!(f, "{}", value),
         106  +
        }
         107  +
    }
         108  +
}

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

@@ -0,1 +0,54 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Performance settings for a model.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct PerformanceConfiguration {
           7  +
    /// <p>To use a latency-optimized version of the model, set to <code>optimized</code>.</p>
           8  +
    pub latency: crate::types::PerformanceConfigLatency,
           9  +
}
          10  +
impl PerformanceConfiguration {
          11  +
    /// <p>To use a latency-optimized version of the model, set to <code>optimized</code>.</p>
          12  +
    pub fn latency(&self) -> &crate::types::PerformanceConfigLatency {
          13  +
        &self.latency
          14  +
    }
          15  +
}
          16  +
impl PerformanceConfiguration {
          17  +
    /// Creates a new builder-style object to manufacture [`PerformanceConfiguration`](crate::types::PerformanceConfiguration).
          18  +
    pub fn builder() -> crate::types::builders::PerformanceConfigurationBuilder {
          19  +
        crate::types::builders::PerformanceConfigurationBuilder::default()
          20  +
    }
          21  +
}
          22  +
          23  +
/// A builder for [`PerformanceConfiguration`](crate::types::PerformanceConfiguration).
          24  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          25  +
#[non_exhaustive]
          26  +
pub struct PerformanceConfigurationBuilder {
          27  +
    pub(crate) latency: ::std::option::Option<crate::types::PerformanceConfigLatency>,
          28  +
}
          29  +
impl PerformanceConfigurationBuilder {
          30  +
    /// <p>To use a latency-optimized version of the model, set to <code>optimized</code>.</p>
          31  +
    pub fn latency(mut self, input: crate::types::PerformanceConfigLatency) -> Self {
          32  +
        self.latency = ::std::option::Option::Some(input);
          33  +
        self
          34  +
    }
          35  +
    /// <p>To use a latency-optimized version of the model, set to <code>optimized</code>.</p>
          36  +
    pub fn set_latency(mut self, input: ::std::option::Option<crate::types::PerformanceConfigLatency>) -> Self {
          37  +
        self.latency = input;
          38  +
        self
          39  +
    }
          40  +
    /// <p>To use a latency-optimized version of the model, set to <code>optimized</code>.</p>
          41  +
    pub fn get_latency(&self) -> &::std::option::Option<crate::types::PerformanceConfigLatency> {
          42  +
        &self.latency
          43  +
    }
          44  +
    /// Consumes the builder and constructs a [`PerformanceConfiguration`](crate::types::PerformanceConfiguration).
          45  +
    pub fn build(self) -> crate::types::PerformanceConfiguration {
          46  +
        crate::types::PerformanceConfiguration {
          47  +
            latency: self.latency.unwrap_or(
          48  +
                "standard"
          49  +
                    .parse::<crate::types::PerformanceConfigLatency>()
          50  +
                    .expect("static value validated to member"),
          51  +
            ),
          52  +
        }
          53  +
    }
          54  +
}

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

@@ -0,1 +0,50 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>A prompt router trace.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct PromptRouterTrace {
           7  +
    /// <p>The ID of the invoked model.</p>
           8  +
    pub invoked_model_id: ::std::option::Option<::std::string::String>,
           9  +
}
          10  +
impl PromptRouterTrace {
          11  +
    /// <p>The ID of the invoked model.</p>
          12  +
    pub fn invoked_model_id(&self) -> ::std::option::Option<&str> {
          13  +
        self.invoked_model_id.as_deref()
          14  +
    }
          15  +
}
          16  +
impl PromptRouterTrace {
          17  +
    /// Creates a new builder-style object to manufacture [`PromptRouterTrace`](crate::types::PromptRouterTrace).
          18  +
    pub fn builder() -> crate::types::builders::PromptRouterTraceBuilder {
          19  +
        crate::types::builders::PromptRouterTraceBuilder::default()
          20  +
    }
          21  +
}
          22  +
          23  +
/// A builder for [`PromptRouterTrace`](crate::types::PromptRouterTrace).
          24  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          25  +
#[non_exhaustive]
          26  +
pub struct PromptRouterTraceBuilder {
          27  +
    pub(crate) invoked_model_id: ::std::option::Option<::std::string::String>,
          28  +
}
          29  +
impl PromptRouterTraceBuilder {
          30  +
    /// <p>The ID of the invoked model.</p>
          31  +
    pub fn invoked_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          32  +
        self.invoked_model_id = ::std::option::Option::Some(input.into());
          33  +
        self
          34  +
    }
          35  +
    /// <p>The ID of the invoked model.</p>
          36  +
    pub fn set_invoked_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          37  +
        self.invoked_model_id = input;
          38  +
        self
          39  +
    }
          40  +
    /// <p>The ID of the invoked model.</p>
          41  +
    pub fn get_invoked_model_id(&self) -> &::std::option::Option<::std::string::String> {
          42  +
        &self.invoked_model_id
          43  +
    }
          44  +
    /// Consumes the builder and constructs a [`PromptRouterTrace`](crate::types::PromptRouterTrace).
          45  +
    pub fn build(self) -> crate::types::PromptRouterTrace {
          46  +
        crate::types::PromptRouterTrace {
          47  +
            invoked_model_id: self.invoked_model_id,
          48  +
        }
          49  +
    }
          50  +
}

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

@@ -0,1 +0,38 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Contains a map of variables in a prompt from Prompt management to an object containing the values to fill in for them when running model invocation. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-how.html">How Prompt management works</a>.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub enum PromptVariableValues {
           7  +
    /// <p>The text value that the variable maps to.</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 PromptVariableValues {
          20  +
    #[allow(irrefutable_let_patterns)]
          21  +
    /// Tries to convert the enum instance into [`Text`](crate::types::PromptVariableValues::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 PromptVariableValues::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::PromptVariableValues::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  +
}