{-# 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.CognitoIdentityProvider.Types.ChallengeResponseType where
import Amazonka.CognitoIdentityProvider.Types.ChallengeName
import Amazonka.CognitoIdentityProvider.Types.ChallengeResponse
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ChallengeResponseType = ChallengeResponseType'
{
ChallengeResponseType -> Maybe ChallengeName
challengeName :: Prelude.Maybe ChallengeName,
ChallengeResponseType -> Maybe ChallengeResponse
challengeResponse :: Prelude.Maybe ChallengeResponse
}
deriving (ChallengeResponseType -> ChallengeResponseType -> Bool
(ChallengeResponseType -> ChallengeResponseType -> Bool)
-> (ChallengeResponseType -> ChallengeResponseType -> Bool)
-> Eq ChallengeResponseType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChallengeResponseType -> ChallengeResponseType -> Bool
$c/= :: ChallengeResponseType -> ChallengeResponseType -> Bool
== :: ChallengeResponseType -> ChallengeResponseType -> Bool
$c== :: ChallengeResponseType -> ChallengeResponseType -> Bool
Prelude.Eq, ReadPrec [ChallengeResponseType]
ReadPrec ChallengeResponseType
Int -> ReadS ChallengeResponseType
ReadS [ChallengeResponseType]
(Int -> ReadS ChallengeResponseType)
-> ReadS [ChallengeResponseType]
-> ReadPrec ChallengeResponseType
-> ReadPrec [ChallengeResponseType]
-> Read ChallengeResponseType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChallengeResponseType]
$creadListPrec :: ReadPrec [ChallengeResponseType]
readPrec :: ReadPrec ChallengeResponseType
$creadPrec :: ReadPrec ChallengeResponseType
readList :: ReadS [ChallengeResponseType]
$creadList :: ReadS [ChallengeResponseType]
readsPrec :: Int -> ReadS ChallengeResponseType
$creadsPrec :: Int -> ReadS ChallengeResponseType
Prelude.Read, Int -> ChallengeResponseType -> ShowS
[ChallengeResponseType] -> ShowS
ChallengeResponseType -> String
(Int -> ChallengeResponseType -> ShowS)
-> (ChallengeResponseType -> String)
-> ([ChallengeResponseType] -> ShowS)
-> Show ChallengeResponseType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChallengeResponseType] -> ShowS
$cshowList :: [ChallengeResponseType] -> ShowS
show :: ChallengeResponseType -> String
$cshow :: ChallengeResponseType -> String
showsPrec :: Int -> ChallengeResponseType -> ShowS
$cshowsPrec :: Int -> ChallengeResponseType -> ShowS
Prelude.Show, (forall x. ChallengeResponseType -> Rep ChallengeResponseType x)
-> (forall x. Rep ChallengeResponseType x -> ChallengeResponseType)
-> Generic ChallengeResponseType
forall x. Rep ChallengeResponseType x -> ChallengeResponseType
forall x. ChallengeResponseType -> Rep ChallengeResponseType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChallengeResponseType x -> ChallengeResponseType
$cfrom :: forall x. ChallengeResponseType -> Rep ChallengeResponseType x
Prelude.Generic)
newChallengeResponseType ::
ChallengeResponseType
newChallengeResponseType :: ChallengeResponseType
newChallengeResponseType =
ChallengeResponseType' :: Maybe ChallengeName
-> Maybe ChallengeResponse -> ChallengeResponseType
ChallengeResponseType'
{ $sel:challengeName:ChallengeResponseType' :: Maybe ChallengeName
challengeName =
Maybe ChallengeName
forall a. Maybe a
Prelude.Nothing,
$sel:challengeResponse:ChallengeResponseType' :: Maybe ChallengeResponse
challengeResponse = Maybe ChallengeResponse
forall a. Maybe a
Prelude.Nothing
}
challengeResponseType_challengeName :: Lens.Lens' ChallengeResponseType (Prelude.Maybe ChallengeName)
challengeResponseType_challengeName :: (Maybe ChallengeName -> f (Maybe ChallengeName))
-> ChallengeResponseType -> f ChallengeResponseType
challengeResponseType_challengeName = (ChallengeResponseType -> Maybe ChallengeName)
-> (ChallengeResponseType
-> Maybe ChallengeName -> ChallengeResponseType)
-> Lens
ChallengeResponseType
ChallengeResponseType
(Maybe ChallengeName)
(Maybe ChallengeName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChallengeResponseType' {Maybe ChallengeName
challengeName :: Maybe ChallengeName
$sel:challengeName:ChallengeResponseType' :: ChallengeResponseType -> Maybe ChallengeName
challengeName} -> Maybe ChallengeName
challengeName) (\s :: ChallengeResponseType
s@ChallengeResponseType' {} Maybe ChallengeName
a -> ChallengeResponseType
s {$sel:challengeName:ChallengeResponseType' :: Maybe ChallengeName
challengeName = Maybe ChallengeName
a} :: ChallengeResponseType)
challengeResponseType_challengeResponse :: Lens.Lens' ChallengeResponseType (Prelude.Maybe ChallengeResponse)
challengeResponseType_challengeResponse :: (Maybe ChallengeResponse -> f (Maybe ChallengeResponse))
-> ChallengeResponseType -> f ChallengeResponseType
challengeResponseType_challengeResponse = (ChallengeResponseType -> Maybe ChallengeResponse)
-> (ChallengeResponseType
-> Maybe ChallengeResponse -> ChallengeResponseType)
-> Lens
ChallengeResponseType
ChallengeResponseType
(Maybe ChallengeResponse)
(Maybe ChallengeResponse)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChallengeResponseType' {Maybe ChallengeResponse
challengeResponse :: Maybe ChallengeResponse
$sel:challengeResponse:ChallengeResponseType' :: ChallengeResponseType -> Maybe ChallengeResponse
challengeResponse} -> Maybe ChallengeResponse
challengeResponse) (\s :: ChallengeResponseType
s@ChallengeResponseType' {} Maybe ChallengeResponse
a -> ChallengeResponseType
s {$sel:challengeResponse:ChallengeResponseType' :: Maybe ChallengeResponse
challengeResponse = Maybe ChallengeResponse
a} :: ChallengeResponseType)
instance Core.FromJSON ChallengeResponseType where
parseJSON :: Value -> Parser ChallengeResponseType
parseJSON =
String
-> (Object -> Parser ChallengeResponseType)
-> Value
-> Parser ChallengeResponseType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ChallengeResponseType"
( \Object
x ->
Maybe ChallengeName
-> Maybe ChallengeResponse -> ChallengeResponseType
ChallengeResponseType'
(Maybe ChallengeName
-> Maybe ChallengeResponse -> ChallengeResponseType)
-> Parser (Maybe ChallengeName)
-> Parser (Maybe ChallengeResponse -> ChallengeResponseType)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ChallengeName)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ChallengeName")
Parser (Maybe ChallengeResponse -> ChallengeResponseType)
-> Parser (Maybe ChallengeResponse) -> Parser ChallengeResponseType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ChallengeResponse)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ChallengeResponse")
)
instance Prelude.Hashable ChallengeResponseType
instance Prelude.NFData ChallengeResponseType