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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Provides information about the rules attached to the rule group. These rules identify the web requests that you want to allow, block, or count. </p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AwsWafRuleGroupRulesDetails {
/// <p>Provides information about what action WAF should take on a web request when it matches the criteria defined in the rule. </p>
pub action: ::std::option::Option<crate::types::AwsWafRuleGroupRulesActionDetails>,
/// <p>If you define more than one rule in a web ACL, WAF evaluates each request against the rules in order based on the value of <code>Priority</code>.</p>
pub priority: i32,
/// <p>The rule ID for a rule. </p>
pub rule_id: ::std::option::Option<::std::string::String>,
/// <p>The type of rule. </p>
pub r#type: ::std::option::Option<::std::string::String>,
}
impl AwsWafRuleGroupRulesDetails {
/// <p>Provides information about what action WAF should take on a web request when it matches the criteria defined in the rule. </p>
pub fn action(&self) -> ::std::option::Option<&crate::types::AwsWafRuleGroupRulesActionDetails> {
self.action.as_ref()
}
/// <p>If you define more than one rule in a web ACL, WAF evaluates each request against the rules in order based on the value of <code>Priority</code>.</p>
pub fn priority(&self) -> i32 {
self.priority
}
/// <p>The rule ID for a rule. </p>
pub fn rule_id(&self) -> ::std::option::Option<&str> {
self.rule_id.as_deref()
}
/// <p>The type of rule. </p>
pub fn r#type(&self) -> ::std::option::Option<&str> {
self.r#type.as_deref()
}
}
impl AwsWafRuleGroupRulesDetails {
/// Creates a new builder-style object to manufacture [`AwsWafRuleGroupRulesDetails`](crate::types::AwsWafRuleGroupRulesDetails).
pub fn builder() -> crate::types::builders::AwsWafRuleGroupRulesDetailsBuilder {
crate::types::builders::AwsWafRuleGroupRulesDetailsBuilder::default()
}
}
/// A builder for [`AwsWafRuleGroupRulesDetails`](crate::types::AwsWafRuleGroupRulesDetails).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AwsWafRuleGroupRulesDetailsBuilder {
pub(crate) action: ::std::option::Option<crate::types::AwsWafRuleGroupRulesActionDetails>,
pub(crate) priority: ::std::option::Option<i32>,
pub(crate) rule_id: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<::std::string::String>,
}
impl AwsWafRuleGroupRulesDetailsBuilder {
/// <p>Provides information about what action WAF should take on a web request when it matches the criteria defined in the rule. </p>
pub fn action(mut self, input: crate::types::AwsWafRuleGroupRulesActionDetails) -> Self {
self.action = ::std::option::Option::Some(input);
self
}
/// <p>Provides information about what action WAF should take on a web request when it matches the criteria defined in the rule. </p>
pub fn set_action(mut self, input: ::std::option::Option<crate::types::AwsWafRuleGroupRulesActionDetails>) -> Self {
self.action = input;
self
}
/// <p>Provides information about what action WAF should take on a web request when it matches the criteria defined in the rule. </p>
pub fn get_action(&self) -> &::std::option::Option<crate::types::AwsWafRuleGroupRulesActionDetails> {
&self.action
}
/// <p>If you define more than one rule in a web ACL, WAF evaluates each request against the rules in order based on the value of <code>Priority</code>.</p>
pub fn priority(mut self, input: i32) -> Self {
self.priority = ::std::option::Option::Some(input);
self
}
/// <p>If you define more than one rule in a web ACL, WAF evaluates each request against the rules in order based on the value of <code>Priority</code>.</p>
pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
self.priority = input;
self
}
/// <p>If you define more than one rule in a web ACL, WAF evaluates each request against the rules in order based on the value of <code>Priority</code>.</p>
pub fn get_priority(&self) -> &::std::option::Option<i32> {
&self.priority
}
/// <p>The rule ID for a rule. </p>
pub fn rule_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.rule_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The rule ID for a rule. </p>
pub fn set_rule_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.rule_id = input;
self
}
/// <p>The rule ID for a rule. </p>
pub fn get_rule_id(&self) -> &::std::option::Option<::std::string::String> {
&self.rule_id
}
/// <p>The type of rule. </p>
pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.r#type = ::std::option::Option::Some(input.into());
self
}
/// <p>The type of rule. </p>
pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.r#type = input;
self
}
/// <p>The type of rule. </p>
pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
&self.r#type
}
/// Consumes the builder and constructs a [`AwsWafRuleGroupRulesDetails`](crate::types::AwsWafRuleGroupRulesDetails).
pub fn build(self) -> crate::types::AwsWafRuleGroupRulesDetails {
crate::types::AwsWafRuleGroupRulesDetails {
action: self.action,
priority: self.priority.unwrap_or_default(),
rule_id: self.rule_id,
r#type: self.r#type,
}
}
}