{-# 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.AuthenticationResultType where
import Amazonka.CognitoIdentityProvider.Types.NewDeviceMetadataType
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
data AuthenticationResultType = AuthenticationResultType'
{
AuthenticationResultType -> Maybe (Sensitive Text)
accessToken :: Prelude.Maybe (Data.Sensitive Prelude.Text),
AuthenticationResultType -> Maybe Int
expiresIn :: Prelude.Maybe Prelude.Int,
AuthenticationResultType -> Maybe (Sensitive Text)
idToken :: Prelude.Maybe (Data.Sensitive Prelude.Text),
AuthenticationResultType -> Maybe NewDeviceMetadataType
newDeviceMetadata' :: Prelude.Maybe NewDeviceMetadataType,
AuthenticationResultType -> Maybe (Sensitive Text)
refreshToken :: Prelude.Maybe (Data.Sensitive Prelude.Text),
AuthenticationResultType -> Maybe Text
tokenType :: Prelude.Maybe Prelude.Text
}
deriving (AuthenticationResultType -> AuthenticationResultType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthenticationResultType -> AuthenticationResultType -> Bool
$c/= :: AuthenticationResultType -> AuthenticationResultType -> Bool
== :: AuthenticationResultType -> AuthenticationResultType -> Bool
$c== :: AuthenticationResultType -> AuthenticationResultType -> Bool
Prelude.Eq, Int -> AuthenticationResultType -> ShowS
[AuthenticationResultType] -> ShowS
AuthenticationResultType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuthenticationResultType] -> ShowS
$cshowList :: [AuthenticationResultType] -> ShowS
show :: AuthenticationResultType -> String
$cshow :: AuthenticationResultType -> String
showsPrec :: Int -> AuthenticationResultType -> ShowS
$cshowsPrec :: Int -> AuthenticationResultType -> ShowS
Prelude.Show, forall x.
Rep AuthenticationResultType x -> AuthenticationResultType
forall x.
AuthenticationResultType -> Rep AuthenticationResultType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AuthenticationResultType x -> AuthenticationResultType
$cfrom :: forall x.
AuthenticationResultType -> Rep AuthenticationResultType x
Prelude.Generic)
newAuthenticationResultType ::
AuthenticationResultType
newAuthenticationResultType :: AuthenticationResultType
newAuthenticationResultType =
AuthenticationResultType'
{ $sel:accessToken:AuthenticationResultType' :: Maybe (Sensitive Text)
accessToken =
forall a. Maybe a
Prelude.Nothing,
$sel:expiresIn:AuthenticationResultType' :: Maybe Int
expiresIn = forall a. Maybe a
Prelude.Nothing,
$sel:idToken:AuthenticationResultType' :: Maybe (Sensitive Text)
idToken = forall a. Maybe a
Prelude.Nothing,
$sel:newDeviceMetadata':AuthenticationResultType' :: Maybe NewDeviceMetadataType
newDeviceMetadata' = forall a. Maybe a
Prelude.Nothing,
$sel:refreshToken:AuthenticationResultType' :: Maybe (Sensitive Text)
refreshToken = forall a. Maybe a
Prelude.Nothing,
$sel:tokenType:AuthenticationResultType' :: Maybe Text
tokenType = forall a. Maybe a
Prelude.Nothing
}
authenticationResultType_accessToken :: Lens.Lens' AuthenticationResultType (Prelude.Maybe Prelude.Text)
authenticationResultType_accessToken :: Lens' AuthenticationResultType (Maybe Text)
authenticationResultType_accessToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResultType' {Maybe (Sensitive Text)
accessToken :: Maybe (Sensitive Text)
$sel:accessToken:AuthenticationResultType' :: AuthenticationResultType -> Maybe (Sensitive Text)
accessToken} -> Maybe (Sensitive Text)
accessToken) (\s :: AuthenticationResultType
s@AuthenticationResultType' {} Maybe (Sensitive Text)
a -> AuthenticationResultType
s {$sel:accessToken:AuthenticationResultType' :: Maybe (Sensitive Text)
accessToken = Maybe (Sensitive Text)
a} :: AuthenticationResultType) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive
authenticationResultType_expiresIn :: Lens.Lens' AuthenticationResultType (Prelude.Maybe Prelude.Int)
authenticationResultType_expiresIn :: Lens' AuthenticationResultType (Maybe Int)
authenticationResultType_expiresIn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResultType' {Maybe Int
expiresIn :: Maybe Int
$sel:expiresIn:AuthenticationResultType' :: AuthenticationResultType -> Maybe Int
expiresIn} -> Maybe Int
expiresIn) (\s :: AuthenticationResultType
s@AuthenticationResultType' {} Maybe Int
a -> AuthenticationResultType
s {$sel:expiresIn:AuthenticationResultType' :: Maybe Int
expiresIn = Maybe Int
a} :: AuthenticationResultType)
authenticationResultType_idToken :: Lens.Lens' AuthenticationResultType (Prelude.Maybe Prelude.Text)
authenticationResultType_idToken :: Lens' AuthenticationResultType (Maybe Text)
authenticationResultType_idToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResultType' {Maybe (Sensitive Text)
idToken :: Maybe (Sensitive Text)
$sel:idToken:AuthenticationResultType' :: AuthenticationResultType -> Maybe (Sensitive Text)
idToken} -> Maybe (Sensitive Text)
idToken) (\s :: AuthenticationResultType
s@AuthenticationResultType' {} Maybe (Sensitive Text)
a -> AuthenticationResultType
s {$sel:idToken:AuthenticationResultType' :: Maybe (Sensitive Text)
idToken = Maybe (Sensitive Text)
a} :: AuthenticationResultType) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive
authenticationResultType_newDeviceMetadata :: Lens.Lens' AuthenticationResultType (Prelude.Maybe NewDeviceMetadataType)
authenticationResultType_newDeviceMetadata :: Lens' AuthenticationResultType (Maybe NewDeviceMetadataType)
authenticationResultType_newDeviceMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResultType' {Maybe NewDeviceMetadataType
newDeviceMetadata' :: Maybe NewDeviceMetadataType
$sel:newDeviceMetadata':AuthenticationResultType' :: AuthenticationResultType -> Maybe NewDeviceMetadataType
newDeviceMetadata'} -> Maybe NewDeviceMetadataType
newDeviceMetadata') (\s :: AuthenticationResultType
s@AuthenticationResultType' {} Maybe NewDeviceMetadataType
a -> AuthenticationResultType
s {$sel:newDeviceMetadata':AuthenticationResultType' :: Maybe NewDeviceMetadataType
newDeviceMetadata' = Maybe NewDeviceMetadataType
a} :: AuthenticationResultType)
authenticationResultType_refreshToken :: Lens.Lens' AuthenticationResultType (Prelude.Maybe Prelude.Text)
authenticationResultType_refreshToken :: Lens' AuthenticationResultType (Maybe Text)
authenticationResultType_refreshToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResultType' {Maybe (Sensitive Text)
refreshToken :: Maybe (Sensitive Text)
$sel:refreshToken:AuthenticationResultType' :: AuthenticationResultType -> Maybe (Sensitive Text)
refreshToken} -> Maybe (Sensitive Text)
refreshToken) (\s :: AuthenticationResultType
s@AuthenticationResultType' {} Maybe (Sensitive Text)
a -> AuthenticationResultType
s {$sel:refreshToken:AuthenticationResultType' :: Maybe (Sensitive Text)
refreshToken = Maybe (Sensitive Text)
a} :: AuthenticationResultType) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive
authenticationResultType_tokenType :: Lens.Lens' AuthenticationResultType (Prelude.Maybe Prelude.Text)
authenticationResultType_tokenType :: Lens' AuthenticationResultType (Maybe Text)
authenticationResultType_tokenType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResultType' {Maybe Text
tokenType :: Maybe Text
$sel:tokenType:AuthenticationResultType' :: AuthenticationResultType -> Maybe Text
tokenType} -> Maybe Text
tokenType) (\s :: AuthenticationResultType
s@AuthenticationResultType' {} Maybe Text
a -> AuthenticationResultType
s {$sel:tokenType:AuthenticationResultType' :: Maybe Text
tokenType = Maybe Text
a} :: AuthenticationResultType)
instance Data.FromJSON AuthenticationResultType where
parseJSON :: Value -> Parser AuthenticationResultType
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AuthenticationResultType"
( \Object
x ->
Maybe (Sensitive Text)
-> Maybe Int
-> Maybe (Sensitive Text)
-> Maybe NewDeviceMetadataType
-> Maybe (Sensitive Text)
-> Maybe Text
-> AuthenticationResultType
AuthenticationResultType'
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
"AccessToken")
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
"ExpiresIn")
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
"IdToken")
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
"NewDeviceMetadata")
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
"RefreshToken")
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
"TokenType")
)
instance Prelude.Hashable AuthenticationResultType where
hashWithSalt :: Int -> AuthenticationResultType -> Int
hashWithSalt Int
_salt AuthenticationResultType' {Maybe Int
Maybe Text
Maybe (Sensitive Text)
Maybe NewDeviceMetadataType
tokenType :: Maybe Text
refreshToken :: Maybe (Sensitive Text)
newDeviceMetadata' :: Maybe NewDeviceMetadataType
idToken :: Maybe (Sensitive Text)
expiresIn :: Maybe Int
accessToken :: Maybe (Sensitive Text)
$sel:tokenType:AuthenticationResultType' :: AuthenticationResultType -> Maybe Text
$sel:refreshToken:AuthenticationResultType' :: AuthenticationResultType -> Maybe (Sensitive Text)
$sel:newDeviceMetadata':AuthenticationResultType' :: AuthenticationResultType -> Maybe NewDeviceMetadataType
$sel:idToken:AuthenticationResultType' :: AuthenticationResultType -> Maybe (Sensitive Text)
$sel:expiresIn:AuthenticationResultType' :: AuthenticationResultType -> Maybe Int
$sel:accessToken:AuthenticationResultType' :: AuthenticationResultType -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
accessToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
expiresIn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
idToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NewDeviceMetadataType
newDeviceMetadata'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
refreshToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tokenType
instance Prelude.NFData AuthenticationResultType where
rnf :: AuthenticationResultType -> ()
rnf AuthenticationResultType' {Maybe Int
Maybe Text
Maybe (Sensitive Text)
Maybe NewDeviceMetadataType
tokenType :: Maybe Text
refreshToken :: Maybe (Sensitive Text)
newDeviceMetadata' :: Maybe NewDeviceMetadataType
idToken :: Maybe (Sensitive Text)
expiresIn :: Maybe Int
accessToken :: Maybe (Sensitive Text)
$sel:tokenType:AuthenticationResultType' :: AuthenticationResultType -> Maybe Text
$sel:refreshToken:AuthenticationResultType' :: AuthenticationResultType -> Maybe (Sensitive Text)
$sel:newDeviceMetadata':AuthenticationResultType' :: AuthenticationResultType -> Maybe NewDeviceMetadataType
$sel:idToken:AuthenticationResultType' :: AuthenticationResultType -> Maybe (Sensitive Text)
$sel:expiresIn:AuthenticationResultType' :: AuthenticationResultType -> Maybe Int
$sel:accessToken:AuthenticationResultType' :: AuthenticationResultType -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
accessToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
expiresIn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
idToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NewDeviceMetadataType
newDeviceMetadata'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
refreshToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tokenType