{-# 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.RegexPatternSetUpdate 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.ChangeAction
data RegexPatternSetUpdate = RegexPatternSetUpdate'
{
RegexPatternSetUpdate -> ChangeAction
action :: ChangeAction,
RegexPatternSetUpdate -> Text
regexPatternString :: Prelude.Text
}
deriving (RegexPatternSetUpdate -> RegexPatternSetUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegexPatternSetUpdate -> RegexPatternSetUpdate -> Bool
$c/= :: RegexPatternSetUpdate -> RegexPatternSetUpdate -> Bool
== :: RegexPatternSetUpdate -> RegexPatternSetUpdate -> Bool
$c== :: RegexPatternSetUpdate -> RegexPatternSetUpdate -> Bool
Prelude.Eq, ReadPrec [RegexPatternSetUpdate]
ReadPrec RegexPatternSetUpdate
Int -> ReadS RegexPatternSetUpdate
ReadS [RegexPatternSetUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegexPatternSetUpdate]
$creadListPrec :: ReadPrec [RegexPatternSetUpdate]
readPrec :: ReadPrec RegexPatternSetUpdate
$creadPrec :: ReadPrec RegexPatternSetUpdate
readList :: ReadS [RegexPatternSetUpdate]
$creadList :: ReadS [RegexPatternSetUpdate]
readsPrec :: Int -> ReadS RegexPatternSetUpdate
$creadsPrec :: Int -> ReadS RegexPatternSetUpdate
Prelude.Read, Int -> RegexPatternSetUpdate -> ShowS
[RegexPatternSetUpdate] -> ShowS
RegexPatternSetUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegexPatternSetUpdate] -> ShowS
$cshowList :: [RegexPatternSetUpdate] -> ShowS
show :: RegexPatternSetUpdate -> String
$cshow :: RegexPatternSetUpdate -> String
showsPrec :: Int -> RegexPatternSetUpdate -> ShowS
$cshowsPrec :: Int -> RegexPatternSetUpdate -> ShowS
Prelude.Show, forall x. Rep RegexPatternSetUpdate x -> RegexPatternSetUpdate
forall x. RegexPatternSetUpdate -> Rep RegexPatternSetUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegexPatternSetUpdate x -> RegexPatternSetUpdate
$cfrom :: forall x. RegexPatternSetUpdate -> Rep RegexPatternSetUpdate x
Prelude.Generic)
newRegexPatternSetUpdate ::
ChangeAction ->
Prelude.Text ->
RegexPatternSetUpdate
newRegexPatternSetUpdate :: ChangeAction -> Text -> RegexPatternSetUpdate
newRegexPatternSetUpdate
ChangeAction
pAction_
Text
pRegexPatternString_ =
RegexPatternSetUpdate'
{ $sel:action:RegexPatternSetUpdate' :: ChangeAction
action = ChangeAction
pAction_,
$sel:regexPatternString:RegexPatternSetUpdate' :: Text
regexPatternString = Text
pRegexPatternString_
}
regexPatternSetUpdate_action :: Lens.Lens' RegexPatternSetUpdate ChangeAction
regexPatternSetUpdate_action :: Lens' RegexPatternSetUpdate ChangeAction
regexPatternSetUpdate_action = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexPatternSetUpdate' {ChangeAction
action :: ChangeAction
$sel:action:RegexPatternSetUpdate' :: RegexPatternSetUpdate -> ChangeAction
action} -> ChangeAction
action) (\s :: RegexPatternSetUpdate
s@RegexPatternSetUpdate' {} ChangeAction
a -> RegexPatternSetUpdate
s {$sel:action:RegexPatternSetUpdate' :: ChangeAction
action = ChangeAction
a} :: RegexPatternSetUpdate)
regexPatternSetUpdate_regexPatternString :: Lens.Lens' RegexPatternSetUpdate Prelude.Text
regexPatternSetUpdate_regexPatternString :: Lens' RegexPatternSetUpdate Text
regexPatternSetUpdate_regexPatternString = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexPatternSetUpdate' {Text
regexPatternString :: Text
$sel:regexPatternString:RegexPatternSetUpdate' :: RegexPatternSetUpdate -> Text
regexPatternString} -> Text
regexPatternString) (\s :: RegexPatternSetUpdate
s@RegexPatternSetUpdate' {} Text
a -> RegexPatternSetUpdate
s {$sel:regexPatternString:RegexPatternSetUpdate' :: Text
regexPatternString = Text
a} :: RegexPatternSetUpdate)
instance Prelude.Hashable RegexPatternSetUpdate where
hashWithSalt :: Int -> RegexPatternSetUpdate -> Int
hashWithSalt Int
_salt RegexPatternSetUpdate' {Text
ChangeAction
regexPatternString :: Text
action :: ChangeAction
$sel:regexPatternString:RegexPatternSetUpdate' :: RegexPatternSetUpdate -> Text
$sel:action:RegexPatternSetUpdate' :: RegexPatternSetUpdate -> ChangeAction
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ChangeAction
action
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
regexPatternString
instance Prelude.NFData RegexPatternSetUpdate where
rnf :: RegexPatternSetUpdate -> ()
rnf RegexPatternSetUpdate' {Text
ChangeAction
regexPatternString :: Text
action :: ChangeAction
$sel:regexPatternString:RegexPatternSetUpdate' :: RegexPatternSetUpdate -> Text
$sel:action:RegexPatternSetUpdate' :: RegexPatternSetUpdate -> 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 Text
regexPatternString
instance Data.ToJSON RegexPatternSetUpdate where
toJSON :: RegexPatternSetUpdate -> Value
toJSON RegexPatternSetUpdate' {Text
ChangeAction
regexPatternString :: Text
action :: ChangeAction
$sel:regexPatternString:RegexPatternSetUpdate' :: RegexPatternSetUpdate -> Text
$sel:action:RegexPatternSetUpdate' :: RegexPatternSetUpdate -> 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
"RegexPatternString" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
regexPatternString)
]
)