{-# 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.QuickSight.Types.User where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.IdentityType
import Amazonka.QuickSight.Types.UserRole
data User = User'
{
User -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
User -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text,
User -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
User -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
User -> Maybe IdentityType
identityType :: Prelude.Maybe IdentityType,
User -> Maybe Text
externalLoginFederationProviderUrl :: Prelude.Maybe Prelude.Text,
User -> Maybe Text
customPermissionsName :: Prelude.Maybe Prelude.Text,
User -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool,
User -> Maybe UserRole
role' :: Prelude.Maybe UserRole,
User -> Maybe Text
externalLoginFederationProviderType :: Prelude.Maybe Prelude.Text,
User -> Maybe Text
externalLoginId :: Prelude.Maybe Prelude.Text
}
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, ReadPrec [User]
ReadPrec User
Int -> ReadS User
ReadS [User]
(Int -> ReadS User)
-> ReadS [User] -> ReadPrec User -> ReadPrec [User] -> Read User
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [User]
$creadListPrec :: ReadPrec [User]
readPrec :: ReadPrec User
$creadPrec :: ReadPrec User
readList :: ReadS [User]
$creadList :: ReadS [User]
readsPrec :: Int -> ReadS User
$creadsPrec :: Int -> ReadS User
Prelude.Read, 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 ::
User
newUser :: User
newUser =
User' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe IdentityType
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> User
User'
{ $sel:email:User' :: Maybe Text
email = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:principalId:User' :: Maybe Text
principalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:User' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userName:User' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:identityType:User' :: Maybe IdentityType
identityType = Maybe IdentityType
forall a. Maybe a
Prelude.Nothing,
$sel:externalLoginFederationProviderUrl:User' :: Maybe Text
externalLoginFederationProviderUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:customPermissionsName:User' :: Maybe Text
customPermissionsName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:active:User' :: Maybe Bool
active = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:role':User' :: Maybe UserRole
role' = Maybe UserRole
forall a. Maybe a
Prelude.Nothing,
$sel:externalLoginFederationProviderType:User' :: Maybe Text
externalLoginFederationProviderType =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:externalLoginId:User' :: Maybe Text
externalLoginId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
user_email :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_email :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_email = (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
email :: Maybe Text
$sel:email:User' :: User -> Maybe Text
email} -> Maybe Text
email) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:email:User' :: Maybe Text
email = Maybe Text
a} :: User)
user_principalId :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_principalId :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_principalId = (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
principalId :: Maybe Text
$sel:principalId:User' :: User -> Maybe Text
principalId} -> Maybe Text
principalId) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:principalId:User' :: Maybe Text
principalId = Maybe Text
a} :: User)
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_userName :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_userName :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_userName = (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
userName :: Maybe Text
$sel:userName:User' :: User -> Maybe Text
userName} -> Maybe Text
userName) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:userName:User' :: Maybe Text
userName = Maybe Text
a} :: User)
user_identityType :: Lens.Lens' User (Prelude.Maybe IdentityType)
user_identityType :: (Maybe IdentityType -> f (Maybe IdentityType)) -> User -> f User
user_identityType = (User -> Maybe IdentityType)
-> (User -> Maybe IdentityType -> User)
-> Lens User User (Maybe IdentityType) (Maybe IdentityType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe IdentityType
identityType :: Maybe IdentityType
$sel:identityType:User' :: User -> Maybe IdentityType
identityType} -> Maybe IdentityType
identityType) (\s :: User
s@User' {} Maybe IdentityType
a -> User
s {$sel:identityType:User' :: Maybe IdentityType
identityType = Maybe IdentityType
a} :: User)
user_externalLoginFederationProviderUrl :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_externalLoginFederationProviderUrl :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_externalLoginFederationProviderUrl = (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
externalLoginFederationProviderUrl :: Maybe Text
$sel:externalLoginFederationProviderUrl:User' :: User -> Maybe Text
externalLoginFederationProviderUrl} -> Maybe Text
externalLoginFederationProviderUrl) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:externalLoginFederationProviderUrl:User' :: Maybe Text
externalLoginFederationProviderUrl = Maybe Text
a} :: User)
user_customPermissionsName :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_customPermissionsName :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_customPermissionsName = (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
customPermissionsName :: Maybe Text
$sel:customPermissionsName:User' :: User -> Maybe Text
customPermissionsName} -> Maybe Text
customPermissionsName) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:customPermissionsName:User' :: Maybe Text
customPermissionsName = Maybe Text
a} :: User)
user_active :: Lens.Lens' User (Prelude.Maybe Prelude.Bool)
user_active :: (Maybe Bool -> f (Maybe Bool)) -> User -> f User
user_active = (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
active :: Maybe Bool
$sel:active:User' :: User -> Maybe Bool
active} -> Maybe Bool
active) (\s :: User
s@User' {} Maybe Bool
a -> User
s {$sel:active:User' :: Maybe Bool
active = Maybe Bool
a} :: User)
user_role :: Lens.Lens' User (Prelude.Maybe UserRole)
user_role :: (Maybe UserRole -> f (Maybe UserRole)) -> User -> f User
user_role = (User -> Maybe UserRole)
-> (User -> Maybe UserRole -> User)
-> Lens User User (Maybe UserRole) (Maybe UserRole)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe UserRole
role' :: Maybe UserRole
$sel:role':User' :: User -> Maybe UserRole
role'} -> Maybe UserRole
role') (\s :: User
s@User' {} Maybe UserRole
a -> User
s {$sel:role':User' :: Maybe UserRole
role' = Maybe UserRole
a} :: User)
user_externalLoginFederationProviderType :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_externalLoginFederationProviderType :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_externalLoginFederationProviderType = (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
externalLoginFederationProviderType :: Maybe Text
$sel:externalLoginFederationProviderType:User' :: User -> Maybe Text
externalLoginFederationProviderType} -> Maybe Text
externalLoginFederationProviderType) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:externalLoginFederationProviderType:User' :: Maybe Text
externalLoginFederationProviderType = Maybe Text
a} :: User)
user_externalLoginId :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_externalLoginId :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_externalLoginId = (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
externalLoginId :: Maybe Text
$sel:externalLoginId:User' :: User -> Maybe Text
externalLoginId} -> Maybe Text
externalLoginId) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:externalLoginId:User' :: Maybe Text
externalLoginId = Maybe Text
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 Text
-> Maybe Text
-> Maybe Text
-> Maybe IdentityType
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> User
User'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe IdentityType
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> User)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe IdentityType
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> 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
"Email")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe IdentityType
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> User)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe IdentityType
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> 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
"PrincipalId")
Parser
(Maybe Text
-> Maybe Text
-> Maybe IdentityType
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> User)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe IdentityType
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> 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 Text
-> Maybe IdentityType
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> User)
-> Parser (Maybe Text)
-> Parser
(Maybe IdentityType
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> 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
"UserName")
Parser
(Maybe IdentityType
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> User)
-> Parser (Maybe IdentityType)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe IdentityType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IdentityType")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> User)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> 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
"ExternalLoginFederationProviderUrl")
Parser
(Maybe Text
-> Maybe Bool
-> Maybe UserRole
-> Maybe Text
-> Maybe Text
-> User)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool -> Maybe UserRole -> Maybe Text -> Maybe Text -> 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
"CustomPermissionsName")
Parser
(Maybe Bool -> Maybe UserRole -> Maybe Text -> Maybe Text -> User)
-> Parser (Maybe Bool)
-> Parser (Maybe UserRole -> Maybe Text -> Maybe Text -> 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
"Active")
Parser (Maybe UserRole -> Maybe Text -> Maybe Text -> User)
-> Parser (Maybe UserRole)
-> Parser (Maybe Text -> Maybe Text -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UserRole)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Role")
Parser (Maybe Text -> Maybe Text -> User)
-> Parser (Maybe Text) -> Parser (Maybe Text -> 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
"ExternalLoginFederationProviderType")
Parser (Maybe Text -> User) -> Parser (Maybe Text) -> Parser 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
"ExternalLoginId")
)
instance Prelude.Hashable User
instance Prelude.NFData User