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