Skip to main content

aws_sdk_securityhub/types/
_aws_waf_rule_predicate_list_details.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides details about the <code>ByteMatchSet</code>, <code>IPSet</code>, <code>SqlInjectionMatchSet</code>, <code>XssMatchSet</code>, <code>RegexMatchSet</code>, <code>GeoMatchSet</code>, and <code>SizeConstraintSet</code> objects that you want to add to a rule and, for each object, indicates whether you want to negate the settings.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AwsWafRulePredicateListDetails {
7    /// <p>A unique identifier for a predicate in a rule, such as <code>ByteMatchSetId</code> or <code>IPSetId</code>.</p>
8    pub data_id: ::std::option::Option<::std::string::String>,
9    /// <p>Specifies if you want WAF to allow, block, or count requests based on the settings in the <code>ByteMatchSet</code>, <code>IPSet</code>, <code>SqlInjectionMatchSet</code>, <code>XssMatchSet</code>, <code>RegexMatchSet</code>, <code>GeoMatchSet</code>, or <code>SizeConstraintSet</code>.</p>
10    pub negated: ::std::option::Option<bool>,
11    /// <p>The type of predicate in a rule, such as <code>ByteMatch</code> or <code>IPSet</code>.</p>
12    pub r#type: ::std::option::Option<::std::string::String>,
13}
14impl AwsWafRulePredicateListDetails {
15    /// <p>A unique identifier for a predicate in a rule, such as <code>ByteMatchSetId</code> or <code>IPSetId</code>.</p>
16    pub fn data_id(&self) -> ::std::option::Option<&str> {
17        self.data_id.as_deref()
18    }
19    /// <p>Specifies if you want WAF to allow, block, or count requests based on the settings in the <code>ByteMatchSet</code>, <code>IPSet</code>, <code>SqlInjectionMatchSet</code>, <code>XssMatchSet</code>, <code>RegexMatchSet</code>, <code>GeoMatchSet</code>, or <code>SizeConstraintSet</code>.</p>
20    pub fn negated(&self) -> ::std::option::Option<bool> {
21        self.negated
22    }
23    /// <p>The type of predicate in a rule, such as <code>ByteMatch</code> or <code>IPSet</code>.</p>
24    pub fn r#type(&self) -> ::std::option::Option<&str> {
25        self.r#type.as_deref()
26    }
27}
28impl AwsWafRulePredicateListDetails {
29    /// Creates a new builder-style object to manufacture [`AwsWafRulePredicateListDetails`](crate::types::AwsWafRulePredicateListDetails).
30    pub fn builder() -> crate::types::builders::AwsWafRulePredicateListDetailsBuilder {
31        crate::types::builders::AwsWafRulePredicateListDetailsBuilder::default()
32    }
33}
34
35/// A builder for [`AwsWafRulePredicateListDetails`](crate::types::AwsWafRulePredicateListDetails).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct AwsWafRulePredicateListDetailsBuilder {
39    pub(crate) data_id: ::std::option::Option<::std::string::String>,
40    pub(crate) negated: ::std::option::Option<bool>,
41    pub(crate) r#type: ::std::option::Option<::std::string::String>,
42}
43impl AwsWafRulePredicateListDetailsBuilder {
44    /// <p>A unique identifier for a predicate in a rule, such as <code>ByteMatchSetId</code> or <code>IPSetId</code>.</p>
45    pub fn data_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.data_id = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>A unique identifier for a predicate in a rule, such as <code>ByteMatchSetId</code> or <code>IPSetId</code>.</p>
50    pub fn set_data_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.data_id = input;
52        self
53    }
54    /// <p>A unique identifier for a predicate in a rule, such as <code>ByteMatchSetId</code> or <code>IPSetId</code>.</p>
55    pub fn get_data_id(&self) -> &::std::option::Option<::std::string::String> {
56        &self.data_id
57    }
58    /// <p>Specifies if you want WAF to allow, block, or count requests based on the settings in the <code>ByteMatchSet</code>, <code>IPSet</code>, <code>SqlInjectionMatchSet</code>, <code>XssMatchSet</code>, <code>RegexMatchSet</code>, <code>GeoMatchSet</code>, or <code>SizeConstraintSet</code>.</p>
59    pub fn negated(mut self, input: bool) -> Self {
60        self.negated = ::std::option::Option::Some(input);
61        self
62    }
63    /// <p>Specifies if you want WAF to allow, block, or count requests based on the settings in the <code>ByteMatchSet</code>, <code>IPSet</code>, <code>SqlInjectionMatchSet</code>, <code>XssMatchSet</code>, <code>RegexMatchSet</code>, <code>GeoMatchSet</code>, or <code>SizeConstraintSet</code>.</p>
64    pub fn set_negated(mut self, input: ::std::option::Option<bool>) -> Self {
65        self.negated = input;
66        self
67    }
68    /// <p>Specifies if you want WAF to allow, block, or count requests based on the settings in the <code>ByteMatchSet</code>, <code>IPSet</code>, <code>SqlInjectionMatchSet</code>, <code>XssMatchSet</code>, <code>RegexMatchSet</code>, <code>GeoMatchSet</code>, or <code>SizeConstraintSet</code>.</p>
69    pub fn get_negated(&self) -> &::std::option::Option<bool> {
70        &self.negated
71    }
72    /// <p>The type of predicate in a rule, such as <code>ByteMatch</code> or <code>IPSet</code>.</p>
73    pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.r#type = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>The type of predicate in a rule, such as <code>ByteMatch</code> or <code>IPSet</code>.</p>
78    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.r#type = input;
80        self
81    }
82    /// <p>The type of predicate in a rule, such as <code>ByteMatch</code> or <code>IPSet</code>.</p>
83    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
84        &self.r#type
85    }
86    /// Consumes the builder and constructs a [`AwsWafRulePredicateListDetails`](crate::types::AwsWafRulePredicateListDetails).
87    pub fn build(self) -> crate::types::AwsWafRulePredicateListDetails {
88        crate::types::AwsWafRulePredicateListDetails {
89            data_id: self.data_id,
90            negated: self.negated,
91            r#type: self.r#type,
92        }
93    }
94}