{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.WAFV2.Types.ManagedRuleGroupStatement
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.WAFV2.Types.ManagedRuleGroupStatement where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.WAFV2.Types.ExcludedRule
import Amazonka.WAFV2.Types.ManagedRuleGroupConfig
import Amazonka.WAFV2.Types.RuleActionOverride
import {-# SOURCE #-} Amazonka.WAFV2.Types.Statement

-- | A rule statement used to run the rules that are defined in a managed
-- rule group. To use this, provide the vendor name and the name of the
-- rule group in this statement. You can retrieve the required names by
-- calling ListAvailableManagedRuleGroups.
--
-- You cannot nest a @ManagedRuleGroupStatement@, for example for use
-- inside a @NotStatement@ or @OrStatement@. It can only be referenced as a
-- top-level statement within a rule.
--
-- You are charged additional fees when you use the WAF Bot Control managed
-- rule group @AWSManagedRulesBotControlRuleSet@ or the WAF Fraud Control
-- account takeover prevention (ATP) managed rule group
-- @AWSManagedRulesATPRuleSet@. For more information, see
-- <http://aws.amazon.com/waf/pricing/ WAF Pricing>.
--
-- /See:/ 'newManagedRuleGroupStatement' smart constructor.
data ManagedRuleGroupStatement = ManagedRuleGroupStatement'
  { -- | Rules in the referenced rule group whose actions are set to @Count@.
    --
    -- Instead of this option, use @RuleActionOverrides@. It accepts any valid
    -- action setting, including @Count@.
    ManagedRuleGroupStatement -> Maybe [ExcludedRule]
excludedRules :: Prelude.Maybe [ExcludedRule],
    -- | Additional information that\'s used by a managed rule group. Many
    -- managed rule groups don\'t require this.
    --
    -- Use the @AWSManagedRulesBotControlRuleSet@ configuration object to
    -- configure the protection level that you want the Bot Control rule group
    -- to use.
    ManagedRuleGroupStatement
-> Maybe (NonEmpty ManagedRuleGroupConfig)
managedRuleGroupConfigs :: Prelude.Maybe (Prelude.NonEmpty ManagedRuleGroupConfig),
    -- | Action settings to use in the place of the rule actions that are
    -- configured inside the rule group. You specify one override for each rule
    -- whose action you want to change.
    --
    -- You can use overrides for testing, for example you can override all of
    -- rule actions to @Count@ and then monitor the resulting count metrics to
    -- understand how the rule group would handle your web traffic. You can
    -- also permanently override some or all actions, to modify how the rule
    -- group manages your web traffic.
    ManagedRuleGroupStatement -> Maybe (NonEmpty RuleActionOverride)
ruleActionOverrides :: Prelude.Maybe (Prelude.NonEmpty RuleActionOverride),
    -- | An optional nested statement that narrows the scope of the web requests
    -- that are evaluated by the managed rule group. Requests are only
    -- evaluated by the rule group if they match the scope-down statement. You
    -- can use any nestable Statement in the scope-down statement, and you can
    -- nest statements at any level, the same as you can for a rule statement.
    ManagedRuleGroupStatement -> Maybe Statement
scopeDownStatement :: Prelude.Maybe Statement,
    -- | The version of the managed rule group to use. If you specify this, the
    -- version setting is fixed until you change it. If you don\'t specify
    -- this, WAF uses the vendor\'s default version, and then keeps the version
    -- at the vendor\'s default when the vendor updates the managed rule group
    -- settings.
    ManagedRuleGroupStatement -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The name of the managed rule group vendor. You use this, along with the
    -- rule group name, to identify the rule group.
    ManagedRuleGroupStatement -> Text
vendorName :: Prelude.Text,
    -- | The name of the managed rule group. You use this, along with the vendor
    -- name, to identify the rule group.
    ManagedRuleGroupStatement -> Text
name :: Prelude.Text
  }
  deriving (ManagedRuleGroupStatement -> ManagedRuleGroupStatement -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ManagedRuleGroupStatement -> ManagedRuleGroupStatement -> Bool
$c/= :: ManagedRuleGroupStatement -> ManagedRuleGroupStatement -> Bool
== :: ManagedRuleGroupStatement -> ManagedRuleGroupStatement -> Bool
$c== :: ManagedRuleGroupStatement -> ManagedRuleGroupStatement -> Bool
Prelude.Eq, ReadPrec [ManagedRuleGroupStatement]
ReadPrec ManagedRuleGroupStatement
Int -> ReadS ManagedRuleGroupStatement
ReadS [ManagedRuleGroupStatement]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ManagedRuleGroupStatement]
$creadListPrec :: ReadPrec [ManagedRuleGroupStatement]
readPrec :: ReadPrec ManagedRuleGroupStatement
$creadPrec :: ReadPrec ManagedRuleGroupStatement
readList :: ReadS [ManagedRuleGroupStatement]
$creadList :: ReadS [ManagedRuleGroupStatement]
readsPrec :: Int -> ReadS ManagedRuleGroupStatement
$creadsPrec :: Int -> ReadS ManagedRuleGroupStatement
Prelude.Read, Int -> ManagedRuleGroupStatement -> ShowS
[ManagedRuleGroupStatement] -> ShowS
ManagedRuleGroupStatement -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ManagedRuleGroupStatement] -> ShowS
$cshowList :: [ManagedRuleGroupStatement] -> ShowS
show :: ManagedRuleGroupStatement -> String
$cshow :: ManagedRuleGroupStatement -> String
showsPrec :: Int -> ManagedRuleGroupStatement -> ShowS
$cshowsPrec :: Int -> ManagedRuleGroupStatement -> ShowS
Prelude.Show, forall x.
Rep ManagedRuleGroupStatement x -> ManagedRuleGroupStatement
forall x.
ManagedRuleGroupStatement -> Rep ManagedRuleGroupStatement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ManagedRuleGroupStatement x -> ManagedRuleGroupStatement
$cfrom :: forall x.
ManagedRuleGroupStatement -> Rep ManagedRuleGroupStatement x
Prelude.Generic)

-- |
-- Create a value of 'ManagedRuleGroupStatement' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'excludedRules', 'managedRuleGroupStatement_excludedRules' - Rules in the referenced rule group whose actions are set to @Count@.
--
-- Instead of this option, use @RuleActionOverrides@. It accepts any valid
-- action setting, including @Count@.
--
-- 'managedRuleGroupConfigs', 'managedRuleGroupStatement_managedRuleGroupConfigs' - Additional information that\'s used by a managed rule group. Many
-- managed rule groups don\'t require this.
--
-- Use the @AWSManagedRulesBotControlRuleSet@ configuration object to
-- configure the protection level that you want the Bot Control rule group
-- to use.
--
-- 'ruleActionOverrides', 'managedRuleGroupStatement_ruleActionOverrides' - Action settings to use in the place of the rule actions that are
-- configured inside the rule group. You specify one override for each rule
-- whose action you want to change.
--
-- You can use overrides for testing, for example you can override all of
-- rule actions to @Count@ and then monitor the resulting count metrics to
-- understand how the rule group would handle your web traffic. You can
-- also permanently override some or all actions, to modify how the rule
-- group manages your web traffic.
--
-- 'scopeDownStatement', 'managedRuleGroupStatement_scopeDownStatement' - An optional nested statement that narrows the scope of the web requests
-- that are evaluated by the managed rule group. Requests are only
-- evaluated by the rule group if they match the scope-down statement. You
-- can use any nestable Statement in the scope-down statement, and you can
-- nest statements at any level, the same as you can for a rule statement.
--
-- 'version', 'managedRuleGroupStatement_version' - The version of the managed rule group to use. If you specify this, the
-- version setting is fixed until you change it. If you don\'t specify
-- this, WAF uses the vendor\'s default version, and then keeps the version
-- at the vendor\'s default when the vendor updates the managed rule group
-- settings.
--
-- 'vendorName', 'managedRuleGroupStatement_vendorName' - The name of the managed rule group vendor. You use this, along with the
-- rule group name, to identify the rule group.
--
-- 'name', 'managedRuleGroupStatement_name' - The name of the managed rule group. You use this, along with the vendor
-- name, to identify the rule group.
newManagedRuleGroupStatement ::
  -- | 'vendorName'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  ManagedRuleGroupStatement
newManagedRuleGroupStatement :: Text -> Text -> ManagedRuleGroupStatement
newManagedRuleGroupStatement Text
pVendorName_ Text
pName_ =
  ManagedRuleGroupStatement'
    { $sel:excludedRules:ManagedRuleGroupStatement' :: Maybe [ExcludedRule]
excludedRules =
        forall a. Maybe a
Prelude.Nothing,
      $sel:managedRuleGroupConfigs:ManagedRuleGroupStatement' :: Maybe (NonEmpty ManagedRuleGroupConfig)
managedRuleGroupConfigs = forall a. Maybe a
Prelude.Nothing,
      $sel:ruleActionOverrides:ManagedRuleGroupStatement' :: Maybe (NonEmpty RuleActionOverride)
ruleActionOverrides = forall a. Maybe a
Prelude.Nothing,
      $sel:scopeDownStatement:ManagedRuleGroupStatement' :: Maybe Statement
scopeDownStatement = forall a. Maybe a
Prelude.Nothing,
      $sel:version:ManagedRuleGroupStatement' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
      $sel:vendorName:ManagedRuleGroupStatement' :: Text
vendorName = Text
pVendorName_,
      $sel:name:ManagedRuleGroupStatement' :: Text
name = Text
pName_
    }

-- | Rules in the referenced rule group whose actions are set to @Count@.
--
-- Instead of this option, use @RuleActionOverrides@. It accepts any valid
-- action setting, including @Count@.
managedRuleGroupStatement_excludedRules :: Lens.Lens' ManagedRuleGroupStatement (Prelude.Maybe [ExcludedRule])
managedRuleGroupStatement_excludedRules :: Lens' ManagedRuleGroupStatement (Maybe [ExcludedRule])
managedRuleGroupStatement_excludedRules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleGroupStatement' {Maybe [ExcludedRule]
excludedRules :: Maybe [ExcludedRule]
$sel:excludedRules:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe [ExcludedRule]
excludedRules} -> Maybe [ExcludedRule]
excludedRules) (\s :: ManagedRuleGroupStatement
s@ManagedRuleGroupStatement' {} Maybe [ExcludedRule]
a -> ManagedRuleGroupStatement
s {$sel:excludedRules:ManagedRuleGroupStatement' :: Maybe [ExcludedRule]
excludedRules = Maybe [ExcludedRule]
a} :: ManagedRuleGroupStatement) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Additional information that\'s used by a managed rule group. Many
-- managed rule groups don\'t require this.
--
-- Use the @AWSManagedRulesBotControlRuleSet@ configuration object to
-- configure the protection level that you want the Bot Control rule group
-- to use.
managedRuleGroupStatement_managedRuleGroupConfigs :: Lens.Lens' ManagedRuleGroupStatement (Prelude.Maybe (Prelude.NonEmpty ManagedRuleGroupConfig))
managedRuleGroupStatement_managedRuleGroupConfigs :: Lens'
  ManagedRuleGroupStatement (Maybe (NonEmpty ManagedRuleGroupConfig))
managedRuleGroupStatement_managedRuleGroupConfigs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleGroupStatement' {Maybe (NonEmpty ManagedRuleGroupConfig)
managedRuleGroupConfigs :: Maybe (NonEmpty ManagedRuleGroupConfig)
$sel:managedRuleGroupConfigs:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement
-> Maybe (NonEmpty ManagedRuleGroupConfig)
managedRuleGroupConfigs} -> Maybe (NonEmpty ManagedRuleGroupConfig)
managedRuleGroupConfigs) (\s :: ManagedRuleGroupStatement
s@ManagedRuleGroupStatement' {} Maybe (NonEmpty ManagedRuleGroupConfig)
a -> ManagedRuleGroupStatement
s {$sel:managedRuleGroupConfigs:ManagedRuleGroupStatement' :: Maybe (NonEmpty ManagedRuleGroupConfig)
managedRuleGroupConfigs = Maybe (NonEmpty ManagedRuleGroupConfig)
a} :: ManagedRuleGroupStatement) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Action settings to use in the place of the rule actions that are
-- configured inside the rule group. You specify one override for each rule
-- whose action you want to change.
--
-- You can use overrides for testing, for example you can override all of
-- rule actions to @Count@ and then monitor the resulting count metrics to
-- understand how the rule group would handle your web traffic. You can
-- also permanently override some or all actions, to modify how the rule
-- group manages your web traffic.
managedRuleGroupStatement_ruleActionOverrides :: Lens.Lens' ManagedRuleGroupStatement (Prelude.Maybe (Prelude.NonEmpty RuleActionOverride))
managedRuleGroupStatement_ruleActionOverrides :: Lens'
  ManagedRuleGroupStatement (Maybe (NonEmpty RuleActionOverride))
managedRuleGroupStatement_ruleActionOverrides = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleGroupStatement' {Maybe (NonEmpty RuleActionOverride)
ruleActionOverrides :: Maybe (NonEmpty RuleActionOverride)
$sel:ruleActionOverrides:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe (NonEmpty RuleActionOverride)
ruleActionOverrides} -> Maybe (NonEmpty RuleActionOverride)
ruleActionOverrides) (\s :: ManagedRuleGroupStatement
s@ManagedRuleGroupStatement' {} Maybe (NonEmpty RuleActionOverride)
a -> ManagedRuleGroupStatement
s {$sel:ruleActionOverrides:ManagedRuleGroupStatement' :: Maybe (NonEmpty RuleActionOverride)
ruleActionOverrides = Maybe (NonEmpty RuleActionOverride)
a} :: ManagedRuleGroupStatement) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional nested statement that narrows the scope of the web requests
-- that are evaluated by the managed rule group. Requests are only
-- evaluated by the rule group if they match the scope-down statement. You
-- can use any nestable Statement in the scope-down statement, and you can
-- nest statements at any level, the same as you can for a rule statement.
managedRuleGroupStatement_scopeDownStatement :: Lens.Lens' ManagedRuleGroupStatement (Prelude.Maybe Statement)
managedRuleGroupStatement_scopeDownStatement :: Lens' ManagedRuleGroupStatement (Maybe Statement)
managedRuleGroupStatement_scopeDownStatement = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleGroupStatement' {Maybe Statement
scopeDownStatement :: Maybe Statement
$sel:scopeDownStatement:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe Statement
scopeDownStatement} -> Maybe Statement
scopeDownStatement) (\s :: ManagedRuleGroupStatement
s@ManagedRuleGroupStatement' {} Maybe Statement
a -> ManagedRuleGroupStatement
s {$sel:scopeDownStatement:ManagedRuleGroupStatement' :: Maybe Statement
scopeDownStatement = Maybe Statement
a} :: ManagedRuleGroupStatement)

-- | The version of the managed rule group to use. If you specify this, the
-- version setting is fixed until you change it. If you don\'t specify
-- this, WAF uses the vendor\'s default version, and then keeps the version
-- at the vendor\'s default when the vendor updates the managed rule group
-- settings.
managedRuleGroupStatement_version :: Lens.Lens' ManagedRuleGroupStatement (Prelude.Maybe Prelude.Text)
managedRuleGroupStatement_version :: Lens' ManagedRuleGroupStatement (Maybe Text)
managedRuleGroupStatement_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleGroupStatement' {Maybe Text
version :: Maybe Text
$sel:version:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe Text
version} -> Maybe Text
version) (\s :: ManagedRuleGroupStatement
s@ManagedRuleGroupStatement' {} Maybe Text
a -> ManagedRuleGroupStatement
s {$sel:version:ManagedRuleGroupStatement' :: Maybe Text
version = Maybe Text
a} :: ManagedRuleGroupStatement)

-- | The name of the managed rule group vendor. You use this, along with the
-- rule group name, to identify the rule group.
managedRuleGroupStatement_vendorName :: Lens.Lens' ManagedRuleGroupStatement Prelude.Text
managedRuleGroupStatement_vendorName :: Lens' ManagedRuleGroupStatement Text
managedRuleGroupStatement_vendorName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleGroupStatement' {Text
vendorName :: Text
$sel:vendorName:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Text
vendorName} -> Text
vendorName) (\s :: ManagedRuleGroupStatement
s@ManagedRuleGroupStatement' {} Text
a -> ManagedRuleGroupStatement
s {$sel:vendorName:ManagedRuleGroupStatement' :: Text
vendorName = Text
a} :: ManagedRuleGroupStatement)

-- | The name of the managed rule group. You use this, along with the vendor
-- name, to identify the rule group.
managedRuleGroupStatement_name :: Lens.Lens' ManagedRuleGroupStatement Prelude.Text
managedRuleGroupStatement_name :: Lens' ManagedRuleGroupStatement Text
managedRuleGroupStatement_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleGroupStatement' {Text
name :: Text
$sel:name:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Text
name} -> Text
name) (\s :: ManagedRuleGroupStatement
s@ManagedRuleGroupStatement' {} Text
a -> ManagedRuleGroupStatement
s {$sel:name:ManagedRuleGroupStatement' :: Text
name = Text
a} :: ManagedRuleGroupStatement)

instance Data.FromJSON ManagedRuleGroupStatement where
  parseJSON :: Value -> Parser ManagedRuleGroupStatement
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ManagedRuleGroupStatement"
      ( \Object
x ->
          Maybe [ExcludedRule]
-> Maybe (NonEmpty ManagedRuleGroupConfig)
-> Maybe (NonEmpty RuleActionOverride)
-> Maybe Statement
-> Maybe Text
-> Text
-> Text
-> ManagedRuleGroupStatement
ManagedRuleGroupStatement'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ExcludedRules" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ManagedRuleGroupConfigs")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RuleActionOverrides")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ScopeDownStatement")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Version")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"VendorName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Name")
      )

instance Prelude.Hashable ManagedRuleGroupStatement where
  hashWithSalt :: Int -> ManagedRuleGroupStatement -> Int
hashWithSalt Int
_salt ManagedRuleGroupStatement' {Maybe [ExcludedRule]
Maybe (NonEmpty RuleActionOverride)
Maybe (NonEmpty ManagedRuleGroupConfig)
Maybe Text
Maybe Statement
Text
name :: Text
vendorName :: Text
version :: Maybe Text
scopeDownStatement :: Maybe Statement
ruleActionOverrides :: Maybe (NonEmpty RuleActionOverride)
managedRuleGroupConfigs :: Maybe (NonEmpty ManagedRuleGroupConfig)
excludedRules :: Maybe [ExcludedRule]
$sel:name:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Text
$sel:vendorName:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Text
$sel:version:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe Text
$sel:scopeDownStatement:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe Statement
$sel:ruleActionOverrides:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe (NonEmpty RuleActionOverride)
$sel:managedRuleGroupConfigs:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement
-> Maybe (NonEmpty ManagedRuleGroupConfig)
$sel:excludedRules:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe [ExcludedRule]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ExcludedRule]
excludedRules
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty ManagedRuleGroupConfig)
managedRuleGroupConfigs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty RuleActionOverride)
ruleActionOverrides
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Statement
scopeDownStatement
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vendorName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData ManagedRuleGroupStatement where
  rnf :: ManagedRuleGroupStatement -> ()
rnf ManagedRuleGroupStatement' {Maybe [ExcludedRule]
Maybe (NonEmpty RuleActionOverride)
Maybe (NonEmpty ManagedRuleGroupConfig)
Maybe Text
Maybe Statement
Text
name :: Text
vendorName :: Text
version :: Maybe Text
scopeDownStatement :: Maybe Statement
ruleActionOverrides :: Maybe (NonEmpty RuleActionOverride)
managedRuleGroupConfigs :: Maybe (NonEmpty ManagedRuleGroupConfig)
excludedRules :: Maybe [ExcludedRule]
$sel:name:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Text
$sel:vendorName:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Text
$sel:version:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe Text
$sel:scopeDownStatement:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe Statement
$sel:ruleActionOverrides:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe (NonEmpty RuleActionOverride)
$sel:managedRuleGroupConfigs:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement
-> Maybe (NonEmpty ManagedRuleGroupConfig)
$sel:excludedRules:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe [ExcludedRule]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ExcludedRule]
excludedRules
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty ManagedRuleGroupConfig)
managedRuleGroupConfigs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty RuleActionOverride)
ruleActionOverrides
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Statement
scopeDownStatement
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vendorName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

instance Data.ToJSON ManagedRuleGroupStatement where
  toJSON :: ManagedRuleGroupStatement -> Value
toJSON ManagedRuleGroupStatement' {Maybe [ExcludedRule]
Maybe (NonEmpty RuleActionOverride)
Maybe (NonEmpty ManagedRuleGroupConfig)
Maybe Text
Maybe Statement
Text
name :: Text
vendorName :: Text
version :: Maybe Text
scopeDownStatement :: Maybe Statement
ruleActionOverrides :: Maybe (NonEmpty RuleActionOverride)
managedRuleGroupConfigs :: Maybe (NonEmpty ManagedRuleGroupConfig)
excludedRules :: Maybe [ExcludedRule]
$sel:name:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Text
$sel:vendorName:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Text
$sel:version:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe Text
$sel:scopeDownStatement:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe Statement
$sel:ruleActionOverrides:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe (NonEmpty RuleActionOverride)
$sel:managedRuleGroupConfigs:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement
-> Maybe (NonEmpty ManagedRuleGroupConfig)
$sel:excludedRules:ManagedRuleGroupStatement' :: ManagedRuleGroupStatement -> Maybe [ExcludedRule]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ExcludedRules" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ExcludedRule]
excludedRules,
            (Key
"ManagedRuleGroupConfigs" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ManagedRuleGroupConfig)
managedRuleGroupConfigs,
            (Key
"RuleActionOverrides" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty RuleActionOverride)
ruleActionOverrides,
            (Key
"ScopeDownStatement" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Statement
scopeDownStatement,
            (Key
"Version" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
version,
            forall a. a -> Maybe a
Prelude.Just (Key
"VendorName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
vendorName),
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )