{-# 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.UserType where
import Amazonka.CognitoIdentityProvider.Types.AttributeType
import Amazonka.CognitoIdentityProvider.Types.MFAOptionType
import Amazonka.CognitoIdentityProvider.Types.UserStatusType
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 UserType = UserType'
{
UserType -> Maybe [AttributeType]
attributes :: Prelude.Maybe [AttributeType],
UserType -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
UserType -> Maybe [MFAOptionType]
mfaOptions :: Prelude.Maybe [MFAOptionType],
UserType -> Maybe POSIX
userCreateDate :: Prelude.Maybe Data.POSIX,
UserType -> Maybe POSIX
userLastModifiedDate :: Prelude.Maybe Data.POSIX,
UserType -> Maybe UserStatusType
userStatus :: Prelude.Maybe UserStatusType,
UserType -> Maybe (Sensitive Text)
username :: Prelude.Maybe (Data.Sensitive Prelude.Text)
}
deriving (UserType -> UserType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserType -> UserType -> Bool
$c/= :: UserType -> UserType -> Bool
== :: UserType -> UserType -> Bool
$c== :: UserType -> UserType -> Bool
Prelude.Eq, Int -> UserType -> ShowS
[UserType] -> ShowS
UserType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserType] -> ShowS
$cshowList :: [UserType] -> ShowS
show :: UserType -> String
$cshow :: UserType -> String
showsPrec :: Int -> UserType -> ShowS
$cshowsPrec :: Int -> UserType -> ShowS
Prelude.Show, forall x. Rep UserType x -> UserType
forall x. UserType -> Rep UserType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserType x -> UserType
$cfrom :: forall x. UserType -> Rep UserType x
Prelude.Generic)
newUserType ::
UserType
newUserType :: UserType
newUserType =
UserType'
{ $sel:attributes:UserType' :: Maybe [AttributeType]
attributes = forall a. Maybe a
Prelude.Nothing,
$sel:enabled:UserType' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing,
$sel:mfaOptions:UserType' :: Maybe [MFAOptionType]
mfaOptions = forall a. Maybe a
Prelude.Nothing,
$sel:userCreateDate:UserType' :: Maybe POSIX
userCreateDate = forall a. Maybe a
Prelude.Nothing,
$sel:userLastModifiedDate:UserType' :: Maybe POSIX
userLastModifiedDate = forall a. Maybe a
Prelude.Nothing,
$sel:userStatus:UserType' :: Maybe UserStatusType
userStatus = forall a. Maybe a
Prelude.Nothing,
$sel:username:UserType' :: Maybe (Sensitive Text)
username = forall a. Maybe a
Prelude.Nothing
}
userType_attributes :: Lens.Lens' UserType (Prelude.Maybe [AttributeType])
userType_attributes :: Lens' UserType (Maybe [AttributeType])
userType_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserType' {Maybe [AttributeType]
attributes :: Maybe [AttributeType]
$sel:attributes:UserType' :: UserType -> Maybe [AttributeType]
attributes} -> Maybe [AttributeType]
attributes) (\s :: UserType
s@UserType' {} Maybe [AttributeType]
a -> UserType
s {$sel:attributes:UserType' :: Maybe [AttributeType]
attributes = Maybe [AttributeType]
a} :: UserType) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
userType_enabled :: Lens.Lens' UserType (Prelude.Maybe Prelude.Bool)
userType_enabled :: Lens' UserType (Maybe Bool)
userType_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserType' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:UserType' :: UserType -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: UserType
s@UserType' {} Maybe Bool
a -> UserType
s {$sel:enabled:UserType' :: Maybe Bool
enabled = Maybe Bool
a} :: UserType)
userType_mfaOptions :: Lens.Lens' UserType (Prelude.Maybe [MFAOptionType])
userType_mfaOptions :: Lens' UserType (Maybe [MFAOptionType])
userType_mfaOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserType' {Maybe [MFAOptionType]
mfaOptions :: Maybe [MFAOptionType]
$sel:mfaOptions:UserType' :: UserType -> Maybe [MFAOptionType]
mfaOptions} -> Maybe [MFAOptionType]
mfaOptions) (\s :: UserType
s@UserType' {} Maybe [MFAOptionType]
a -> UserType
s {$sel:mfaOptions:UserType' :: Maybe [MFAOptionType]
mfaOptions = Maybe [MFAOptionType]
a} :: UserType) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
userType_userCreateDate :: Lens.Lens' UserType (Prelude.Maybe Prelude.UTCTime)
userType_userCreateDate :: Lens' UserType (Maybe UTCTime)
userType_userCreateDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserType' {Maybe POSIX
userCreateDate :: Maybe POSIX
$sel:userCreateDate:UserType' :: UserType -> Maybe POSIX
userCreateDate} -> Maybe POSIX
userCreateDate) (\s :: UserType
s@UserType' {} Maybe POSIX
a -> UserType
s {$sel:userCreateDate:UserType' :: Maybe POSIX
userCreateDate = Maybe POSIX
a} :: UserType) 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 :: Format). Iso' (Time a) UTCTime
Data._Time
userType_userLastModifiedDate :: Lens.Lens' UserType (Prelude.Maybe Prelude.UTCTime)
userType_userLastModifiedDate :: Lens' UserType (Maybe UTCTime)
userType_userLastModifiedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserType' {Maybe POSIX
userLastModifiedDate :: Maybe POSIX
$sel:userLastModifiedDate:UserType' :: UserType -> Maybe POSIX
userLastModifiedDate} -> Maybe POSIX
userLastModifiedDate) (\s :: UserType
s@UserType' {} Maybe POSIX
a -> UserType
s {$sel:userLastModifiedDate:UserType' :: Maybe POSIX
userLastModifiedDate = Maybe POSIX
a} :: UserType) 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 :: Format). Iso' (Time a) UTCTime
Data._Time
userType_userStatus :: Lens.Lens' UserType (Prelude.Maybe UserStatusType)
userType_userStatus :: Lens' UserType (Maybe UserStatusType)
userType_userStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserType' {Maybe UserStatusType
userStatus :: Maybe UserStatusType
$sel:userStatus:UserType' :: UserType -> Maybe UserStatusType
userStatus} -> Maybe UserStatusType
userStatus) (\s :: UserType
s@UserType' {} Maybe UserStatusType
a -> UserType
s {$sel:userStatus:UserType' :: Maybe UserStatusType
userStatus = Maybe UserStatusType
a} :: UserType)
userType_username :: Lens.Lens' UserType (Prelude.Maybe Prelude.Text)
userType_username :: Lens' UserType (Maybe Text)
userType_username = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserType' {Maybe (Sensitive Text)
username :: Maybe (Sensitive Text)
$sel:username:UserType' :: UserType -> Maybe (Sensitive Text)
username} -> Maybe (Sensitive Text)
username) (\s :: UserType
s@UserType' {} Maybe (Sensitive Text)
a -> UserType
s {$sel:username:UserType' :: Maybe (Sensitive Text)
username = Maybe (Sensitive Text)
a} :: UserType) 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
instance Data.FromJSON UserType where
parseJSON :: Value -> Parser UserType
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"UserType"
( \Object
x ->
Maybe [AttributeType]
-> Maybe Bool
-> Maybe [MFAOptionType]
-> Maybe POSIX
-> Maybe POSIX
-> Maybe UserStatusType
-> Maybe (Sensitive Text)
-> UserType
UserType'
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
"Attributes" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"Enabled")
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
"MFAOptions" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"UserCreateDate")
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
"UserLastModifiedDate")
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
"UserStatus")
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
"Username")
)
instance Prelude.Hashable UserType where
hashWithSalt :: Int -> UserType -> Int
hashWithSalt Int
_salt UserType' {Maybe Bool
Maybe [AttributeType]
Maybe [MFAOptionType]
Maybe (Sensitive Text)
Maybe POSIX
Maybe UserStatusType
username :: Maybe (Sensitive Text)
userStatus :: Maybe UserStatusType
userLastModifiedDate :: Maybe POSIX
userCreateDate :: Maybe POSIX
mfaOptions :: Maybe [MFAOptionType]
enabled :: Maybe Bool
attributes :: Maybe [AttributeType]
$sel:username:UserType' :: UserType -> Maybe (Sensitive Text)
$sel:userStatus:UserType' :: UserType -> Maybe UserStatusType
$sel:userLastModifiedDate:UserType' :: UserType -> Maybe POSIX
$sel:userCreateDate:UserType' :: UserType -> Maybe POSIX
$sel:mfaOptions:UserType' :: UserType -> Maybe [MFAOptionType]
$sel:enabled:UserType' :: UserType -> Maybe Bool
$sel:attributes:UserType' :: UserType -> Maybe [AttributeType]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AttributeType]
attributes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [MFAOptionType]
mfaOptions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
userCreateDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
userLastModifiedDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UserStatusType
userStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
username
instance Prelude.NFData UserType where
rnf :: UserType -> ()
rnf UserType' {Maybe Bool
Maybe [AttributeType]
Maybe [MFAOptionType]
Maybe (Sensitive Text)
Maybe POSIX
Maybe UserStatusType
username :: Maybe (Sensitive Text)
userStatus :: Maybe UserStatusType
userLastModifiedDate :: Maybe POSIX
userCreateDate :: Maybe POSIX
mfaOptions :: Maybe [MFAOptionType]
enabled :: Maybe Bool
attributes :: Maybe [AttributeType]
$sel:username:UserType' :: UserType -> Maybe (Sensitive Text)
$sel:userStatus:UserType' :: UserType -> Maybe UserStatusType
$sel:userLastModifiedDate:UserType' :: UserType -> Maybe POSIX
$sel:userCreateDate:UserType' :: UserType -> Maybe POSIX
$sel:mfaOptions:UserType' :: UserType -> Maybe [MFAOptionType]
$sel:enabled:UserType' :: UserType -> Maybe Bool
$sel:attributes:UserType' :: UserType -> Maybe [AttributeType]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AttributeType]
attributes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [MFAOptionType]
mfaOptions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
userCreateDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
userLastModifiedDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UserStatusType
userStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
username