aws_sdk_wafv2/types/
_condition.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A single match condition for a <code>Filter</code>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Condition {
7    /// <p>A single action condition. This is the action setting that a log record must contain in order to meet the condition.</p>
8    pub action_condition: ::std::option::Option<crate::types::ActionCondition>,
9    /// <p>A single label name condition. This is the fully qualified label name that a log record must contain in order to meet the condition. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the rule group or web ACL context of the rule that added the label.</p>
10    pub label_name_condition: ::std::option::Option<crate::types::LabelNameCondition>,
11}
12impl Condition {
13    /// <p>A single action condition. This is the action setting that a log record must contain in order to meet the condition.</p>
14    pub fn action_condition(&self) -> ::std::option::Option<&crate::types::ActionCondition> {
15        self.action_condition.as_ref()
16    }
17    /// <p>A single label name condition. This is the fully qualified label name that a log record must contain in order to meet the condition. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the rule group or web ACL context of the rule that added the label.</p>
18    pub fn label_name_condition(&self) -> ::std::option::Option<&crate::types::LabelNameCondition> {
19        self.label_name_condition.as_ref()
20    }
21}
22impl Condition {
23    /// Creates a new builder-style object to manufacture [`Condition`](crate::types::Condition).
24    pub fn builder() -> crate::types::builders::ConditionBuilder {
25        crate::types::builders::ConditionBuilder::default()
26    }
27}
28
29/// A builder for [`Condition`](crate::types::Condition).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct ConditionBuilder {
33    pub(crate) action_condition: ::std::option::Option<crate::types::ActionCondition>,
34    pub(crate) label_name_condition: ::std::option::Option<crate::types::LabelNameCondition>,
35}
36impl ConditionBuilder {
37    /// <p>A single action condition. This is the action setting that a log record must contain in order to meet the condition.</p>
38    pub fn action_condition(mut self, input: crate::types::ActionCondition) -> Self {
39        self.action_condition = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>A single action condition. This is the action setting that a log record must contain in order to meet the condition.</p>
43    pub fn set_action_condition(mut self, input: ::std::option::Option<crate::types::ActionCondition>) -> Self {
44        self.action_condition = input;
45        self
46    }
47    /// <p>A single action condition. This is the action setting that a log record must contain in order to meet the condition.</p>
48    pub fn get_action_condition(&self) -> &::std::option::Option<crate::types::ActionCondition> {
49        &self.action_condition
50    }
51    /// <p>A single label name condition. This is the fully qualified label name that a log record must contain in order to meet the condition. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the rule group or web ACL context of the rule that added the label.</p>
52    pub fn label_name_condition(mut self, input: crate::types::LabelNameCondition) -> Self {
53        self.label_name_condition = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>A single label name condition. This is the fully qualified label name that a log record must contain in order to meet the condition. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the rule group or web ACL context of the rule that added the label.</p>
57    pub fn set_label_name_condition(mut self, input: ::std::option::Option<crate::types::LabelNameCondition>) -> Self {
58        self.label_name_condition = input;
59        self
60    }
61    /// <p>A single label name condition. This is the fully qualified label name that a log record must contain in order to meet the condition. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the rule group or web ACL context of the rule that added the label.</p>
62    pub fn get_label_name_condition(&self) -> &::std::option::Option<crate::types::LabelNameCondition> {
63        &self.label_name_condition
64    }
65    /// Consumes the builder and constructs a [`Condition`](crate::types::Condition).
66    pub fn build(self) -> crate::types::Condition {
67        crate::types::Condition {
68            action_condition: self.action_condition,
69            label_name_condition: self.label_name_condition,
70        }
71    }
72}