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