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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Details for your use of the Bot Control managed rule group, <code>AWSManagedRulesBotControlRuleSet</code>. This configuration is used in <code>ManagedRuleGroupConfig</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AwsManagedRulesBotControlRuleSet {
    /// <p>The inspection level to use for the Bot Control rule group. The common level is the least expensive. The targeted level includes all common level rules and adds rules with more advanced inspection criteria. For details, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-bot.html">WAF Bot Control rule group</a> in the <i>WAF Developer Guide</i>.</p>
    pub inspection_level: crate::types::InspectionLevel,
    /// <p>Applies only to the targeted inspection level.</p>
    /// <p>Determines whether to use machine learning (ML) to analyze your web traffic for bot-related activity. Machine learning is required for the Bot Control rules <code>TGT_ML_CoordinatedActivityLow</code> and <code>TGT_ML_CoordinatedActivityMedium</code>, which inspect for anomalous behavior that might indicate distributed, coordinated bot activity.</p>
    /// <p>For more information about this choice, see the listing for these rules in the table at <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-bot.html#aws-managed-rule-groups-bot-rules">Bot Control rules listing</a> in the <i>WAF Developer Guide</i>.</p>
    /// <p>Default: <code>TRUE</code></p>
    pub enable_machine_learning: bool,
}
impl AwsManagedRulesBotControlRuleSet {
    /// <p>The inspection level to use for the Bot Control rule group. The common level is the least expensive. The targeted level includes all common level rules and adds rules with more advanced inspection criteria. For details, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-bot.html">WAF Bot Control rule group</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn inspection_level(&self) -> &crate::types::InspectionLevel {
        &self.inspection_level
    }
    /// <p>Applies only to the targeted inspection level.</p>
    /// <p>Determines whether to use machine learning (ML) to analyze your web traffic for bot-related activity. Machine learning is required for the Bot Control rules <code>TGT_ML_CoordinatedActivityLow</code> and <code>TGT_ML_CoordinatedActivityMedium</code>, which inspect for anomalous behavior that might indicate distributed, coordinated bot activity.</p>
    /// <p>For more information about this choice, see the listing for these rules in the table at <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-bot.html#aws-managed-rule-groups-bot-rules">Bot Control rules listing</a> in the <i>WAF Developer Guide</i>.</p>
    /// <p>Default: <code>TRUE</code></p>
    pub fn enable_machine_learning(&self) -> bool {
        self.enable_machine_learning
    }
}
impl AwsManagedRulesBotControlRuleSet {
    /// Creates a new builder-style object to manufacture [`AwsManagedRulesBotControlRuleSet`](crate::types::AwsManagedRulesBotControlRuleSet).
    pub fn builder() -> crate::types::builders::AwsManagedRulesBotControlRuleSetBuilder {
        crate::types::builders::AwsManagedRulesBotControlRuleSetBuilder::default()
    }
}

/// A builder for [`AwsManagedRulesBotControlRuleSet`](crate::types::AwsManagedRulesBotControlRuleSet).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AwsManagedRulesBotControlRuleSetBuilder {
    pub(crate) inspection_level: ::std::option::Option<crate::types::InspectionLevel>,
    pub(crate) enable_machine_learning: ::std::option::Option<bool>,
}
impl AwsManagedRulesBotControlRuleSetBuilder {
    /// <p>The inspection level to use for the Bot Control rule group. The common level is the least expensive. The targeted level includes all common level rules and adds rules with more advanced inspection criteria. For details, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-bot.html">WAF Bot Control rule group</a> in the <i>WAF Developer Guide</i>.</p>
    /// This field is required.
    pub fn inspection_level(mut self, input: crate::types::InspectionLevel) -> Self {
        self.inspection_level = ::std::option::Option::Some(input);
        self
    }
    /// <p>The inspection level to use for the Bot Control rule group. The common level is the least expensive. The targeted level includes all common level rules and adds rules with more advanced inspection criteria. For details, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-bot.html">WAF Bot Control rule group</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn set_inspection_level(mut self, input: ::std::option::Option<crate::types::InspectionLevel>) -> Self {
        self.inspection_level = input;
        self
    }
    /// <p>The inspection level to use for the Bot Control rule group. The common level is the least expensive. The targeted level includes all common level rules and adds rules with more advanced inspection criteria. For details, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-bot.html">WAF Bot Control rule group</a> in the <i>WAF Developer Guide</i>.</p>
    pub fn get_inspection_level(&self) -> &::std::option::Option<crate::types::InspectionLevel> {
        &self.inspection_level
    }
    /// <p>Applies only to the targeted inspection level.</p>
    /// <p>Determines whether to use machine learning (ML) to analyze your web traffic for bot-related activity. Machine learning is required for the Bot Control rules <code>TGT_ML_CoordinatedActivityLow</code> and <code>TGT_ML_CoordinatedActivityMedium</code>, which inspect for anomalous behavior that might indicate distributed, coordinated bot activity.</p>
    /// <p>For more information about this choice, see the listing for these rules in the table at <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-bot.html#aws-managed-rule-groups-bot-rules">Bot Control rules listing</a> in the <i>WAF Developer Guide</i>.</p>
    /// <p>Default: <code>TRUE</code></p>
    pub fn enable_machine_learning(mut self, input: bool) -> Self {
        self.enable_machine_learning = ::std::option::Option::Some(input);
        self
    }
    /// <p>Applies only to the targeted inspection level.</p>
    /// <p>Determines whether to use machine learning (ML) to analyze your web traffic for bot-related activity. Machine learning is required for the Bot Control rules <code>TGT_ML_CoordinatedActivityLow</code> and <code>TGT_ML_CoordinatedActivityMedium</code>, which inspect for anomalous behavior that might indicate distributed, coordinated bot activity.</p>
    /// <p>For more information about this choice, see the listing for these rules in the table at <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-bot.html#aws-managed-rule-groups-bot-rules">Bot Control rules listing</a> in the <i>WAF Developer Guide</i>.</p>
    /// <p>Default: <code>TRUE</code></p>
    pub fn set_enable_machine_learning(mut self, input: ::std::option::Option<bool>) -> Self {
        self.enable_machine_learning = input;
        self
    }
    /// <p>Applies only to the targeted inspection level.</p>
    /// <p>Determines whether to use machine learning (ML) to analyze your web traffic for bot-related activity. Machine learning is required for the Bot Control rules <code>TGT_ML_CoordinatedActivityLow</code> and <code>TGT_ML_CoordinatedActivityMedium</code>, which inspect for anomalous behavior that might indicate distributed, coordinated bot activity.</p>
    /// <p>For more information about this choice, see the listing for these rules in the table at <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-bot.html#aws-managed-rule-groups-bot-rules">Bot Control rules listing</a> in the <i>WAF Developer Guide</i>.</p>
    /// <p>Default: <code>TRUE</code></p>
    pub fn get_enable_machine_learning(&self) -> &::std::option::Option<bool> {
        &self.enable_machine_learning
    }
    /// Consumes the builder and constructs a [`AwsManagedRulesBotControlRuleSet`](crate::types::AwsManagedRulesBotControlRuleSet).
    /// This method will fail if any of the following fields are not set:
    /// - [`inspection_level`](crate::types::builders::AwsManagedRulesBotControlRuleSetBuilder::inspection_level)
    pub fn build(self) -> ::std::result::Result<crate::types::AwsManagedRulesBotControlRuleSet, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::AwsManagedRulesBotControlRuleSet {
            inspection_level: self.inspection_level.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "inspection_level",
                    "inspection_level was not specified but it is required when building AwsManagedRulesBotControlRuleSet",
                )
            })?,
            enable_machine_learning: self.enable_machine_learning.unwrap_or(true),
        })
    }
}