{-# 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.WebACLUpdate 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 WebACLUpdate = WebACLUpdate'
{
WebACLUpdate -> ChangeAction
action :: ChangeAction,
WebACLUpdate -> ActivatedRule
activatedRule :: ActivatedRule
}
deriving (WebACLUpdate -> WebACLUpdate -> Bool
(WebACLUpdate -> WebACLUpdate -> Bool)
-> (WebACLUpdate -> WebACLUpdate -> Bool) -> Eq WebACLUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WebACLUpdate -> WebACLUpdate -> Bool
$c/= :: WebACLUpdate -> WebACLUpdate -> Bool
== :: WebACLUpdate -> WebACLUpdate -> Bool
$c== :: WebACLUpdate -> WebACLUpdate -> Bool
Prelude.Eq, ReadPrec [WebACLUpdate]
ReadPrec WebACLUpdate
Int -> ReadS WebACLUpdate
ReadS [WebACLUpdate]
(Int -> ReadS WebACLUpdate)
-> ReadS [WebACLUpdate]
-> ReadPrec WebACLUpdate
-> ReadPrec [WebACLUpdate]
-> Read WebACLUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WebACLUpdate]
$creadListPrec :: ReadPrec [WebACLUpdate]
readPrec :: ReadPrec WebACLUpdate
$creadPrec :: ReadPrec WebACLUpdate
readList :: ReadS [WebACLUpdate]
$creadList :: ReadS [WebACLUpdate]
readsPrec :: Int -> ReadS WebACLUpdate
$creadsPrec :: Int -> ReadS WebACLUpdate
Prelude.Read, Int -> WebACLUpdate -> ShowS
[WebACLUpdate] -> ShowS
WebACLUpdate -> String
(Int -> WebACLUpdate -> ShowS)
-> (WebACLUpdate -> String)
-> ([WebACLUpdate] -> ShowS)
-> Show WebACLUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WebACLUpdate] -> ShowS
$cshowList :: [WebACLUpdate] -> ShowS
show :: WebACLUpdate -> String
$cshow :: WebACLUpdate -> String
showsPrec :: Int -> WebACLUpdate -> ShowS
$cshowsPrec :: Int -> WebACLUpdate -> ShowS
Prelude.Show, (forall x. WebACLUpdate -> Rep WebACLUpdate x)
-> (forall x. Rep WebACLUpdate x -> WebACLUpdate)
-> Generic WebACLUpdate
forall x. Rep WebACLUpdate x -> WebACLUpdate
forall x. WebACLUpdate -> Rep WebACLUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WebACLUpdate x -> WebACLUpdate
$cfrom :: forall x. WebACLUpdate -> Rep WebACLUpdate x
Prelude.Generic)
newWebACLUpdate ::
ChangeAction ->
ActivatedRule ->
WebACLUpdate
newWebACLUpdate :: ChangeAction -> ActivatedRule -> WebACLUpdate
newWebACLUpdate ChangeAction
pAction_ ActivatedRule
pActivatedRule_ =
WebACLUpdate' :: ChangeAction -> ActivatedRule -> WebACLUpdate
WebACLUpdate'
{ $sel:action:WebACLUpdate' :: ChangeAction
action = ChangeAction
pAction_,
$sel:activatedRule:WebACLUpdate' :: ActivatedRule
activatedRule = ActivatedRule
pActivatedRule_
}
webACLUpdate_action :: Lens.Lens' WebACLUpdate ChangeAction
webACLUpdate_action :: (ChangeAction -> f ChangeAction) -> WebACLUpdate -> f WebACLUpdate
webACLUpdate_action = (WebACLUpdate -> ChangeAction)
-> (WebACLUpdate -> ChangeAction -> WebACLUpdate)
-> Lens WebACLUpdate WebACLUpdate ChangeAction ChangeAction
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebACLUpdate' {ChangeAction
action :: ChangeAction
$sel:action:WebACLUpdate' :: WebACLUpdate -> ChangeAction
action} -> ChangeAction
action) (\s :: WebACLUpdate
s@WebACLUpdate' {} ChangeAction
a -> WebACLUpdate
s {$sel:action:WebACLUpdate' :: ChangeAction
action = ChangeAction
a} :: WebACLUpdate)
webACLUpdate_activatedRule :: Lens.Lens' WebACLUpdate ActivatedRule
webACLUpdate_activatedRule :: (ActivatedRule -> f ActivatedRule)
-> WebACLUpdate -> f WebACLUpdate
webACLUpdate_activatedRule = (WebACLUpdate -> ActivatedRule)
-> (WebACLUpdate -> ActivatedRule -> WebACLUpdate)
-> Lens WebACLUpdate WebACLUpdate ActivatedRule ActivatedRule
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebACLUpdate' {ActivatedRule
activatedRule :: ActivatedRule
$sel:activatedRule:WebACLUpdate' :: WebACLUpdate -> ActivatedRule
activatedRule} -> ActivatedRule
activatedRule) (\s :: WebACLUpdate
s@WebACLUpdate' {} ActivatedRule
a -> WebACLUpdate
s {$sel:activatedRule:WebACLUpdate' :: ActivatedRule
activatedRule = ActivatedRule
a} :: WebACLUpdate)
instance Prelude.Hashable WebACLUpdate
instance Prelude.NFData WebACLUpdate
instance Core.ToJSON WebACLUpdate where
toJSON :: WebACLUpdate -> Value
toJSON WebACLUpdate' {ChangeAction
ActivatedRule
activatedRule :: ActivatedRule
action :: ChangeAction
$sel:activatedRule:WebACLUpdate' :: WebACLUpdate -> ActivatedRule
$sel:action:WebACLUpdate' :: WebACLUpdate -> 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)
]
)