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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Specifies the request's query string as an aggregate key for a rate-based rule. Each distinct string contributes to the aggregation instance. If you use just the query string as your custom key, then each string fully defines an aggregation instance.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RateLimitQueryString {
    /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. Text transformations are used in rule match statements, to transform the <code>FieldToMatch</code> request component before inspecting it, and they're used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.</p>
    pub text_transformations: ::std::vec::Vec<crate::types::TextTransformation>,
}
impl RateLimitQueryString {
    /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. Text transformations are used in rule match statements, to transform the <code>FieldToMatch</code> request component before inspecting it, and they're used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.</p>
    pub fn text_transformations(&self) -> &[crate::types::TextTransformation] {
        use std::ops::Deref;
        self.text_transformations.deref()
    }
}
impl RateLimitQueryString {
    /// Creates a new builder-style object to manufacture [`RateLimitQueryString`](crate::types::RateLimitQueryString).
    pub fn builder() -> crate::types::builders::RateLimitQueryStringBuilder {
        crate::types::builders::RateLimitQueryStringBuilder::default()
    }
}

/// A builder for [`RateLimitQueryString`](crate::types::RateLimitQueryString).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct RateLimitQueryStringBuilder {
    pub(crate) text_transformations: ::std::option::Option<::std::vec::Vec<crate::types::TextTransformation>>,
}
impl RateLimitQueryStringBuilder {
    /// Appends an item to `text_transformations`.
    ///
    /// To override the contents of this collection use [`set_text_transformations`](Self::set_text_transformations).
    ///
    /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. Text transformations are used in rule match statements, to transform the <code>FieldToMatch</code> request component before inspecting it, and they're used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.</p>
    pub fn text_transformations(mut self, input: crate::types::TextTransformation) -> Self {
        let mut v = self.text_transformations.unwrap_or_default();
        v.push(input);
        self.text_transformations = ::std::option::Option::Some(v);
        self
    }
    /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. Text transformations are used in rule match statements, to transform the <code>FieldToMatch</code> request component before inspecting it, and they're used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.</p>
    pub fn set_text_transformations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TextTransformation>>) -> Self {
        self.text_transformations = input;
        self
    }
    /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. Text transformations are used in rule match statements, to transform the <code>FieldToMatch</code> request component before inspecting it, and they're used in rate-based rule statements, to transform request components before using them as custom aggregation keys. If you specify one or more transformations to apply, WAF performs all transformations on the specified content, starting from the lowest priority setting, and then uses the transformed component contents.</p>
    pub fn get_text_transformations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TextTransformation>> {
        &self.text_transformations
    }
    /// Consumes the builder and constructs a [`RateLimitQueryString`](crate::types::RateLimitQueryString).
    /// This method will fail if any of the following fields are not set:
    /// - [`text_transformations`](crate::types::builders::RateLimitQueryStringBuilder::text_transformations)
    pub fn build(self) -> ::std::result::Result<crate::types::RateLimitQueryString, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::RateLimitQueryString {
            text_transformations: self.text_transformations.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "text_transformations",
                    "text_transformations was not specified but it is required when building RateLimitQueryString",
                )
            })?,
        })
    }
}