{-# 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 #-}
module Amazonka.WAF.Types.RuleGroupUpdate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WAF.Types.ActivatedRule
import Amazonka.WAF.Types.ChangeAction
data RuleGroupUpdate = RuleGroupUpdate'
{
RuleGroupUpdate -> ChangeAction
action :: ChangeAction,
RuleGroupUpdate -> ActivatedRule
activatedRule :: ActivatedRule
}
deriving (RuleGroupUpdate -> RuleGroupUpdate -> Bool
(RuleGroupUpdate -> RuleGroupUpdate -> Bool)
-> (RuleGroupUpdate -> RuleGroupUpdate -> Bool)
-> Eq RuleGroupUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RuleGroupUpdate -> RuleGroupUpdate -> Bool
$c/= :: RuleGroupUpdate -> RuleGroupUpdate -> Bool
== :: RuleGroupUpdate -> RuleGroupUpdate -> Bool
$c== :: RuleGroupUpdate -> RuleGroupUpdate -> Bool
Prelude.Eq, ReadPrec [RuleGroupUpdate]
ReadPrec RuleGroupUpdate
Int -> ReadS RuleGroupUpdate
ReadS [RuleGroupUpdate]
(Int -> ReadS RuleGroupUpdate)
-> ReadS [RuleGroupUpdate]
-> ReadPrec RuleGroupUpdate
-> ReadPrec [RuleGroupUpdate]
-> Read RuleGroupUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RuleGroupUpdate]
$creadListPrec :: ReadPrec [RuleGroupUpdate]
readPrec :: ReadPrec RuleGroupUpdate
$creadPrec :: ReadPrec RuleGroupUpdate
readList :: ReadS [RuleGroupUpdate]
$creadList :: ReadS [RuleGroupUpdate]
readsPrec :: Int -> ReadS RuleGroupUpdate
$creadsPrec :: Int -> ReadS RuleGroupUpdate
Prelude.Read, Int -> RuleGroupUpdate -> ShowS
[RuleGroupUpdate] -> ShowS
RuleGroupUpdate -> String
(Int -> RuleGroupUpdate -> ShowS)
-> (RuleGroupUpdate -> String)
-> ([RuleGroupUpdate] -> ShowS)
-> Show RuleGroupUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RuleGroupUpdate] -> ShowS
$cshowList :: [RuleGroupUpdate] -> ShowS
show :: RuleGroupUpdate -> String
$cshow :: RuleGroupUpdate -> String
showsPrec :: Int -> RuleGroupUpdate -> ShowS
$cshowsPrec :: Int -> RuleGroupUpdate -> ShowS
Prelude.Show, (forall x. RuleGroupUpdate -> Rep RuleGroupUpdate x)
-> (forall x. Rep RuleGroupUpdate x -> RuleGroupUpdate)
-> Generic RuleGroupUpdate
forall x. Rep RuleGroupUpdate x -> RuleGroupUpdate
forall x. RuleGroupUpdate -> Rep RuleGroupUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RuleGroupUpdate x -> RuleGroupUpdate
$cfrom :: forall x. RuleGroupUpdate -> Rep RuleGroupUpdate x
Prelude.Generic)
newRuleGroupUpdate ::
ChangeAction ->
ActivatedRule ->
RuleGroupUpdate
newRuleGroupUpdate :: ChangeAction -> ActivatedRule -> RuleGroupUpdate
newRuleGroupUpdate ChangeAction
pAction_ ActivatedRule
pActivatedRule_ =
RuleGroupUpdate' :: ChangeAction -> ActivatedRule -> RuleGroupUpdate
RuleGroupUpdate'
{ $sel:action:RuleGroupUpdate' :: ChangeAction
action = ChangeAction
pAction_,
$sel:activatedRule:RuleGroupUpdate' :: ActivatedRule
activatedRule = ActivatedRule
pActivatedRule_
}
ruleGroupUpdate_action :: Lens.Lens' RuleGroupUpdate ChangeAction
ruleGroupUpdate_action :: (ChangeAction -> f ChangeAction)
-> RuleGroupUpdate -> f RuleGroupUpdate
ruleGroupUpdate_action = (RuleGroupUpdate -> ChangeAction)
-> (RuleGroupUpdate -> ChangeAction -> RuleGroupUpdate)
-> Lens RuleGroupUpdate RuleGroupUpdate ChangeAction ChangeAction
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupUpdate' {ChangeAction
action :: ChangeAction
$sel:action:RuleGroupUpdate' :: RuleGroupUpdate -> ChangeAction
action} -> ChangeAction
action) (\s :: RuleGroupUpdate
s@RuleGroupUpdate' {} ChangeAction
a -> RuleGroupUpdate
s {$sel:action:RuleGroupUpdate' :: ChangeAction
action = ChangeAction
a} :: RuleGroupUpdate)
ruleGroupUpdate_activatedRule :: Lens.Lens' RuleGroupUpdate ActivatedRule
ruleGroupUpdate_activatedRule :: (ActivatedRule -> f ActivatedRule)
-> RuleGroupUpdate -> f RuleGroupUpdate
ruleGroupUpdate_activatedRule = (RuleGroupUpdate -> ActivatedRule)
-> (RuleGroupUpdate -> ActivatedRule -> RuleGroupUpdate)
-> Lens RuleGroupUpdate RuleGroupUpdate ActivatedRule ActivatedRule
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupUpdate' {ActivatedRule
activatedRule :: ActivatedRule
$sel:activatedRule:RuleGroupUpdate' :: RuleGroupUpdate -> ActivatedRule
activatedRule} -> ActivatedRule
activatedRule) (\s :: RuleGroupUpdate
s@RuleGroupUpdate' {} ActivatedRule
a -> RuleGroupUpdate
s {$sel:activatedRule:RuleGroupUpdate' :: ActivatedRule
activatedRule = ActivatedRule
a} :: RuleGroupUpdate)
instance Prelude.Hashable RuleGroupUpdate
instance Prelude.NFData RuleGroupUpdate
instance Core.ToJSON RuleGroupUpdate where
toJSON :: RuleGroupUpdate -> Value
toJSON RuleGroupUpdate' {ChangeAction
ActivatedRule
activatedRule :: ActivatedRule
action :: ChangeAction
$sel:activatedRule:RuleGroupUpdate' :: RuleGroupUpdate -> ActivatedRule
$sel:action:RuleGroupUpdate' :: RuleGroupUpdate -> ChangeAction
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Action" Text -> ChangeAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ChangeAction
action),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ActivatedRule" Text -> ActivatedRule -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ActivatedRule
activatedRule)
]
)