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

/// <p>A single match condition for a <code>Filter</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Condition {
    /// <p>A single action condition. This is the action setting that a log record must contain in order to meet the condition.</p>
    pub action_condition: ::std::option::Option<crate::types::ActionCondition>,
    /// <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>
    pub label_name_condition: ::std::option::Option<crate::types::LabelNameCondition>,
}
impl Condition {
    /// <p>A single action condition. This is the action setting that a log record must contain in order to meet the condition.</p>
    pub fn action_condition(&self) -> ::std::option::Option<&crate::types::ActionCondition> {
        self.action_condition.as_ref()
    }
    /// <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>
    pub fn label_name_condition(&self) -> ::std::option::Option<&crate::types::LabelNameCondition> {
        self.label_name_condition.as_ref()
    }
}
impl Condition {
    /// Creates a new builder-style object to manufacture [`Condition`](crate::types::Condition).
    pub fn builder() -> crate::types::builders::ConditionBuilder {
        crate::types::builders::ConditionBuilder::default()
    }
}

/// A builder for [`Condition`](crate::types::Condition).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ConditionBuilder {
    pub(crate) action_condition: ::std::option::Option<crate::types::ActionCondition>,
    pub(crate) label_name_condition: ::std::option::Option<crate::types::LabelNameCondition>,
}
impl ConditionBuilder {
    /// <p>A single action condition. This is the action setting that a log record must contain in order to meet the condition.</p>
    pub fn action_condition(mut self, input: crate::types::ActionCondition) -> Self {
        self.action_condition = ::std::option::Option::Some(input);
        self
    }
    /// <p>A single action condition. This is the action setting that a log record must contain in order to meet the condition.</p>
    pub fn set_action_condition(mut self, input: ::std::option::Option<crate::types::ActionCondition>) -> Self {
        self.action_condition = input;
        self
    }
    /// <p>A single action condition. This is the action setting that a log record must contain in order to meet the condition.</p>
    pub fn get_action_condition(&self) -> &::std::option::Option<crate::types::ActionCondition> {
        &self.action_condition
    }
    /// <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>
    pub fn label_name_condition(mut self, input: crate::types::LabelNameCondition) -> Self {
        self.label_name_condition = ::std::option::Option::Some(input);
        self
    }
    /// <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>
    pub fn set_label_name_condition(mut self, input: ::std::option::Option<crate::types::LabelNameCondition>) -> Self {
        self.label_name_condition = input;
        self
    }
    /// <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>
    pub fn get_label_name_condition(&self) -> &::std::option::Option<crate::types::LabelNameCondition> {
        &self.label_name_condition
    }
    /// Consumes the builder and constructs a [`Condition`](crate::types::Condition).
    pub fn build(self) -> crate::types::Condition {
        crate::types::Condition {
            action_condition: self.action_condition,
            label_name_condition: self.label_name_condition,
        }
    }
}