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