{-# 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.AppStream.Types.User where
import Amazonka.AppStream.Types.AuthenticationType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data User = User'
{
User -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
User -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
User -> Maybe (Sensitive Text)
lastName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
User -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
User -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
User -> Maybe (Sensitive Text)
userName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
User -> Maybe (Sensitive Text)
firstName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
User -> AuthenticationType
authenticationType :: AuthenticationType
}
deriving (User -> User -> Bool
(User -> User -> Bool) -> (User -> User -> Bool) -> Eq User
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: User -> User -> Bool
$c/= :: User -> User -> Bool
== :: User -> User -> Bool
$c== :: User -> User -> Bool
Prelude.Eq, Int -> User -> ShowS
[User] -> ShowS
User -> String
(Int -> User -> ShowS)
-> (User -> String) -> ([User] -> ShowS) -> Show User
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [User] -> ShowS
$cshowList :: [User] -> ShowS
show :: User -> String
$cshow :: User -> String
showsPrec :: Int -> User -> ShowS
$cshowsPrec :: Int -> User -> ShowS
Prelude.Show, (forall x. User -> Rep User x)
-> (forall x. Rep User x -> User) -> Generic User
forall x. Rep User x -> User
forall x. User -> Rep User x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep User x -> User
$cfrom :: forall x. User -> Rep User x
Prelude.Generic)
newUser ::
AuthenticationType ->
User
newUser :: AuthenticationType -> User
newUser AuthenticationType
pAuthenticationType_ =
User' :: Maybe Text
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AuthenticationType
-> User
User'
{ $sel:status:User' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:User' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:lastName:User' :: Maybe (Sensitive Text)
lastName = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:arn:User' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdTime:User' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:userName:User' :: Maybe (Sensitive Text)
userName = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:firstName:User' :: Maybe (Sensitive Text)
firstName = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:authenticationType:User' :: AuthenticationType
authenticationType = AuthenticationType
pAuthenticationType_
}
user_status :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_status :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_status = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
status :: Maybe Text
$sel:status:User' :: User -> Maybe Text
status} -> Maybe Text
status) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:status:User' :: Maybe Text
status = Maybe Text
a} :: User)
user_enabled :: Lens.Lens' User (Prelude.Maybe Prelude.Bool)
user_enabled :: (Maybe Bool -> f (Maybe Bool)) -> User -> f User
user_enabled = (User -> Maybe Bool)
-> (User -> Maybe Bool -> User)
-> Lens User User (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:User' :: User -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: User
s@User' {} Maybe Bool
a -> User
s {$sel:enabled:User' :: Maybe Bool
enabled = Maybe Bool
a} :: User)
user_lastName :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_lastName :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_lastName = (User -> Maybe (Sensitive Text))
-> (User -> Maybe (Sensitive Text) -> User)
-> Lens User User (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe (Sensitive Text)
lastName :: Maybe (Sensitive Text)
$sel:lastName:User' :: User -> Maybe (Sensitive Text)
lastName} -> Maybe (Sensitive Text)
lastName) (\s :: User
s@User' {} Maybe (Sensitive Text)
a -> User
s {$sel:lastName:User' :: Maybe (Sensitive Text)
lastName = Maybe (Sensitive Text)
a} :: User) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> User -> f User)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> User
-> f User
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
user_arn :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_arn :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_arn = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
arn :: Maybe Text
$sel:arn:User' :: User -> Maybe Text
arn} -> Maybe Text
arn) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:arn:User' :: Maybe Text
arn = Maybe Text
a} :: User)
user_createdTime :: Lens.Lens' User (Prelude.Maybe Prelude.UTCTime)
user_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> User -> f User
user_createdTime = (User -> Maybe POSIX)
-> (User -> Maybe POSIX -> User)
-> Lens User User (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:User' :: User -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: User
s@User' {} Maybe POSIX
a -> User
s {$sel:createdTime:User' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: User) ((Maybe POSIX -> f (Maybe POSIX)) -> User -> f User)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> User
-> f User
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
user_userName :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_userName :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_userName = (User -> Maybe (Sensitive Text))
-> (User -> Maybe (Sensitive Text) -> User)
-> Lens User User (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe (Sensitive Text)
userName :: Maybe (Sensitive Text)
$sel:userName:User' :: User -> Maybe (Sensitive Text)
userName} -> Maybe (Sensitive Text)
userName) (\s :: User
s@User' {} Maybe (Sensitive Text)
a -> User
s {$sel:userName:User' :: Maybe (Sensitive Text)
userName = Maybe (Sensitive Text)
a} :: User) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> User -> f User)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> User
-> f User
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
user_firstName :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_firstName :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_firstName = (User -> Maybe (Sensitive Text))
-> (User -> Maybe (Sensitive Text) -> User)
-> Lens User User (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe (Sensitive Text)
firstName :: Maybe (Sensitive Text)
$sel:firstName:User' :: User -> Maybe (Sensitive Text)
firstName} -> Maybe (Sensitive Text)
firstName) (\s :: User
s@User' {} Maybe (Sensitive Text)
a -> User
s {$sel:firstName:User' :: Maybe (Sensitive Text)
firstName = Maybe (Sensitive Text)
a} :: User) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> User -> f User)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> User
-> f User
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
user_authenticationType :: Lens.Lens' User AuthenticationType
user_authenticationType :: (AuthenticationType -> f AuthenticationType) -> User -> f User
user_authenticationType = (User -> AuthenticationType)
-> (User -> AuthenticationType -> User)
-> Lens User User AuthenticationType AuthenticationType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {AuthenticationType
authenticationType :: AuthenticationType
$sel:authenticationType:User' :: User -> AuthenticationType
authenticationType} -> AuthenticationType
authenticationType) (\s :: User
s@User' {} AuthenticationType
a -> User
s {$sel:authenticationType:User' :: AuthenticationType
authenticationType = AuthenticationType
a} :: User)
instance Core.FromJSON User where
parseJSON :: Value -> Parser User
parseJSON =
String -> (Object -> Parser User) -> Value -> Parser User
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"User"
( \Object
x ->
Maybe Text
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AuthenticationType
-> User
User'
(Maybe Text
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AuthenticationType
-> User)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AuthenticationType
-> User)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AuthenticationType
-> User)
-> Parser (Maybe Bool)
-> Parser
(Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AuthenticationType
-> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Enabled")
Parser
(Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AuthenticationType
-> User)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AuthenticationType
-> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastName")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AuthenticationType
-> User)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AuthenticationType
-> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn")
Parser
(Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> AuthenticationType
-> User)
-> Parser (Maybe POSIX)
-> Parser
(Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> AuthenticationType -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTime")
Parser
(Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> AuthenticationType -> User)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe (Sensitive Text) -> AuthenticationType -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserName")
Parser (Maybe (Sensitive Text) -> AuthenticationType -> User)
-> Parser (Maybe (Sensitive Text))
-> Parser (AuthenticationType -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FirstName")
Parser (AuthenticationType -> User)
-> Parser AuthenticationType -> Parser User
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AuthenticationType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AuthenticationType")
)
instance Prelude.Hashable User
instance Prelude.NFData User