{-# 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.ChallengeResponse 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.FailureReason
data ChallengeResponse = ChallengeResponse'
{
ChallengeResponse -> Maybe FailureReason
failureReason :: Prelude.Maybe FailureReason,
ChallengeResponse -> Maybe Int
responseCode :: Prelude.Maybe Prelude.Int,
ChallengeResponse -> Maybe Integer
solveTimestamp :: Prelude.Maybe Prelude.Integer
}
deriving (ChallengeResponse -> ChallengeResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChallengeResponse -> ChallengeResponse -> Bool
$c/= :: ChallengeResponse -> ChallengeResponse -> Bool
== :: ChallengeResponse -> ChallengeResponse -> Bool
$c== :: ChallengeResponse -> ChallengeResponse -> Bool
Prelude.Eq, ReadPrec [ChallengeResponse]
ReadPrec ChallengeResponse
Int -> ReadS ChallengeResponse
ReadS [ChallengeResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChallengeResponse]
$creadListPrec :: ReadPrec [ChallengeResponse]
readPrec :: ReadPrec ChallengeResponse
$creadPrec :: ReadPrec ChallengeResponse
readList :: ReadS [ChallengeResponse]
$creadList :: ReadS [ChallengeResponse]
readsPrec :: Int -> ReadS ChallengeResponse
$creadsPrec :: Int -> ReadS ChallengeResponse
Prelude.Read, Int -> ChallengeResponse -> ShowS
[ChallengeResponse] -> ShowS
ChallengeResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChallengeResponse] -> ShowS
$cshowList :: [ChallengeResponse] -> ShowS
show :: ChallengeResponse -> String
$cshow :: ChallengeResponse -> String
showsPrec :: Int -> ChallengeResponse -> ShowS
$cshowsPrec :: Int -> ChallengeResponse -> ShowS
Prelude.Show, forall x. Rep ChallengeResponse x -> ChallengeResponse
forall x. ChallengeResponse -> Rep ChallengeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChallengeResponse x -> ChallengeResponse
$cfrom :: forall x. ChallengeResponse -> Rep ChallengeResponse x
Prelude.Generic)
newChallengeResponse ::
ChallengeResponse
newChallengeResponse :: ChallengeResponse
newChallengeResponse =
ChallengeResponse'
{ $sel:failureReason:ChallengeResponse' :: Maybe FailureReason
failureReason = forall a. Maybe a
Prelude.Nothing,
$sel:responseCode:ChallengeResponse' :: Maybe Int
responseCode = forall a. Maybe a
Prelude.Nothing,
$sel:solveTimestamp:ChallengeResponse' :: Maybe Integer
solveTimestamp = forall a. Maybe a
Prelude.Nothing
}
challengeResponse_failureReason :: Lens.Lens' ChallengeResponse (Prelude.Maybe FailureReason)
challengeResponse_failureReason :: Lens' ChallengeResponse (Maybe FailureReason)
challengeResponse_failureReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChallengeResponse' {Maybe FailureReason
failureReason :: Maybe FailureReason
$sel:failureReason:ChallengeResponse' :: ChallengeResponse -> Maybe FailureReason
failureReason} -> Maybe FailureReason
failureReason) (\s :: ChallengeResponse
s@ChallengeResponse' {} Maybe FailureReason
a -> ChallengeResponse
s {$sel:failureReason:ChallengeResponse' :: Maybe FailureReason
failureReason = Maybe FailureReason
a} :: ChallengeResponse)
challengeResponse_responseCode :: Lens.Lens' ChallengeResponse (Prelude.Maybe Prelude.Int)
challengeResponse_responseCode :: Lens' ChallengeResponse (Maybe Int)
challengeResponse_responseCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChallengeResponse' {Maybe Int
responseCode :: Maybe Int
$sel:responseCode:ChallengeResponse' :: ChallengeResponse -> Maybe Int
responseCode} -> Maybe Int
responseCode) (\s :: ChallengeResponse
s@ChallengeResponse' {} Maybe Int
a -> ChallengeResponse
s {$sel:responseCode:ChallengeResponse' :: Maybe Int
responseCode = Maybe Int
a} :: ChallengeResponse)
challengeResponse_solveTimestamp :: Lens.Lens' ChallengeResponse (Prelude.Maybe Prelude.Integer)
challengeResponse_solveTimestamp :: Lens' ChallengeResponse (Maybe Integer)
challengeResponse_solveTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChallengeResponse' {Maybe Integer
solveTimestamp :: Maybe Integer
$sel:solveTimestamp:ChallengeResponse' :: ChallengeResponse -> Maybe Integer
solveTimestamp} -> Maybe Integer
solveTimestamp) (\s :: ChallengeResponse
s@ChallengeResponse' {} Maybe Integer
a -> ChallengeResponse
s {$sel:solveTimestamp:ChallengeResponse' :: Maybe Integer
solveTimestamp = Maybe Integer
a} :: ChallengeResponse)
instance Data.FromJSON ChallengeResponse where
parseJSON :: Value -> Parser ChallengeResponse
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ChallengeResponse"
( \Object
x ->
Maybe FailureReason
-> Maybe Int -> Maybe Integer -> ChallengeResponse
ChallengeResponse'
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
"FailureReason")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ResponseCode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SolveTimestamp")
)
instance Prelude.Hashable ChallengeResponse where
hashWithSalt :: Int -> ChallengeResponse -> Int
hashWithSalt Int
_salt ChallengeResponse' {Maybe Int
Maybe Integer
Maybe FailureReason
solveTimestamp :: Maybe Integer
responseCode :: Maybe Int
failureReason :: Maybe FailureReason
$sel:solveTimestamp:ChallengeResponse' :: ChallengeResponse -> Maybe Integer
$sel:responseCode:ChallengeResponse' :: ChallengeResponse -> Maybe Int
$sel:failureReason:ChallengeResponse' :: ChallengeResponse -> Maybe FailureReason
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FailureReason
failureReason
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
responseCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
solveTimestamp
instance Prelude.NFData ChallengeResponse where
rnf :: ChallengeResponse -> ()
rnf ChallengeResponse' {Maybe Int
Maybe Integer
Maybe FailureReason
solveTimestamp :: Maybe Integer
responseCode :: Maybe Int
failureReason :: Maybe FailureReason
$sel:solveTimestamp:ChallengeResponse' :: ChallengeResponse -> Maybe Integer
$sel:responseCode:ChallengeResponse' :: ChallengeResponse -> Maybe Int
$sel:failureReason:ChallengeResponse' :: ChallengeResponse -> Maybe FailureReason
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe FailureReason
failureReason
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
responseCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
solveTimestamp