aws-sdk-securityhub 1.110.0

AWS SDK for AWS SecurityHub
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateAutomationRuleInput {
    /// <p>User-defined tags associated with an automation rule.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>Whether the rule is active after it is created. If this parameter is equal to <code>ENABLED</code>, Security Hub CSPM starts applying the rule to findings and finding updates after the rule is created. To change the value of this parameter after creating a rule, use <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/API_BatchUpdateAutomationRules.html"> <code>BatchUpdateAutomationRules</code> </a>.</p>
    pub rule_status: ::std::option::Option<crate::types::RuleStatus>,
    /// <p>An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to findings. Security Hub CSPM applies rules with lower values for this parameter first.</p>
    pub rule_order: ::std::option::Option<i32>,
    /// <p>The name of the rule.</p>
    pub rule_name: ::std::option::Option<::std::string::String>,
    /// <p>A description of the rule.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>Specifies whether a rule is the last to be applied with respect to a finding that matches the rule criteria. This is useful when a finding matches the criteria for multiple rules, and each rule has different actions. If a rule is terminal, Security Hub CSPM applies the rule action to a finding that matches the rule criteria and doesn't evaluate other rules for the finding. By default, a rule isn't terminal.</p>
    pub is_terminal: ::std::option::Option<bool>,
    /// <p>A set of ASFF finding field attributes and corresponding expected values that Security Hub CSPM uses to filter findings. If a rule is enabled and a finding matches the conditions specified in this parameter, Security Hub CSPM applies the rule action to the finding.</p>
    pub criteria: ::std::option::Option<crate::types::AutomationRulesFindingFilters>,
    /// <p>One or more actions to update finding fields if a finding matches the conditions specified in <code>Criteria</code>.</p>
    pub actions: ::std::option::Option<::std::vec::Vec<crate::types::AutomationRulesAction>>,
}
impl CreateAutomationRuleInput {
    /// <p>User-defined tags associated with an automation rule.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// <p>Whether the rule is active after it is created. If this parameter is equal to <code>ENABLED</code>, Security Hub CSPM starts applying the rule to findings and finding updates after the rule is created. To change the value of this parameter after creating a rule, use <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/API_BatchUpdateAutomationRules.html"> <code>BatchUpdateAutomationRules</code> </a>.</p>
    pub fn rule_status(&self) -> ::std::option::Option<&crate::types::RuleStatus> {
        self.rule_status.as_ref()
    }
    /// <p>An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to findings. Security Hub CSPM applies rules with lower values for this parameter first.</p>
    pub fn rule_order(&self) -> ::std::option::Option<i32> {
        self.rule_order
    }
    /// <p>The name of the rule.</p>
    pub fn rule_name(&self) -> ::std::option::Option<&str> {
        self.rule_name.as_deref()
    }
    /// <p>A description of the rule.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>Specifies whether a rule is the last to be applied with respect to a finding that matches the rule criteria. This is useful when a finding matches the criteria for multiple rules, and each rule has different actions. If a rule is terminal, Security Hub CSPM applies the rule action to a finding that matches the rule criteria and doesn't evaluate other rules for the finding. By default, a rule isn't terminal.</p>
    pub fn is_terminal(&self) -> ::std::option::Option<bool> {
        self.is_terminal
    }
    /// <p>A set of ASFF finding field attributes and corresponding expected values that Security Hub CSPM uses to filter findings. If a rule is enabled and a finding matches the conditions specified in this parameter, Security Hub CSPM applies the rule action to the finding.</p>
    pub fn criteria(&self) -> ::std::option::Option<&crate::types::AutomationRulesFindingFilters> {
        self.criteria.as_ref()
    }
    /// <p>One or more actions to update finding fields if a finding matches the conditions specified in <code>Criteria</code>.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.actions.is_none()`.
    pub fn actions(&self) -> &[crate::types::AutomationRulesAction] {
        self.actions.as_deref().unwrap_or_default()
    }
}
impl CreateAutomationRuleInput {
    /// Creates a new builder-style object to manufacture [`CreateAutomationRuleInput`](crate::operation::create_automation_rule::CreateAutomationRuleInput).
    pub fn builder() -> crate::operation::create_automation_rule::builders::CreateAutomationRuleInputBuilder {
        crate::operation::create_automation_rule::builders::CreateAutomationRuleInputBuilder::default()
    }
}

/// A builder for [`CreateAutomationRuleInput`](crate::operation::create_automation_rule::CreateAutomationRuleInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateAutomationRuleInputBuilder {
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) rule_status: ::std::option::Option<crate::types::RuleStatus>,
    pub(crate) rule_order: ::std::option::Option<i32>,
    pub(crate) rule_name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) is_terminal: ::std::option::Option<bool>,
    pub(crate) criteria: ::std::option::Option<crate::types::AutomationRulesFindingFilters>,
    pub(crate) actions: ::std::option::Option<::std::vec::Vec<crate::types::AutomationRulesAction>>,
}
impl CreateAutomationRuleInputBuilder {
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>User-defined tags associated with an automation rule.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>User-defined tags associated with an automation rule.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>User-defined tags associated with an automation rule.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// <p>Whether the rule is active after it is created. If this parameter is equal to <code>ENABLED</code>, Security Hub CSPM starts applying the rule to findings and finding updates after the rule is created. To change the value of this parameter after creating a rule, use <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/API_BatchUpdateAutomationRules.html"> <code>BatchUpdateAutomationRules</code> </a>.</p>
    pub fn rule_status(mut self, input: crate::types::RuleStatus) -> Self {
        self.rule_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>Whether the rule is active after it is created. If this parameter is equal to <code>ENABLED</code>, Security Hub CSPM starts applying the rule to findings and finding updates after the rule is created. To change the value of this parameter after creating a rule, use <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/API_BatchUpdateAutomationRules.html"> <code>BatchUpdateAutomationRules</code> </a>.</p>
    pub fn set_rule_status(mut self, input: ::std::option::Option<crate::types::RuleStatus>) -> Self {
        self.rule_status = input;
        self
    }
    /// <p>Whether the rule is active after it is created. If this parameter is equal to <code>ENABLED</code>, Security Hub CSPM starts applying the rule to findings and finding updates after the rule is created. To change the value of this parameter after creating a rule, use <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/API_BatchUpdateAutomationRules.html"> <code>BatchUpdateAutomationRules</code> </a>.</p>
    pub fn get_rule_status(&self) -> &::std::option::Option<crate::types::RuleStatus> {
        &self.rule_status
    }
    /// <p>An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to findings. Security Hub CSPM applies rules with lower values for this parameter first.</p>
    /// This field is required.
    pub fn rule_order(mut self, input: i32) -> Self {
        self.rule_order = ::std::option::Option::Some(input);
        self
    }
    /// <p>An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to findings. Security Hub CSPM applies rules with lower values for this parameter first.</p>
    pub fn set_rule_order(mut self, input: ::std::option::Option<i32>) -> Self {
        self.rule_order = input;
        self
    }
    /// <p>An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to findings. Security Hub CSPM applies rules with lower values for this parameter first.</p>
    pub fn get_rule_order(&self) -> &::std::option::Option<i32> {
        &self.rule_order
    }
    /// <p>The name of the rule.</p>
    /// This field is required.
    pub fn rule_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.rule_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the rule.</p>
    pub fn set_rule_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.rule_name = input;
        self
    }
    /// <p>The name of the rule.</p>
    pub fn get_rule_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.rule_name
    }
    /// <p>A description of the rule.</p>
    /// This field is required.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the rule.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the rule.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>Specifies whether a rule is the last to be applied with respect to a finding that matches the rule criteria. This is useful when a finding matches the criteria for multiple rules, and each rule has different actions. If a rule is terminal, Security Hub CSPM applies the rule action to a finding that matches the rule criteria and doesn't evaluate other rules for the finding. By default, a rule isn't terminal.</p>
    pub fn is_terminal(mut self, input: bool) -> Self {
        self.is_terminal = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether a rule is the last to be applied with respect to a finding that matches the rule criteria. This is useful when a finding matches the criteria for multiple rules, and each rule has different actions. If a rule is terminal, Security Hub CSPM applies the rule action to a finding that matches the rule criteria and doesn't evaluate other rules for the finding. By default, a rule isn't terminal.</p>
    pub fn set_is_terminal(mut self, input: ::std::option::Option<bool>) -> Self {
        self.is_terminal = input;
        self
    }
    /// <p>Specifies whether a rule is the last to be applied with respect to a finding that matches the rule criteria. This is useful when a finding matches the criteria for multiple rules, and each rule has different actions. If a rule is terminal, Security Hub CSPM applies the rule action to a finding that matches the rule criteria and doesn't evaluate other rules for the finding. By default, a rule isn't terminal.</p>
    pub fn get_is_terminal(&self) -> &::std::option::Option<bool> {
        &self.is_terminal
    }
    /// <p>A set of ASFF finding field attributes and corresponding expected values that Security Hub CSPM uses to filter findings. If a rule is enabled and a finding matches the conditions specified in this parameter, Security Hub CSPM applies the rule action to the finding.</p>
    /// This field is required.
    pub fn criteria(mut self, input: crate::types::AutomationRulesFindingFilters) -> Self {
        self.criteria = ::std::option::Option::Some(input);
        self
    }
    /// <p>A set of ASFF finding field attributes and corresponding expected values that Security Hub CSPM uses to filter findings. If a rule is enabled and a finding matches the conditions specified in this parameter, Security Hub CSPM applies the rule action to the finding.</p>
    pub fn set_criteria(mut self, input: ::std::option::Option<crate::types::AutomationRulesFindingFilters>) -> Self {
        self.criteria = input;
        self
    }
    /// <p>A set of ASFF finding field attributes and corresponding expected values that Security Hub CSPM uses to filter findings. If a rule is enabled and a finding matches the conditions specified in this parameter, Security Hub CSPM applies the rule action to the finding.</p>
    pub fn get_criteria(&self) -> &::std::option::Option<crate::types::AutomationRulesFindingFilters> {
        &self.criteria
    }
    /// Appends an item to `actions`.
    ///
    /// To override the contents of this collection use [`set_actions`](Self::set_actions).
    ///
    /// <p>One or more actions to update finding fields if a finding matches the conditions specified in <code>Criteria</code>.</p>
    pub fn actions(mut self, input: crate::types::AutomationRulesAction) -> Self {
        let mut v = self.actions.unwrap_or_default();
        v.push(input);
        self.actions = ::std::option::Option::Some(v);
        self
    }
    /// <p>One or more actions to update finding fields if a finding matches the conditions specified in <code>Criteria</code>.</p>
    pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AutomationRulesAction>>) -> Self {
        self.actions = input;
        self
    }
    /// <p>One or more actions to update finding fields if a finding matches the conditions specified in <code>Criteria</code>.</p>
    pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AutomationRulesAction>> {
        &self.actions
    }
    /// Consumes the builder and constructs a [`CreateAutomationRuleInput`](crate::operation::create_automation_rule::CreateAutomationRuleInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_automation_rule::CreateAutomationRuleInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_automation_rule::CreateAutomationRuleInput {
            tags: self.tags,
            rule_status: self.rule_status,
            rule_order: self.rule_order,
            rule_name: self.rule_name,
            description: self.description,
            is_terminal: self.is_terminal,
            criteria: self.criteria,
            actions: self.actions,
        })
    }
}