{-# 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.WAFRegional.Types.RegexPatternSetUpdate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WAFRegional.Types.ChangeAction
data RegexPatternSetUpdate = RegexPatternSetUpdate'
{
RegexPatternSetUpdate -> ChangeAction
action :: ChangeAction,
RegexPatternSetUpdate -> Text
regexPatternString :: Prelude.Text
}
deriving (RegexPatternSetUpdate -> RegexPatternSetUpdate -> Bool
(RegexPatternSetUpdate -> RegexPatternSetUpdate -> Bool)
-> (RegexPatternSetUpdate -> RegexPatternSetUpdate -> Bool)
-> Eq RegexPatternSetUpdate
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]
(Int -> ReadS RegexPatternSetUpdate)
-> ReadS [RegexPatternSetUpdate]
-> ReadPrec RegexPatternSetUpdate
-> ReadPrec [RegexPatternSetUpdate]
-> Read 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
(Int -> RegexPatternSetUpdate -> ShowS)
-> (RegexPatternSetUpdate -> String)
-> ([RegexPatternSetUpdate] -> ShowS)
-> Show RegexPatternSetUpdate
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. RegexPatternSetUpdate -> Rep RegexPatternSetUpdate x)
-> (forall x. Rep RegexPatternSetUpdate x -> RegexPatternSetUpdate)
-> Generic RegexPatternSetUpdate
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' :: ChangeAction -> Text -> RegexPatternSetUpdate
RegexPatternSetUpdate'
{ $sel:action:RegexPatternSetUpdate' :: ChangeAction
action = ChangeAction
pAction_,
$sel:regexPatternString:RegexPatternSetUpdate' :: Text
regexPatternString = Text
pRegexPatternString_
}
regexPatternSetUpdate_action :: Lens.Lens' RegexPatternSetUpdate ChangeAction
regexPatternSetUpdate_action :: (ChangeAction -> f ChangeAction)
-> RegexPatternSetUpdate -> f RegexPatternSetUpdate
regexPatternSetUpdate_action = (RegexPatternSetUpdate -> ChangeAction)
-> (RegexPatternSetUpdate -> ChangeAction -> RegexPatternSetUpdate)
-> Lens
RegexPatternSetUpdate
RegexPatternSetUpdate
ChangeAction
ChangeAction
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 :: (Text -> f Text)
-> RegexPatternSetUpdate -> f RegexPatternSetUpdate
regexPatternSetUpdate_regexPatternString = (RegexPatternSetUpdate -> Text)
-> (RegexPatternSetUpdate -> Text -> RegexPatternSetUpdate)
-> Lens RegexPatternSetUpdate RegexPatternSetUpdate Text Text
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
instance Prelude.NFData RegexPatternSetUpdate
instance Core.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
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
"RegexPatternString" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
regexPatternString)
]
)