aws-sdk-wafv2 1.130.0

AWS SDK for AWS WAFV2
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A single regular expression. This is used in a <code>RegexPatternSet</code> and also in the configuration for the Amazon Web Services Managed Rules rule group <code>AWSManagedRulesAntiDDoSRuleSet</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Regex {
    /// <p>The string representing the regular expression. WAF enforces a quota on the maximum number of characters in a regex pattern. For the current limit, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF quotas</a> in the <i>WAF Developer Guide</i>.</p>
    pub regex_string: ::std::option::Option<::std::string::String>,
}
impl Regex {
    /// <p>The string representing the regular expression. WAF enforces a quota on the maximum number of characters in a regex pattern. For the current limit, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF quotas</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn regex_string(&self) -> ::std::option::Option<&str> {
        self.regex_string.as_deref()
    }
}
impl Regex {
    /// Creates a new builder-style object to manufacture [`Regex`](crate::types::Regex).
    pub fn builder() -> crate::types::builders::RegexBuilder {
        crate::types::builders::RegexBuilder::default()
    }
}

/// A builder for [`Regex`](crate::types::Regex).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RegexBuilder {
    pub(crate) regex_string: ::std::option::Option<::std::string::String>,
}
impl RegexBuilder {
    /// <p>The string representing the regular expression. WAF enforces a quota on the maximum number of characters in a regex pattern. For the current limit, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF quotas</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn regex_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.regex_string = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The string representing the regular expression. WAF enforces a quota on the maximum number of characters in a regex pattern. For the current limit, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF quotas</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn set_regex_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.regex_string = input;
        self
    }
    /// <p>The string representing the regular expression. WAF enforces a quota on the maximum number of characters in a regex pattern. For the current limit, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF quotas</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn get_regex_string(&self) -> &::std::option::Option<::std::string::String> {
        &self.regex_string
    }
    /// Consumes the builder and constructs a [`Regex`](crate::types::Regex).
    pub fn build(self) -> crate::types::Regex {
        crate::types::Regex {
            regex_string: self.regex_string,
        }
    }
}