AWS SDK

AWS SDK

rev. ba98f30b52e51c6e715b0ae469e7a2e988c27d9a (ignoring whitespace)

Files changed:

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

@@ -1,0 +139,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>A managed word configured in a guardrail.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct GuardrailManagedWord {
    7         -
    /// <p>The match for the managed word.</p>
    8         -
    pub r#match: ::std::string::String,
    9         -
    /// <p>The type for the managed word.</p>
   10         -
    pub r#type: crate::types::GuardrailManagedWordType,
   11         -
    /// <p>The action for the managed word.</p>
   12         -
    pub action: crate::types::GuardrailWordPolicyAction,
   13         -
    /// <p>Indicates whether managed word content that breaches the guardrail configuration is detected.</p>
   14         -
    pub detected: ::std::option::Option<bool>,
   15         -
}
   16         -
impl GuardrailManagedWord {
   17         -
    /// <p>The match for the managed word.</p>
   18         -
    pub fn r#match(&self) -> &str {
   19         -
        use std::ops::Deref;
   20         -
        self.r#match.deref()
   21         -
    }
   22         -
    /// <p>The type for the managed word.</p>
   23         -
    pub fn r#type(&self) -> &crate::types::GuardrailManagedWordType {
   24         -
        &self.r#type
   25         -
    }
   26         -
    /// <p>The action for the managed word.</p>
   27         -
    pub fn action(&self) -> &crate::types::GuardrailWordPolicyAction {
   28         -
        &self.action
   29         -
    }
   30         -
    /// <p>Indicates whether managed word content that breaches the guardrail configuration is detected.</p>
   31         -
    pub fn detected(&self) -> ::std::option::Option<bool> {
   32         -
        self.detected
   33         -
    }
   34         -
}
   35         -
impl GuardrailManagedWord {
   36         -
    /// Creates a new builder-style object to manufacture [`GuardrailManagedWord`](crate::types::GuardrailManagedWord).
   37         -
    pub fn builder() -> crate::types::builders::GuardrailManagedWordBuilder {
   38         -
        crate::types::builders::GuardrailManagedWordBuilder::default()
   39         -
    }
   40         -
}
   41         -
   42         -
/// A builder for [`GuardrailManagedWord`](crate::types::GuardrailManagedWord).
   43         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   44         -
#[non_exhaustive]
   45         -
pub struct GuardrailManagedWordBuilder {
   46         -
    pub(crate) r#match: ::std::option::Option<::std::string::String>,
   47         -
    pub(crate) r#type: ::std::option::Option<crate::types::GuardrailManagedWordType>,
   48         -
    pub(crate) action: ::std::option::Option<crate::types::GuardrailWordPolicyAction>,
   49         -
    pub(crate) detected: ::std::option::Option<bool>,
   50         -
}
   51         -
impl GuardrailManagedWordBuilder {
   52         -
    /// <p>The match for the managed word.</p>
   53         -
    /// This field is required.
   54         -
    pub fn r#match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
   55         -
        self.r#match = ::std::option::Option::Some(input.into());
   56         -
        self
   57         -
    }
   58         -
    /// <p>The match for the managed word.</p>
   59         -
    pub fn set_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
   60         -
        self.r#match = input;
   61         -
        self
   62         -
    }
   63         -
    /// <p>The match for the managed word.</p>
   64         -
    pub fn get_match(&self) -> &::std::option::Option<::std::string::String> {
   65         -
        &self.r#match
   66         -
    }
   67         -
    /// <p>The type for the managed word.</p>
   68         -
    /// This field is required.
   69         -
    pub fn r#type(mut self, input: crate::types::GuardrailManagedWordType) -> Self {
   70         -
        self.r#type = ::std::option::Option::Some(input);
   71         -
        self
   72         -
    }
   73         -
    /// <p>The type for the managed word.</p>
   74         -
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::GuardrailManagedWordType>) -> Self {
   75         -
        self.r#type = input;
   76         -
        self
   77         -
    }
   78         -
    /// <p>The type for the managed word.</p>
   79         -
    pub fn get_type(&self) -> &::std::option::Option<crate::types::GuardrailManagedWordType> {
   80         -
        &self.r#type
   81         -
    }
   82         -
    /// <p>The action for the managed word.</p>
   83         -
    /// This field is required.
   84         -
    pub fn action(mut self, input: crate::types::GuardrailWordPolicyAction) -> Self {
   85         -
        self.action = ::std::option::Option::Some(input);
   86         -
        self
   87         -
    }
   88         -
    /// <p>The action for the managed word.</p>
   89         -
    pub fn set_action(mut self, input: ::std::option::Option<crate::types::GuardrailWordPolicyAction>) -> Self {
   90         -
        self.action = input;
   91         -
        self
   92         -
    }
   93         -
    /// <p>The action for the managed word.</p>
   94         -
    pub fn get_action(&self) -> &::std::option::Option<crate::types::GuardrailWordPolicyAction> {
   95         -
        &self.action
   96         -
    }
   97         -
    /// <p>Indicates whether managed word content that breaches the guardrail configuration is detected.</p>
   98         -
    pub fn detected(mut self, input: bool) -> Self {
   99         -
        self.detected = ::std::option::Option::Some(input);
  100         -
        self
  101         -
    }
  102         -
    /// <p>Indicates whether managed word content that breaches the guardrail configuration is detected.</p>
  103         -
    pub fn set_detected(mut self, input: ::std::option::Option<bool>) -> Self {
  104         -
        self.detected = input;
  105         -
        self
  106         -
    }
  107         -
    /// <p>Indicates whether managed word content that breaches the guardrail configuration is detected.</p>
  108         -
    pub fn get_detected(&self) -> &::std::option::Option<bool> {
  109         -
        &self.detected
  110         -
    }
  111         -
    /// Consumes the builder and constructs a [`GuardrailManagedWord`](crate::types::GuardrailManagedWord).
  112         -
    /// This method will fail if any of the following fields are not set:
  113         -
    /// - [`r#match`](crate::types::builders::GuardrailManagedWordBuilder::match)
  114         -
    /// - [`r#type`](crate::types::builders::GuardrailManagedWordBuilder::type)
  115         -
    /// - [`action`](crate::types::builders::GuardrailManagedWordBuilder::action)
  116         -
    pub fn build(self) -> ::std::result::Result<crate::types::GuardrailManagedWord, ::aws_smithy_types::error::operation::BuildError> {
  117         -
        ::std::result::Result::Ok(crate::types::GuardrailManagedWord {
  118         -
            r#match: self.r#match.ok_or_else(|| {
  119         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  120         -
                    "r#match",
  121         -
                    "r#match was not specified but it is required when building GuardrailManagedWord",
  122         -
                )
  123         -
            })?,
  124         -
            r#type: self.r#type.ok_or_else(|| {
  125         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  126         -
                    "r#type",
  127         -
                    "r#type was not specified but it is required when building GuardrailManagedWord",
  128         -
                )
  129         -
            })?,
  130         -
            action: self.action.ok_or_else(|| {
  131         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  132         -
                    "action",
  133         -
                    "action was not specified but it is required when building GuardrailManagedWord",
  134         -
                )
  135         -
            })?,
  136         -
            detected: self.detected,
  137         -
        })
  138         -
    }
  139         -
}

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

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

@@ -1,0 +48,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>The output content produced by the guardrail.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct GuardrailOutputContent {
    7         -
    /// <p>The specific text for the output content produced by the guardrail.</p>
    8         -
    pub text: ::std::option::Option<::std::string::String>,
    9         -
}
   10         -
impl GuardrailOutputContent {
   11         -
    /// <p>The specific text for the output content produced by the guardrail.</p>
   12         -
    pub fn text(&self) -> ::std::option::Option<&str> {
   13         -
        self.text.as_deref()
   14         -
    }
   15         -
}
   16         -
impl GuardrailOutputContent {
   17         -
    /// Creates a new builder-style object to manufacture [`GuardrailOutputContent`](crate::types::GuardrailOutputContent).
   18         -
    pub fn builder() -> crate::types::builders::GuardrailOutputContentBuilder {
   19         -
        crate::types::builders::GuardrailOutputContentBuilder::default()
   20         -
    }
   21         -
}
   22         -
   23         -
/// A builder for [`GuardrailOutputContent`](crate::types::GuardrailOutputContent).
   24         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   25         -
#[non_exhaustive]
   26         -
pub struct GuardrailOutputContentBuilder {
   27         -
    pub(crate) text: ::std::option::Option<::std::string::String>,
   28         -
}
   29         -
impl GuardrailOutputContentBuilder {
   30         -
    /// <p>The specific text for the output content produced by the guardrail.</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>The specific text for the output content produced by the guardrail.</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>The specific text for the output content produced by the guardrail.</p>
   41         -
    pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
   42         -
        &self.text
   43         -
    }
   44         -
    /// Consumes the builder and constructs a [`GuardrailOutputContent`](crate::types::GuardrailOutputContent).
   45         -
    pub fn build(self) -> crate::types::GuardrailOutputContent {
   46         -
        crate::types::GuardrailOutputContent { text: self.text }
   47         -
    }
   48         -
}

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

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

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

@@ -1,0 +139,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>A Personally Identifiable Information (PII) entity configured in a guardrail.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct GuardrailPiiEntityFilter {
    7         -
    /// <p>The PII entity filter match.</p>
    8         -
    pub r#match: ::std::string::String,
    9         -
    /// <p>The PII entity filter type.</p>
   10         -
    pub r#type: crate::types::GuardrailPiiEntityType,
   11         -
    /// <p>The PII entity filter action.</p>
   12         -
    pub action: crate::types::GuardrailSensitiveInformationPolicyAction,
   13         -
    /// <p>Indicates whether personally identifiable information (PII) that breaches the guardrail configuration is detected.</p>
   14         -
    pub detected: ::std::option::Option<bool>,
   15         -
}
   16         -
impl GuardrailPiiEntityFilter {
   17         -
    /// <p>The PII entity filter match.</p>
   18         -
    pub fn r#match(&self) -> &str {
   19         -
        use std::ops::Deref;
   20         -
        self.r#match.deref()
   21         -
    }
   22         -
    /// <p>The PII entity filter type.</p>
   23         -
    pub fn r#type(&self) -> &crate::types::GuardrailPiiEntityType {
   24         -
        &self.r#type
   25         -
    }
   26         -
    /// <p>The PII entity filter action.</p>
   27         -
    pub fn action(&self) -> &crate::types::GuardrailSensitiveInformationPolicyAction {
   28         -
        &self.action
   29         -
    }
   30         -
    /// <p>Indicates whether personally identifiable information (PII) that breaches the guardrail configuration is detected.</p>
   31         -
    pub fn detected(&self) -> ::std::option::Option<bool> {
   32         -
        self.detected
   33         -
    }
   34         -
}
   35         -
impl GuardrailPiiEntityFilter {
   36         -
    /// Creates a new builder-style object to manufacture [`GuardrailPiiEntityFilter`](crate::types::GuardrailPiiEntityFilter).
   37         -
    pub fn builder() -> crate::types::builders::GuardrailPiiEntityFilterBuilder {
   38         -
        crate::types::builders::GuardrailPiiEntityFilterBuilder::default()
   39         -
    }
   40         -
}
   41         -
   42         -
/// A builder for [`GuardrailPiiEntityFilter`](crate::types::GuardrailPiiEntityFilter).
   43         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   44         -
#[non_exhaustive]
   45         -
pub struct GuardrailPiiEntityFilterBuilder {
   46         -
    pub(crate) r#match: ::std::option::Option<::std::string::String>,
   47         -
    pub(crate) r#type: ::std::option::Option<crate::types::GuardrailPiiEntityType>,
   48         -
    pub(crate) action: ::std::option::Option<crate::types::GuardrailSensitiveInformationPolicyAction>,
   49         -
    pub(crate) detected: ::std::option::Option<bool>,
   50         -
}
   51         -
impl GuardrailPiiEntityFilterBuilder {
   52         -
    /// <p>The PII entity filter match.</p>
   53         -
    /// This field is required.
   54         -
    pub fn r#match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
   55         -
        self.r#match = ::std::option::Option::Some(input.into());
   56         -
        self
   57         -
    }
   58         -
    /// <p>The PII entity filter match.</p>
   59         -
    pub fn set_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
   60         -
        self.r#match = input;
   61         -
        self
   62         -
    }
   63         -
    /// <p>The PII entity filter match.</p>
   64         -
    pub fn get_match(&self) -> &::std::option::Option<::std::string::String> {
   65         -
        &self.r#match
   66         -
    }
   67         -
    /// <p>The PII entity filter type.</p>
   68         -
    /// This field is required.
   69         -
    pub fn r#type(mut self, input: crate::types::GuardrailPiiEntityType) -> Self {
   70         -
        self.r#type = ::std::option::Option::Some(input);
   71         -
        self
   72         -
    }
   73         -
    /// <p>The PII entity filter type.</p>
   74         -
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::GuardrailPiiEntityType>) -> Self {
   75         -
        self.r#type = input;
   76         -
        self
   77         -
    }
   78         -
    /// <p>The PII entity filter type.</p>
   79         -
    pub fn get_type(&self) -> &::std::option::Option<crate::types::GuardrailPiiEntityType> {
   80         -
        &self.r#type
   81         -
    }
   82         -
    /// <p>The PII entity filter action.</p>
   83         -
    /// This field is required.
   84         -
    pub fn action(mut self, input: crate::types::GuardrailSensitiveInformationPolicyAction) -> Self {
   85         -
        self.action = ::std::option::Option::Some(input);
   86         -
        self
   87         -
    }
   88         -
    /// <p>The PII entity filter action.</p>
   89         -
    pub fn set_action(mut self, input: ::std::option::Option<crate::types::GuardrailSensitiveInformationPolicyAction>) -> Self {
   90         -
        self.action = input;
   91         -
        self
   92         -
    }
   93         -
    /// <p>The PII entity filter action.</p>
   94         -
    pub fn get_action(&self) -> &::std::option::Option<crate::types::GuardrailSensitiveInformationPolicyAction> {
   95         -
        &self.action
   96         -
    }
   97         -
    /// <p>Indicates whether personally identifiable information (PII) that breaches the guardrail configuration is detected.</p>
   98         -
    pub fn detected(mut self, input: bool) -> Self {
   99         -
        self.detected = ::std::option::Option::Some(input);
  100         -
        self
  101         -
    }
  102         -
    /// <p>Indicates whether personally identifiable information (PII) that breaches the guardrail configuration is detected.</p>
  103         -
    pub fn set_detected(mut self, input: ::std::option::Option<bool>) -> Self {
  104         -
        self.detected = input;
  105         -
        self
  106         -
    }
  107         -
    /// <p>Indicates whether personally identifiable information (PII) that breaches the guardrail configuration is detected.</p>
  108         -
    pub fn get_detected(&self) -> &::std::option::Option<bool> {
  109         -
        &self.detected
  110         -
    }
  111         -
    /// Consumes the builder and constructs a [`GuardrailPiiEntityFilter`](crate::types::GuardrailPiiEntityFilter).
  112         -
    /// This method will fail if any of the following fields are not set:
  113         -
    /// - [`r#match`](crate::types::builders::GuardrailPiiEntityFilterBuilder::match)
  114         -
    /// - [`r#type`](crate::types::builders::GuardrailPiiEntityFilterBuilder::type)
  115         -
    /// - [`action`](crate::types::builders::GuardrailPiiEntityFilterBuilder::action)
  116         -
    pub fn build(self) -> ::std::result::Result<crate::types::GuardrailPiiEntityFilter, ::aws_smithy_types::error::operation::BuildError> {
  117         -
        ::std::result::Result::Ok(crate::types::GuardrailPiiEntityFilter {
  118         -
            r#match: self.r#match.ok_or_else(|| {
  119         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  120         -
                    "r#match",
  121         -
                    "r#match was not specified but it is required when building GuardrailPiiEntityFilter",
  122         -
                )
  123         -
            })?,
  124         -
            r#type: self.r#type.ok_or_else(|| {
  125         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  126         -
                    "r#type",
  127         -
                    "r#type was not specified but it is required when building GuardrailPiiEntityFilter",
  128         -
                )
  129         -
            })?,
  130         -
            action: self.action.ok_or_else(|| {
  131         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  132         -
                    "action",
  133         -
                    "action was not specified but it is required when building GuardrailPiiEntityFilter",
  134         -
                )
  135         -
            })?,
  136         -
            detected: self.detected,
  137         -
        })
  138         -
    }
  139         -
}

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

@@ -1,0 +314,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// When writing a match expression against `GuardrailPiiEntityType`, 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 guardrailpiientitytype = unimplemented!();
   14         -
/// match guardrailpiientitytype {
   15         -
///     GuardrailPiiEntityType::Address => { /* ... */ },
   16         -
///     GuardrailPiiEntityType::Age => { /* ... */ },
   17         -
///     GuardrailPiiEntityType::AwsAccessKey => { /* ... */ },
   18         -
///     GuardrailPiiEntityType::AwsSecretKey => { /* ... */ },
   19         -
///     GuardrailPiiEntityType::CaHealthNumber => { /* ... */ },
   20         -
///     GuardrailPiiEntityType::CaSocialInsuranceNumber => { /* ... */ },
   21         -
///     GuardrailPiiEntityType::CreditDebitCardCvv => { /* ... */ },
   22         -
///     GuardrailPiiEntityType::CreditDebitCardExpiry => { /* ... */ },
   23         -
///     GuardrailPiiEntityType::CreditDebitCardNumber => { /* ... */ },
   24         -
///     GuardrailPiiEntityType::DriverId => { /* ... */ },
   25         -
///     GuardrailPiiEntityType::Email => { /* ... */ },
   26         -
///     GuardrailPiiEntityType::InternationalBankAccountNumber => { /* ... */ },
   27         -
///     GuardrailPiiEntityType::IpAddress => { /* ... */ },
   28         -
///     GuardrailPiiEntityType::LicensePlate => { /* ... */ },
   29         -
///     GuardrailPiiEntityType::MacAddress => { /* ... */ },
   30         -
///     GuardrailPiiEntityType::Name => { /* ... */ },
   31         -
///     GuardrailPiiEntityType::Password => { /* ... */ },
   32         -
///     GuardrailPiiEntityType::Phone => { /* ... */ },
   33         -
///     GuardrailPiiEntityType::Pin => { /* ... */ },
   34         -
///     GuardrailPiiEntityType::SwiftCode => { /* ... */ },
   35         -
///     GuardrailPiiEntityType::UkNationalHealthServiceNumber => { /* ... */ },
   36         -
///     GuardrailPiiEntityType::UkNationalInsuranceNumber => { /* ... */ },
   37         -
///     GuardrailPiiEntityType::UkUniqueTaxpayerReferenceNumber => { /* ... */ },
   38         -
///     GuardrailPiiEntityType::Url => { /* ... */ },
   39         -
///     GuardrailPiiEntityType::Username => { /* ... */ },
   40         -
///     GuardrailPiiEntityType::UsBankAccountNumber => { /* ... */ },
   41         -
///     GuardrailPiiEntityType::UsBankRoutingNumber => { /* ... */ },
   42         -
///     GuardrailPiiEntityType::UsIndividualTaxIdentificationNumber => { /* ... */ },
   43         -
///     GuardrailPiiEntityType::UsPassportNumber => { /* ... */ },
   44         -
///     GuardrailPiiEntityType::UsSocialSecurityNumber => { /* ... */ },
   45         -
///     GuardrailPiiEntityType::VehicleIdentificationNumber => { /* ... */ },
   46         -
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
   47         -
///     _ => { /* ... */ },
   48         -
/// }
   49         -
/// ```
   50         -
/// The above code demonstrates that when `guardrailpiientitytype` represents
   51         -
/// `NewFeature`, the execution path will lead to the second last match arm,
   52         -
/// even though the enum does not contain a variant `GuardrailPiiEntityType::NewFeature`
   53         -
/// in the current version of SDK. The reason is that the variable `other`,
   54         -
/// created by the `@` operator, is bound to
   55         -
/// `GuardrailPiiEntityType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
   56         -
/// and calling `as_str` on it yields `"NewFeature"`.
   57         -
/// This match expression is forward-compatible when executed with a newer
   58         -
/// version of SDK where the variant `GuardrailPiiEntityType::NewFeature` is defined.
   59         -
/// Specifically, when `guardrailpiientitytype` represents `NewFeature`,
   60         -
/// the execution path will hit the second last match arm as before by virtue of
   61         -
/// calling `as_str` on `GuardrailPiiEntityType::NewFeature` also yielding `"NewFeature"`.
   62         -
///
   63         -
/// Explicitly matching on the `Unknown` variant should
   64         -
/// be avoided for two reasons:
   65         -
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
   66         -
/// - It might inadvertently shadow other intended match arms.
   67         -
///
   68         -
#[allow(missing_docs)] // documentation missing in model
   69         -
#[non_exhaustive]
   70         -
#[derive(
   71         -
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
   72         -
)]
   73         -
pub enum GuardrailPiiEntityType {
   74         -
    #[allow(missing_docs)] // documentation missing in model
   75         -
    Address,
   76         -
    #[allow(missing_docs)] // documentation missing in model
   77         -
    Age,
   78         -
    #[allow(missing_docs)] // documentation missing in model
   79         -
    AwsAccessKey,
   80         -
    #[allow(missing_docs)] // documentation missing in model
   81         -
    AwsSecretKey,
   82         -
    #[allow(missing_docs)] // documentation missing in model
   83         -
    CaHealthNumber,
   84         -
    #[allow(missing_docs)] // documentation missing in model
   85         -
    CaSocialInsuranceNumber,
   86         -
    #[allow(missing_docs)] // documentation missing in model
   87         -
    CreditDebitCardCvv,
   88         -
    #[allow(missing_docs)] // documentation missing in model
   89         -
    CreditDebitCardExpiry,
   90         -
    #[allow(missing_docs)] // documentation missing in model
   91         -
    CreditDebitCardNumber,
   92         -
    #[allow(missing_docs)] // documentation missing in model
   93         -
    DriverId,
   94         -
    #[allow(missing_docs)] // documentation missing in model
   95         -
    Email,
   96         -
    #[allow(missing_docs)] // documentation missing in model
   97         -
    InternationalBankAccountNumber,
   98         -
    #[allow(missing_docs)] // documentation missing in model
   99         -
    IpAddress,
  100         -
    #[allow(missing_docs)] // documentation missing in model
  101         -
    LicensePlate,
  102         -
    #[allow(missing_docs)] // documentation missing in model
  103         -
    MacAddress,
  104         -
    #[allow(missing_docs)] // documentation missing in model
  105         -
    Name,
  106         -
    #[allow(missing_docs)] // documentation missing in model
  107         -
    Password,
  108         -
    #[allow(missing_docs)] // documentation missing in model
  109         -
    Phone,
  110         -
    #[allow(missing_docs)] // documentation missing in model
  111         -
    Pin,
  112         -
    #[allow(missing_docs)] // documentation missing in model
  113         -
    SwiftCode,
  114         -
    #[allow(missing_docs)] // documentation missing in model
  115         -
    UkNationalHealthServiceNumber,
  116         -
    #[allow(missing_docs)] // documentation missing in model
  117         -
    UkNationalInsuranceNumber,
  118         -
    #[allow(missing_docs)] // documentation missing in model
  119         -
    UkUniqueTaxpayerReferenceNumber,
  120         -
    #[allow(missing_docs)] // documentation missing in model
  121         -
    Url,
  122         -
    #[allow(missing_docs)] // documentation missing in model
  123         -
    Username,
  124         -
    #[allow(missing_docs)] // documentation missing in model
  125         -
    UsBankAccountNumber,
  126         -
    #[allow(missing_docs)] // documentation missing in model
  127         -
    UsBankRoutingNumber,
  128         -
    #[allow(missing_docs)] // documentation missing in model
  129         -
    UsIndividualTaxIdentificationNumber,
  130         -
    #[allow(missing_docs)] // documentation missing in model
  131         -
    UsPassportNumber,
  132         -
    #[allow(missing_docs)] // documentation missing in model
  133         -
    UsSocialSecurityNumber,
  134         -
    #[allow(missing_docs)] // documentation missing in model
  135         -
    VehicleIdentificationNumber,
  136         -
    /// `Unknown` contains new variants that have been added since this code was generated.
  137         -
    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
  138         -
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
  139         -
}
  140         -
impl ::std::convert::From<&str> for GuardrailPiiEntityType {
  141         -
    fn from(s: &str) -> Self {
  142         -
        match s {
  143         -
            "ADDRESS" => GuardrailPiiEntityType::Address,
  144         -
            "AGE" => GuardrailPiiEntityType::Age,
  145         -
            "AWS_ACCESS_KEY" => GuardrailPiiEntityType::AwsAccessKey,
  146         -
            "AWS_SECRET_KEY" => GuardrailPiiEntityType::AwsSecretKey,
  147         -
            "CA_HEALTH_NUMBER" => GuardrailPiiEntityType::CaHealthNumber,
  148         -
            "CA_SOCIAL_INSURANCE_NUMBER" => GuardrailPiiEntityType::CaSocialInsuranceNumber,
  149         -
            "CREDIT_DEBIT_CARD_CVV" => GuardrailPiiEntityType::CreditDebitCardCvv,
  150         -
            "CREDIT_DEBIT_CARD_EXPIRY" => GuardrailPiiEntityType::CreditDebitCardExpiry,
  151         -
            "CREDIT_DEBIT_CARD_NUMBER" => GuardrailPiiEntityType::CreditDebitCardNumber,
  152         -
            "DRIVER_ID" => GuardrailPiiEntityType::DriverId,
  153         -
            "EMAIL" => GuardrailPiiEntityType::Email,
  154         -
            "INTERNATIONAL_BANK_ACCOUNT_NUMBER" => GuardrailPiiEntityType::InternationalBankAccountNumber,
  155         -
            "IP_ADDRESS" => GuardrailPiiEntityType::IpAddress,
  156         -
            "LICENSE_PLATE" => GuardrailPiiEntityType::LicensePlate,
  157         -
            "MAC_ADDRESS" => GuardrailPiiEntityType::MacAddress,
  158         -
            "NAME" => GuardrailPiiEntityType::Name,
  159         -
            "PASSWORD" => GuardrailPiiEntityType::Password,
  160         -
            "PHONE" => GuardrailPiiEntityType::Phone,
  161         -
            "PIN" => GuardrailPiiEntityType::Pin,
  162         -
            "SWIFT_CODE" => GuardrailPiiEntityType::SwiftCode,
  163         -
            "UK_NATIONAL_HEALTH_SERVICE_NUMBER" => GuardrailPiiEntityType::UkNationalHealthServiceNumber,
  164         -
            "UK_NATIONAL_INSURANCE_NUMBER" => GuardrailPiiEntityType::UkNationalInsuranceNumber,
  165         -
            "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" => GuardrailPiiEntityType::UkUniqueTaxpayerReferenceNumber,
  166         -
            "URL" => GuardrailPiiEntityType::Url,
  167         -
            "USERNAME" => GuardrailPiiEntityType::Username,
  168         -
            "US_BANK_ACCOUNT_NUMBER" => GuardrailPiiEntityType::UsBankAccountNumber,
  169         -
            "US_BANK_ROUTING_NUMBER" => GuardrailPiiEntityType::UsBankRoutingNumber,
  170         -
            "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" => GuardrailPiiEntityType::UsIndividualTaxIdentificationNumber,
  171         -
            "US_PASSPORT_NUMBER" => GuardrailPiiEntityType::UsPassportNumber,
  172         -
            "US_SOCIAL_SECURITY_NUMBER" => GuardrailPiiEntityType::UsSocialSecurityNumber,
  173         -
            "VEHICLE_IDENTIFICATION_NUMBER" => GuardrailPiiEntityType::VehicleIdentificationNumber,
  174         -
            other => GuardrailPiiEntityType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
  175         -
        }
  176         -
    }
  177         -
}
  178         -
impl ::std::str::FromStr for GuardrailPiiEntityType {
  179         -
    type Err = ::std::convert::Infallible;
  180         -
  181         -
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
  182         -
        ::std::result::Result::Ok(GuardrailPiiEntityType::from(s))
  183         -
    }
  184         -
}
  185         -
impl GuardrailPiiEntityType {
  186         -
    /// Returns the `&str` value of the enum member.
  187         -
    pub fn as_str(&self) -> &str {
  188         -
        match self {
  189         -
            GuardrailPiiEntityType::Address => "ADDRESS",
  190         -
            GuardrailPiiEntityType::Age => "AGE",
  191         -
            GuardrailPiiEntityType::AwsAccessKey => "AWS_ACCESS_KEY",
  192         -
            GuardrailPiiEntityType::AwsSecretKey => "AWS_SECRET_KEY",
  193         -
            GuardrailPiiEntityType::CaHealthNumber => "CA_HEALTH_NUMBER",
  194         -
            GuardrailPiiEntityType::CaSocialInsuranceNumber => "CA_SOCIAL_INSURANCE_NUMBER",
  195         -
            GuardrailPiiEntityType::CreditDebitCardCvv => "CREDIT_DEBIT_CARD_CVV",
  196         -
            GuardrailPiiEntityType::CreditDebitCardExpiry => "CREDIT_DEBIT_CARD_EXPIRY",
  197         -
            GuardrailPiiEntityType::CreditDebitCardNumber => "CREDIT_DEBIT_CARD_NUMBER",
  198         -
            GuardrailPiiEntityType::DriverId => "DRIVER_ID",
  199         -
            GuardrailPiiEntityType::Email => "EMAIL",
  200         -
            GuardrailPiiEntityType::InternationalBankAccountNumber => "INTERNATIONAL_BANK_ACCOUNT_NUMBER",
  201         -
            GuardrailPiiEntityType::IpAddress => "IP_ADDRESS",
  202         -
            GuardrailPiiEntityType::LicensePlate => "LICENSE_PLATE",
  203         -
            GuardrailPiiEntityType::MacAddress => "MAC_ADDRESS",
  204         -
            GuardrailPiiEntityType::Name => "NAME",
  205         -
            GuardrailPiiEntityType::Password => "PASSWORD",
  206         -
            GuardrailPiiEntityType::Phone => "PHONE",
  207         -
            GuardrailPiiEntityType::Pin => "PIN",
  208         -
            GuardrailPiiEntityType::SwiftCode => "SWIFT_CODE",
  209         -
            GuardrailPiiEntityType::UkNationalHealthServiceNumber => "UK_NATIONAL_HEALTH_SERVICE_NUMBER",
  210         -
            GuardrailPiiEntityType::UkNationalInsuranceNumber => "UK_NATIONAL_INSURANCE_NUMBER",
  211         -
            GuardrailPiiEntityType::UkUniqueTaxpayerReferenceNumber => "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER",
  212         -
            GuardrailPiiEntityType::Url => "URL",
  213         -
            GuardrailPiiEntityType::Username => "USERNAME",
  214         -
            GuardrailPiiEntityType::UsBankAccountNumber => "US_BANK_ACCOUNT_NUMBER",
  215         -
            GuardrailPiiEntityType::UsBankRoutingNumber => "US_BANK_ROUTING_NUMBER",
  216         -
            GuardrailPiiEntityType::UsIndividualTaxIdentificationNumber => "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER",
  217         -
            GuardrailPiiEntityType::UsPassportNumber => "US_PASSPORT_NUMBER",
  218         -
            GuardrailPiiEntityType::UsSocialSecurityNumber => "US_SOCIAL_SECURITY_NUMBER",
  219         -
            GuardrailPiiEntityType::VehicleIdentificationNumber => "VEHICLE_IDENTIFICATION_NUMBER",
  220         -
            GuardrailPiiEntityType::Unknown(value) => value.as_str(),
  221         -
        }
  222         -
    }
  223         -
    /// Returns all the `&str` representations of the enum members.
  224         -
    pub const fn values() -> &'static [&'static str] {
  225         -
        &[
  226         -
            "ADDRESS",
  227         -
            "AGE",
  228         -
            "AWS_ACCESS_KEY",
  229         -
            "AWS_SECRET_KEY",
  230         -
            "CA_HEALTH_NUMBER",
  231         -
            "CA_SOCIAL_INSURANCE_NUMBER",
  232         -
            "CREDIT_DEBIT_CARD_CVV",
  233         -
            "CREDIT_DEBIT_CARD_EXPIRY",
  234         -
            "CREDIT_DEBIT_CARD_NUMBER",
  235         -
            "DRIVER_ID",
  236         -
            "EMAIL",
  237         -
            "INTERNATIONAL_BANK_ACCOUNT_NUMBER",
  238         -
            "IP_ADDRESS",
  239         -
            "LICENSE_PLATE",
  240         -
            "MAC_ADDRESS",
  241         -
            "NAME",
  242         -
            "PASSWORD",
  243         -
            "PHONE",
  244         -
            "PIN",
  245         -
            "SWIFT_CODE",
  246         -
            "UK_NATIONAL_HEALTH_SERVICE_NUMBER",
  247         -
            "UK_NATIONAL_INSURANCE_NUMBER",
  248         -
            "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER",
  249         -
            "URL",
  250         -
            "USERNAME",
  251         -
            "US_BANK_ACCOUNT_NUMBER",
  252         -
            "US_BANK_ROUTING_NUMBER",
  253         -
            "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER",
  254         -
            "US_PASSPORT_NUMBER",
  255         -
            "US_SOCIAL_SECURITY_NUMBER",
  256         -
            "VEHICLE_IDENTIFICATION_NUMBER",
  257         -
        ]
  258         -
    }
  259         -
}
  260         -
impl ::std::convert::AsRef<str> for GuardrailPiiEntityType {
  261         -
    fn as_ref(&self) -> &str {
  262         -
        self.as_str()
  263         -
    }
  264         -
}
  265         -
impl GuardrailPiiEntityType {
  266         -
    /// Parses the enum value while disallowing unknown variants.
  267         -
    ///
  268         -
    /// Unknown variants will result in an error.
  269         -
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
  270         -
        match Self::from(value) {
  271         -
            #[allow(deprecated)]
  272         -
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
  273         -
            known => Ok(known),
  274         -
        }
  275         -
    }
  276         -
}
  277         -
impl ::std::fmt::Display for GuardrailPiiEntityType {
  278         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  279         -
        match self {
  280         -
            GuardrailPiiEntityType::Address => write!(f, "ADDRESS"),
  281         -
            GuardrailPiiEntityType::Age => write!(f, "AGE"),
  282         -
            GuardrailPiiEntityType::AwsAccessKey => write!(f, "AWS_ACCESS_KEY"),
  283         -
            GuardrailPiiEntityType::AwsSecretKey => write!(f, "AWS_SECRET_KEY"),
  284         -
            GuardrailPiiEntityType::CaHealthNumber => write!(f, "CA_HEALTH_NUMBER"),
  285         -
            GuardrailPiiEntityType::CaSocialInsuranceNumber => write!(f, "CA_SOCIAL_INSURANCE_NUMBER"),
  286         -
            GuardrailPiiEntityType::CreditDebitCardCvv => write!(f, "CREDIT_DEBIT_CARD_CVV"),
  287         -
            GuardrailPiiEntityType::CreditDebitCardExpiry => write!(f, "CREDIT_DEBIT_CARD_EXPIRY"),
  288         -
            GuardrailPiiEntityType::CreditDebitCardNumber => write!(f, "CREDIT_DEBIT_CARD_NUMBER"),
  289         -
            GuardrailPiiEntityType::DriverId => write!(f, "DRIVER_ID"),
  290         -
            GuardrailPiiEntityType::Email => write!(f, "EMAIL"),
  291         -
            GuardrailPiiEntityType::InternationalBankAccountNumber => write!(f, "INTERNATIONAL_BANK_ACCOUNT_NUMBER"),
  292         -
            GuardrailPiiEntityType::IpAddress => write!(f, "IP_ADDRESS"),
  293         -
            GuardrailPiiEntityType::LicensePlate => write!(f, "LICENSE_PLATE"),
  294         -
            GuardrailPiiEntityType::MacAddress => write!(f, "MAC_ADDRESS"),
  295         -
            GuardrailPiiEntityType::Name => write!(f, "NAME"),
  296         -
            GuardrailPiiEntityType::Password => write!(f, "PASSWORD"),
  297         -
            GuardrailPiiEntityType::Phone => write!(f, "PHONE"),
  298         -
            GuardrailPiiEntityType::Pin => write!(f, "PIN"),
  299         -
            GuardrailPiiEntityType::SwiftCode => write!(f, "SWIFT_CODE"),
  300         -
            GuardrailPiiEntityType::UkNationalHealthServiceNumber => write!(f, "UK_NATIONAL_HEALTH_SERVICE_NUMBER"),
  301         -
            GuardrailPiiEntityType::UkNationalInsuranceNumber => write!(f, "UK_NATIONAL_INSURANCE_NUMBER"),
  302         -
            GuardrailPiiEntityType::UkUniqueTaxpayerReferenceNumber => write!(f, "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER"),
  303         -
            GuardrailPiiEntityType::Url => write!(f, "URL"),
  304         -
            GuardrailPiiEntityType::Username => write!(f, "USERNAME"),
  305         -
            GuardrailPiiEntityType::UsBankAccountNumber => write!(f, "US_BANK_ACCOUNT_NUMBER"),
  306         -
            GuardrailPiiEntityType::UsBankRoutingNumber => write!(f, "US_BANK_ROUTING_NUMBER"),
  307         -
            GuardrailPiiEntityType::UsIndividualTaxIdentificationNumber => write!(f, "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER"),
  308         -
            GuardrailPiiEntityType::UsPassportNumber => write!(f, "US_PASSPORT_NUMBER"),
  309         -
            GuardrailPiiEntityType::UsSocialSecurityNumber => write!(f, "US_SOCIAL_SECURITY_NUMBER"),
  310         -
            GuardrailPiiEntityType::VehicleIdentificationNumber => write!(f, "VEHICLE_IDENTIFICATION_NUMBER"),
  311         -
            GuardrailPiiEntityType::Unknown(value) => write!(f, "{}", value),
  312         -
        }
  313         -
    }
  314         -
}

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

@@ -1,0 +146,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// <p>A Regex filter configured in a guardrail.</p>
    4         -
#[non_exhaustive]
    5         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct GuardrailRegexFilter {
    7         -
    /// <p>The regex filter name.</p>
    8         -
    pub name: ::std::option::Option<::std::string::String>,
    9         -
    /// <p>The regesx filter match.</p>
   10         -
    pub r#match: ::std::option::Option<::std::string::String>,
   11         -
    /// <p>The regex query.</p>
   12         -
    pub regex: ::std::option::Option<::std::string::String>,
   13         -
    /// <p>The region filter action.</p>
   14         -
    pub action: crate::types::GuardrailSensitiveInformationPolicyAction,
   15         -
    /// <p>Indicates whether custom regex entities that breach the guardrail configuration are detected.</p>
   16         -
    pub detected: ::std::option::Option<bool>,
   17         -
}
   18         -
impl GuardrailRegexFilter {
   19         -
    /// <p>The regex filter name.</p>
   20         -
    pub fn name(&self) -> ::std::option::Option<&str> {
   21         -
        self.name.as_deref()
   22         -
    }
   23         -
    /// <p>The regesx filter match.</p>
   24         -
    pub fn r#match(&self) -> ::std::option::Option<&str> {
   25         -
        self.r#match.as_deref()
   26         -
    }
   27         -
    /// <p>The regex query.</p>
   28         -
    pub fn regex(&self) -> ::std::option::Option<&str> {
   29         -
        self.regex.as_deref()
   30         -
    }
   31         -
    /// <p>The region filter action.</p>
   32         -
    pub fn action(&self) -> &crate::types::GuardrailSensitiveInformationPolicyAction {
   33         -
        &self.action
   34         -
    }
   35         -
    /// <p>Indicates whether custom regex entities that breach the guardrail configuration are detected.</p>
   36         -
    pub fn detected(&self) -> ::std::option::Option<bool> {
   37         -
        self.detected
   38         -
    }
   39         -
}
   40         -
impl GuardrailRegexFilter {
   41         -
    /// Creates a new builder-style object to manufacture [`GuardrailRegexFilter`](crate::types::GuardrailRegexFilter).
   42         -
    pub fn builder() -> crate::types::builders::GuardrailRegexFilterBuilder {
   43         -
        crate::types::builders::GuardrailRegexFilterBuilder::default()
   44         -
    }
   45         -
}
   46         -
   47         -
/// A builder for [`GuardrailRegexFilter`](crate::types::GuardrailRegexFilter).
   48         -
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
   49         -
#[non_exhaustive]
   50         -
pub struct GuardrailRegexFilterBuilder {
   51         -
    pub(crate) name: ::std::option::Option<::std::string::String>,
   52         -
    pub(crate) r#match: ::std::option::Option<::std::string::String>,
   53         -
    pub(crate) regex: ::std::option::Option<::std::string::String>,
   54         -
    pub(crate) action: ::std::option::Option<crate::types::GuardrailSensitiveInformationPolicyAction>,
   55         -
    pub(crate) detected: ::std::option::Option<bool>,
   56         -
}
   57         -
impl GuardrailRegexFilterBuilder {
   58         -
    /// <p>The regex filter name.</p>
   59         -
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
   60         -
        self.name = ::std::option::Option::Some(input.into());
   61         -
        self
   62         -
    }
   63         -
    /// <p>The regex filter name.</p>
   64         -
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
   65         -
        self.name = input;
   66         -
        self
   67         -
    }
   68         -
    /// <p>The regex filter name.</p>
   69         -
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
   70         -
        &self.name
   71         -
    }
   72         -
    /// <p>The regesx filter match.</p>
   73         -
    pub fn r#match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
   74         -
        self.r#match = ::std::option::Option::Some(input.into());
   75         -
        self
   76         -
    }
   77         -
    /// <p>The regesx filter match.</p>
   78         -
    pub fn set_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
   79         -
        self.r#match = input;
   80         -
        self
   81         -
    }
   82         -
    /// <p>The regesx filter match.</p>
   83         -
    pub fn get_match(&self) -> &::std::option::Option<::std::string::String> {
   84         -
        &self.r#match
   85         -
    }
   86         -
    /// <p>The regex query.</p>
   87         -
    pub fn regex(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
   88         -
        self.regex = ::std::option::Option::Some(input.into());
   89         -
        self
   90         -
    }
   91         -
    /// <p>The regex query.</p>
   92         -
    pub fn set_regex(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
   93         -
        self.regex = input;
   94         -
        self
   95         -
    }
   96         -
    /// <p>The regex query.</p>
   97         -
    pub fn get_regex(&self) -> &::std::option::Option<::std::string::String> {
   98         -
        &self.regex
   99         -
    }
  100         -
    /// <p>The region filter action.</p>
  101         -
    /// This field is required.
  102         -
    pub fn action(mut self, input: crate::types::GuardrailSensitiveInformationPolicyAction) -> Self {
  103         -
        self.action = ::std::option::Option::Some(input);
  104         -
        self
  105         -
    }
  106         -
    /// <p>The region filter action.</p>
  107         -
    pub fn set_action(mut self, input: ::std::option::Option<crate::types::GuardrailSensitiveInformationPolicyAction>) -> Self {
  108         -
        self.action = input;
  109         -
        self
  110         -
    }
  111         -
    /// <p>The region filter action.</p>
  112         -
    pub fn get_action(&self) -> &::std::option::Option<crate::types::GuardrailSensitiveInformationPolicyAction> {
  113         -
        &self.action
  114         -
    }
  115         -
    /// <p>Indicates whether custom regex entities that breach the guardrail configuration are detected.</p>
  116         -
    pub fn detected(mut self, input: bool) -> Self {
  117         -
        self.detected = ::std::option::Option::Some(input);
  118         -
        self
  119         -
    }
  120         -
    /// <p>Indicates whether custom regex entities that breach the guardrail configuration are detected.</p>
  121         -
    pub fn set_detected(mut self, input: ::std::option::Option<bool>) -> Self {
  122         -
        self.detected = input;
  123         -
        self
  124         -
    }
  125         -
    /// <p>Indicates whether custom regex entities that breach the guardrail configuration are detected.</p>
  126         -
    pub fn get_detected(&self) -> &::std::option::Option<bool> {
  127         -
        &self.detected
  128         -
    }
  129         -
    /// Consumes the builder and constructs a [`GuardrailRegexFilter`](crate::types::GuardrailRegexFilter).
  130         -
    /// This method will fail if any of the following fields are not set:
  131         -
    /// - [`action`](crate::types::builders::GuardrailRegexFilterBuilder::action)
  132         -
    pub fn build(self) -> ::std::result::Result<crate::types::GuardrailRegexFilter, ::aws_smithy_types::error::operation::BuildError> {
  133         -
        ::std::result::Result::Ok(crate::types::GuardrailRegexFilter {
  134         -
            name: self.name,
  135         -
            r#match: self.r#match,
  136         -
            regex: self.regex,
  137         -
            action: self.action.ok_or_else(|| {
  138         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  139         -
                    "action",
  140         -
                    "action was not specified but it is required when building GuardrailRegexFilter",
  141         -
                )
  142         -
            })?,
  143         -
            detected: self.detected,
  144         -
        })
  145         -
    }
  146         -
}

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

@@ -1,0 +116,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// When writing a match expression against `GuardrailSensitiveInformationPolicyAction`, 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 guardrailsensitiveinformationpolicyaction = unimplemented!();
   14         -
/// match guardrailsensitiveinformationpolicyaction {
   15         -
///     GuardrailSensitiveInformationPolicyAction::Anonymized => { /* ... */ },
   16         -
///     GuardrailSensitiveInformationPolicyAction::Blocked => { /* ... */ },
   17         -
///     GuardrailSensitiveInformationPolicyAction::None => { /* ... */ },
   18         -
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
   19         -
///     _ => { /* ... */ },
   20         -
/// }
   21         -
/// ```
   22         -
/// The above code demonstrates that when `guardrailsensitiveinformationpolicyaction` represents
   23         -
/// `NewFeature`, the execution path will lead to the second last match arm,
   24         -
/// even though the enum does not contain a variant `GuardrailSensitiveInformationPolicyAction::NewFeature`
   25         -
/// in the current version of SDK. The reason is that the variable `other`,
   26         -
/// created by the `@` operator, is bound to
   27         -
/// `GuardrailSensitiveInformationPolicyAction::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 `GuardrailSensitiveInformationPolicyAction::NewFeature` is defined.
   31         -
/// Specifically, when `guardrailsensitiveinformationpolicyaction` represents `NewFeature`,
   32         -
/// the execution path will hit the second last match arm as before by virtue of
   33         -
/// calling `as_str` on `GuardrailSensitiveInformationPolicyAction::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 GuardrailSensitiveInformationPolicyAction {
   46         -
    #[allow(missing_docs)] // documentation missing in model
   47         -
    Anonymized,
   48         -
    #[allow(missing_docs)] // documentation missing in model
   49         -
    Blocked,
   50         -
    #[allow(missing_docs)] // documentation missing in model
   51         -
    None,
   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 GuardrailSensitiveInformationPolicyAction {
   57         -
    fn from(s: &str) -> Self {
   58         -
        match s {
   59         -
            "ANONYMIZED" => GuardrailSensitiveInformationPolicyAction::Anonymized,
   60         -
            "BLOCKED" => GuardrailSensitiveInformationPolicyAction::Blocked,
   61         -
            "NONE" => GuardrailSensitiveInformationPolicyAction::None,
   62         -
            other => {
   63         -
                GuardrailSensitiveInformationPolicyAction::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned()))
   64         -
            }
   65         -
        }
   66         -
    }
   67         -
}
   68         -
impl ::std::str::FromStr for GuardrailSensitiveInformationPolicyAction {
   69         -
    type Err = ::std::convert::Infallible;
   70         -
   71         -
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
   72         -
        ::std::result::Result::Ok(GuardrailSensitiveInformationPolicyAction::from(s))
   73         -
    }
   74         -
}
   75         -
impl GuardrailSensitiveInformationPolicyAction {
   76         -
    /// Returns the `&str` value of the enum member.
   77         -
    pub fn as_str(&self) -> &str {
   78         -
        match self {
   79         -
            GuardrailSensitiveInformationPolicyAction::Anonymized => "ANONYMIZED",
   80         -
            GuardrailSensitiveInformationPolicyAction::Blocked => "BLOCKED",
   81         -
            GuardrailSensitiveInformationPolicyAction::None => "NONE",
   82         -
            GuardrailSensitiveInformationPolicyAction::Unknown(value) => value.as_str(),
   83         -
        }
   84         -
    }
   85         -
    /// Returns all the `&str` representations of the enum members.
   86         -
    pub const fn values() -> &'static [&'static str] {
   87         -
        &["ANONYMIZED", "BLOCKED", "NONE"]
   88         -
    }
   89         -
}
   90         -
impl ::std::convert::AsRef<str> for GuardrailSensitiveInformationPolicyAction {
   91         -
    fn as_ref(&self) -> &str {
   92         -
        self.as_str()
   93         -
    }
   94         -
}
   95         -
impl GuardrailSensitiveInformationPolicyAction {
   96         -
    /// Parses the enum value while disallowing unknown variants.
   97         -
    ///
   98         -
    /// Unknown variants will result in an error.
   99         -
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
  100         -
        match Self::from(value) {
  101         -
            #[allow(deprecated)]
  102         -
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
  103         -
            known => Ok(known),
  104         -
        }
  105         -
    }
  106         -
}
  107         -
impl ::std::fmt::Display for GuardrailSensitiveInformationPolicyAction {
  108         -
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  109         -
        match self {
  110         -
            GuardrailSensitiveInformationPolicyAction::Anonymized => write!(f, "ANONYMIZED"),
  111         -
            GuardrailSensitiveInformationPolicyAction::Blocked => write!(f, "BLOCKED"),
  112         -
            GuardrailSensitiveInformationPolicyAction::None => write!(f, "NONE"),
  113         -
            GuardrailSensitiveInformationPolicyAction::Unknown(value) => write!(f, "{}", value),
  114         -
        }
  115         -
    }
  116         -
}