{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data User = User'
{
User -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
User -> Maybe POSIX
createdTime :: Prelude.Maybe Data.POSIX,
User -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
User -> Maybe (Sensitive Text)
firstName :: Prelude.Maybe (Data.Sensitive Prelude.Text),
User -> Maybe (Sensitive Text)
lastName :: Prelude.Maybe (Data.Sensitive Prelude.Text),
User -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
User -> Maybe (Sensitive Text)
userName :: Prelude.Maybe (Data.Sensitive Prelude.Text),
User -> AuthenticationType
authenticationType :: AuthenticationType
}
deriving (User -> User -> Bool
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
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. 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'
{ $sel:arn:User' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:createdTime:User' :: Maybe POSIX
createdTime = forall a. Maybe a
Prelude.Nothing,
$sel:enabled:User' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing,
$sel:firstName:User' :: Maybe (Sensitive Text)
firstName = forall a. Maybe a
Prelude.Nothing,
$sel:lastName:User' :: Maybe (Sensitive Text)
lastName = forall a. Maybe a
Prelude.Nothing,
$sel:status:User' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing,
$sel:userName:User' :: Maybe (Sensitive Text)
userName = forall a. Maybe a
Prelude.Nothing,
$sel:authenticationType:User' :: AuthenticationType
authenticationType = AuthenticationType
pAuthenticationType_
}
user_arn :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_arn :: Lens' User (Maybe Text)
user_arn = 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 :: Lens' User (Maybe UTCTime)
user_createdTime = 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) 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
user_enabled :: Lens.Lens' User (Prelude.Maybe Prelude.Bool)
user_enabled :: Lens' User (Maybe Bool)
user_enabled = 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_firstName :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_firstName :: Lens' User (Maybe Text)
user_firstName = 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) 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
user_lastName :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_lastName :: Lens' User (Maybe Text)
user_lastName = 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) 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
user_status :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_status :: Lens' User (Maybe Text)
user_status = 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_userName :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_userName :: Lens' User (Maybe Text)
user_userName = 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) 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
user_authenticationType :: Lens.Lens' User AuthenticationType
user_authenticationType :: Lens' User AuthenticationType
user_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 Data.FromJSON User where
parseJSON :: Value -> Parser User
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"User"
( \Object
x ->
Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe (Sensitive Text)
-> AuthenticationType
-> User
User'
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
"Arn")
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
"CreatedTime")
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
"FirstName")
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
"LastName")
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
"Status")
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")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"AuthenticationType")
)
instance Prelude.Hashable User where
hashWithSalt :: Int -> User -> Int
hashWithSalt Int
_salt User' {Maybe Bool
Maybe Text
Maybe (Sensitive Text)
Maybe POSIX
AuthenticationType
authenticationType :: AuthenticationType
userName :: Maybe (Sensitive Text)
status :: Maybe Text
lastName :: Maybe (Sensitive Text)
firstName :: Maybe (Sensitive Text)
enabled :: Maybe Bool
createdTime :: Maybe POSIX
arn :: Maybe Text
$sel:authenticationType:User' :: User -> AuthenticationType
$sel:userName:User' :: User -> Maybe (Sensitive Text)
$sel:status:User' :: User -> Maybe Text
$sel:lastName:User' :: User -> Maybe (Sensitive Text)
$sel:firstName:User' :: User -> Maybe (Sensitive Text)
$sel:enabled:User' :: User -> Maybe Bool
$sel:createdTime:User' :: User -> Maybe POSIX
$sel:arn:User' :: User -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
firstName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
lastName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
userName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AuthenticationType
authenticationType
instance Prelude.NFData User where
rnf :: User -> ()
rnf User' {Maybe Bool
Maybe Text
Maybe (Sensitive Text)
Maybe POSIX
AuthenticationType
authenticationType :: AuthenticationType
userName :: Maybe (Sensitive Text)
status :: Maybe Text
lastName :: Maybe (Sensitive Text)
firstName :: Maybe (Sensitive Text)
enabled :: Maybe Bool
createdTime :: Maybe POSIX
arn :: Maybe Text
$sel:authenticationType:User' :: User -> AuthenticationType
$sel:userName:User' :: User -> Maybe (Sensitive Text)
$sel:status:User' :: User -> Maybe Text
$sel:lastName:User' :: User -> Maybe (Sensitive Text)
$sel:firstName:User' :: User -> Maybe (Sensitive Text)
$sel:enabled:User' :: User -> Maybe Bool
$sel:createdTime:User' :: User -> Maybe POSIX
$sel:arn:User' :: User -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTime
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 (Sensitive Text)
firstName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
lastName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
userName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AuthenticationType
authenticationType