{-# 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.ByteMatchSetUpdate 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.WAF.Types.ByteMatchTuple
import Amazonka.WAF.Types.ChangeAction
data ByteMatchSetUpdate = ByteMatchSetUpdate'
{
ByteMatchSetUpdate -> ChangeAction
action :: ChangeAction,
ByteMatchSetUpdate -> ByteMatchTuple
byteMatchTuple :: ByteMatchTuple
}
deriving (ByteMatchSetUpdate -> ByteMatchSetUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ByteMatchSetUpdate -> ByteMatchSetUpdate -> Bool
$c/= :: ByteMatchSetUpdate -> ByteMatchSetUpdate -> Bool
== :: ByteMatchSetUpdate -> ByteMatchSetUpdate -> Bool
$c== :: ByteMatchSetUpdate -> ByteMatchSetUpdate -> Bool
Prelude.Eq, ReadPrec [ByteMatchSetUpdate]
ReadPrec ByteMatchSetUpdate
Int -> ReadS ByteMatchSetUpdate
ReadS [ByteMatchSetUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ByteMatchSetUpdate]
$creadListPrec :: ReadPrec [ByteMatchSetUpdate]
readPrec :: ReadPrec ByteMatchSetUpdate
$creadPrec :: ReadPrec ByteMatchSetUpdate
readList :: ReadS [ByteMatchSetUpdate]
$creadList :: ReadS [ByteMatchSetUpdate]
readsPrec :: Int -> ReadS ByteMatchSetUpdate
$creadsPrec :: Int -> ReadS ByteMatchSetUpdate
Prelude.Read, Int -> ByteMatchSetUpdate -> ShowS
[ByteMatchSetUpdate] -> ShowS
ByteMatchSetUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ByteMatchSetUpdate] -> ShowS
$cshowList :: [ByteMatchSetUpdate] -> ShowS
show :: ByteMatchSetUpdate -> String
$cshow :: ByteMatchSetUpdate -> String
showsPrec :: Int -> ByteMatchSetUpdate -> ShowS
$cshowsPrec :: Int -> ByteMatchSetUpdate -> ShowS
Prelude.Show, forall x. Rep ByteMatchSetUpdate x -> ByteMatchSetUpdate
forall x. ByteMatchSetUpdate -> Rep ByteMatchSetUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ByteMatchSetUpdate x -> ByteMatchSetUpdate
$cfrom :: forall x. ByteMatchSetUpdate -> Rep ByteMatchSetUpdate x
Prelude.Generic)
newByteMatchSetUpdate ::
ChangeAction ->
ByteMatchTuple ->
ByteMatchSetUpdate
newByteMatchSetUpdate :: ChangeAction -> ByteMatchTuple -> ByteMatchSetUpdate
newByteMatchSetUpdate ChangeAction
pAction_ ByteMatchTuple
pByteMatchTuple_ =
ByteMatchSetUpdate'
{ $sel:action:ByteMatchSetUpdate' :: ChangeAction
action = ChangeAction
pAction_,
$sel:byteMatchTuple:ByteMatchSetUpdate' :: ByteMatchTuple
byteMatchTuple = ByteMatchTuple
pByteMatchTuple_
}
byteMatchSetUpdate_action :: Lens.Lens' ByteMatchSetUpdate ChangeAction
byteMatchSetUpdate_action :: Lens' ByteMatchSetUpdate ChangeAction
byteMatchSetUpdate_action = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ByteMatchSetUpdate' {ChangeAction
action :: ChangeAction
$sel:action:ByteMatchSetUpdate' :: ByteMatchSetUpdate -> ChangeAction
action} -> ChangeAction
action) (\s :: ByteMatchSetUpdate
s@ByteMatchSetUpdate' {} ChangeAction
a -> ByteMatchSetUpdate
s {$sel:action:ByteMatchSetUpdate' :: ChangeAction
action = ChangeAction
a} :: ByteMatchSetUpdate)
byteMatchSetUpdate_byteMatchTuple :: Lens.Lens' ByteMatchSetUpdate ByteMatchTuple
byteMatchSetUpdate_byteMatchTuple :: Lens' ByteMatchSetUpdate ByteMatchTuple
byteMatchSetUpdate_byteMatchTuple = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ByteMatchSetUpdate' {ByteMatchTuple
byteMatchTuple :: ByteMatchTuple
$sel:byteMatchTuple:ByteMatchSetUpdate' :: ByteMatchSetUpdate -> ByteMatchTuple
byteMatchTuple} -> ByteMatchTuple
byteMatchTuple) (\s :: ByteMatchSetUpdate
s@ByteMatchSetUpdate' {} ByteMatchTuple
a -> ByteMatchSetUpdate
s {$sel:byteMatchTuple:ByteMatchSetUpdate' :: ByteMatchTuple
byteMatchTuple = ByteMatchTuple
a} :: ByteMatchSetUpdate)
instance Prelude.Hashable ByteMatchSetUpdate where
hashWithSalt :: Int -> ByteMatchSetUpdate -> Int
hashWithSalt Int
_salt ByteMatchSetUpdate' {ChangeAction
ByteMatchTuple
byteMatchTuple :: ByteMatchTuple
action :: ChangeAction
$sel:byteMatchTuple:ByteMatchSetUpdate' :: ByteMatchSetUpdate -> ByteMatchTuple
$sel:action:ByteMatchSetUpdate' :: ByteMatchSetUpdate -> ChangeAction
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ChangeAction
action
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ByteMatchTuple
byteMatchTuple
instance Prelude.NFData ByteMatchSetUpdate where
rnf :: ByteMatchSetUpdate -> ()
rnf ByteMatchSetUpdate' {ChangeAction
ByteMatchTuple
byteMatchTuple :: ByteMatchTuple
action :: ChangeAction
$sel:byteMatchTuple:ByteMatchSetUpdate' :: ByteMatchSetUpdate -> ByteMatchTuple
$sel:action:ByteMatchSetUpdate' :: ByteMatchSetUpdate -> ChangeAction
..} =
forall a. NFData a => a -> ()
Prelude.rnf ChangeAction
action
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ByteMatchTuple
byteMatchTuple
instance Data.ToJSON ByteMatchSetUpdate where
toJSON :: ByteMatchSetUpdate -> Value
toJSON ByteMatchSetUpdate' {ChangeAction
ByteMatchTuple
byteMatchTuple :: ByteMatchTuple
action :: ChangeAction
$sel:byteMatchTuple:ByteMatchSetUpdate' :: ByteMatchSetUpdate -> ByteMatchTuple
$sel:action:ByteMatchSetUpdate' :: ByteMatchSetUpdate -> ChangeAction
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Action" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ChangeAction
action),
forall a. a -> Maybe a
Prelude.Just
(Key
"ByteMatchTuple" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ByteMatchTuple
byteMatchTuple)
]
)