aws-sdk-observabilityadmin 1.55.0

AWS SDK for CloudWatch Observability Admin Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A single condition that can match based on WAF rule action or label name.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Condition {
    /// <p>Matches log records based on the WAF rule action taken (ALLOW, BLOCK, COUNT, etc.).</p>
    pub action_condition: ::std::option::Option<crate::types::ActionCondition>,
    /// <p>Matches log records based on WAF rule labels applied to the request.</p>
    pub label_name_condition: ::std::option::Option<crate::types::LabelNameCondition>,
}
impl Condition {
    /// <p>Matches log records based on the WAF rule action taken (ALLOW, BLOCK, COUNT, etc.).</p>
    pub fn action_condition(&self) -> ::std::option::Option<&crate::types::ActionCondition> {
        self.action_condition.as_ref()
    }
    /// <p>Matches log records based on WAF rule labels applied to the request.</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).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
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>Matches log records based on the WAF rule action taken (ALLOW, BLOCK, COUNT, etc.).</p>
    pub fn action_condition(mut self, input: crate::types::ActionCondition) -> Self {
        self.action_condition = ::std::option::Option::Some(input);
        self
    }
    /// <p>Matches log records based on the WAF rule action taken (ALLOW, BLOCK, COUNT, etc.).</p>
    pub fn set_action_condition(mut self, input: ::std::option::Option<crate::types::ActionCondition>) -> Self {
        self.action_condition = input;
        self
    }
    /// <p>Matches log records based on the WAF rule action taken (ALLOW, BLOCK, COUNT, etc.).</p>
    pub fn get_action_condition(&self) -> &::std::option::Option<crate::types::ActionCondition> {
        &self.action_condition
    }
    /// <p>Matches log records based on WAF rule labels applied to the request.</p>
    pub fn label_name_condition(mut self, input: crate::types::LabelNameCondition) -> Self {
        self.label_name_condition = ::std::option::Option::Some(input);
        self
    }
    /// <p>Matches log records based on WAF rule labels applied to the request.</p>
    pub fn set_label_name_condition(mut self, input: ::std::option::Option<crate::types::LabelNameCondition>) -> Self {
        self.label_name_condition = input;
        self
    }
    /// <p>Matches log records based on WAF rule labels applied to the request.</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,
        }
    }
}