1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// 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,
}
}
}