{-# 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.WAFV2.Types.AllowAction 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.WAFV2.Types.CustomRequestHandling
data AllowAction = AllowAction'
{
AllowAction -> Maybe CustomRequestHandling
customRequestHandling :: Prelude.Maybe CustomRequestHandling
}
deriving (AllowAction -> AllowAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AllowAction -> AllowAction -> Bool
$c/= :: AllowAction -> AllowAction -> Bool
== :: AllowAction -> AllowAction -> Bool
$c== :: AllowAction -> AllowAction -> Bool
Prelude.Eq, ReadPrec [AllowAction]
ReadPrec AllowAction
Int -> ReadS AllowAction
ReadS [AllowAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AllowAction]
$creadListPrec :: ReadPrec [AllowAction]
readPrec :: ReadPrec AllowAction
$creadPrec :: ReadPrec AllowAction
readList :: ReadS [AllowAction]
$creadList :: ReadS [AllowAction]
readsPrec :: Int -> ReadS AllowAction
$creadsPrec :: Int -> ReadS AllowAction
Prelude.Read, Int -> AllowAction -> ShowS
[AllowAction] -> ShowS
AllowAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AllowAction] -> ShowS
$cshowList :: [AllowAction] -> ShowS
show :: AllowAction -> String
$cshow :: AllowAction -> String
showsPrec :: Int -> AllowAction -> ShowS
$cshowsPrec :: Int -> AllowAction -> ShowS
Prelude.Show, forall x. Rep AllowAction x -> AllowAction
forall x. AllowAction -> Rep AllowAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AllowAction x -> AllowAction
$cfrom :: forall x. AllowAction -> Rep AllowAction x
Prelude.Generic)
newAllowAction ::
AllowAction
newAllowAction :: AllowAction
newAllowAction =
AllowAction'
{ $sel:customRequestHandling:AllowAction' :: Maybe CustomRequestHandling
customRequestHandling =
forall a. Maybe a
Prelude.Nothing
}
allowAction_customRequestHandling :: Lens.Lens' AllowAction (Prelude.Maybe CustomRequestHandling)
allowAction_customRequestHandling :: Lens' AllowAction (Maybe CustomRequestHandling)
allowAction_customRequestHandling = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AllowAction' {Maybe CustomRequestHandling
customRequestHandling :: Maybe CustomRequestHandling
$sel:customRequestHandling:AllowAction' :: AllowAction -> Maybe CustomRequestHandling
customRequestHandling} -> Maybe CustomRequestHandling
customRequestHandling) (\s :: AllowAction
s@AllowAction' {} Maybe CustomRequestHandling
a -> AllowAction
s {$sel:customRequestHandling:AllowAction' :: Maybe CustomRequestHandling
customRequestHandling = Maybe CustomRequestHandling
a} :: AllowAction)
instance Data.FromJSON AllowAction where
parseJSON :: Value -> Parser AllowAction
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AllowAction"
( \Object
x ->
Maybe CustomRequestHandling -> AllowAction
AllowAction'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CustomRequestHandling")
)
instance Prelude.Hashable AllowAction where
hashWithSalt :: Int -> AllowAction -> Int
hashWithSalt Int
_salt AllowAction' {Maybe CustomRequestHandling
customRequestHandling :: Maybe CustomRequestHandling
$sel:customRequestHandling:AllowAction' :: AllowAction -> Maybe CustomRequestHandling
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CustomRequestHandling
customRequestHandling
instance Prelude.NFData AllowAction where
rnf :: AllowAction -> ()
rnf AllowAction' {Maybe CustomRequestHandling
customRequestHandling :: Maybe CustomRequestHandling
$sel:customRequestHandling:AllowAction' :: AllowAction -> Maybe CustomRequestHandling
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomRequestHandling
customRequestHandling
instance Data.ToJSON AllowAction where
toJSON :: AllowAction -> Value
toJSON AllowAction' {Maybe CustomRequestHandling
customRequestHandling :: Maybe CustomRequestHandling
$sel:customRequestHandling:AllowAction' :: AllowAction -> Maybe CustomRequestHandling
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CustomRequestHandling" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CustomRequestHandling
customRequestHandling
]
)