{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.QuickSight.Types.User
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | A registered user of Amazon QuickSight.
--
-- /See:/ 'newUser' smart constructor.
data User = User'
  { -- | The user\'s email address.
    User -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
    -- | The principal ID of the user.
    User -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the user.
    User -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The user\'s user name.
    User -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
    -- | The type of identity authentication used by the user.
    User -> Maybe IdentityType
identityType :: Prelude.Maybe IdentityType,
    -- | The URL of the external login provider.
    User -> Maybe Text
externalLoginFederationProviderUrl :: Prelude.Maybe Prelude.Text,
    -- | The custom permissions profile associated with this user.
    User -> Maybe Text
customPermissionsName :: Prelude.Maybe Prelude.Text,
    -- | The active status of user. When you create an Amazon QuickSight user
    -- that’s not an IAM user or an Active Directory user, that user is
    -- inactive until they sign in and provide a password.
    User -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon QuickSight role for the user. The user role can be one of the
    -- following:.
    --
    -- -   @READER@: A user who has read-only access to dashboards.
    --
    -- -   @AUTHOR@: A user who can create data sources, datasets, analyses,
    --     and dashboards.
    --
    -- -   @ADMIN@: A user who is an author, who can also manage Amazon Amazon
    --     QuickSight settings.
    --
    -- -   @RESTRICTED_READER@: This role isn\'t currently available for use.
    --
    -- -   @RESTRICTED_AUTHOR@: This role isn\'t currently available for use.
    User -> Maybe UserRole
role' :: Prelude.Maybe UserRole,
    -- | The type of supported external login provider that provides identity to
    -- let the user federate into Amazon QuickSight with an associated IAMrole.
    -- The type can be one of the following.
    --
    -- -   @COGNITO@: Amazon Cognito. The provider URL is
    --     cognito-identity.amazonaws.com.
    --
    -- -   @CUSTOM_OIDC@: Custom OpenID Connect (OIDC) provider.
    User -> Maybe Text
externalLoginFederationProviderType :: Prelude.Maybe Prelude.Text,
    -- | The identity ID for the user in the external login provider.
    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)

-- |
-- Create a value of 'User' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'email', 'user_email' - The user\'s email address.
--
-- 'principalId', 'user_principalId' - The principal ID of the user.
--
-- 'arn', 'user_arn' - The Amazon Resource Name (ARN) for the user.
--
-- 'userName', 'user_userName' - The user\'s user name.
--
-- 'identityType', 'user_identityType' - The type of identity authentication used by the user.
--
-- 'externalLoginFederationProviderUrl', 'user_externalLoginFederationProviderUrl' - The URL of the external login provider.
--
-- 'customPermissionsName', 'user_customPermissionsName' - The custom permissions profile associated with this user.
--
-- 'active', 'user_active' - The active status of user. When you create an Amazon QuickSight user
-- that’s not an IAM user or an Active Directory user, that user is
-- inactive until they sign in and provide a password.
--
-- 'role'', 'user_role' - The Amazon QuickSight role for the user. The user role can be one of the
-- following:.
--
-- -   @READER@: A user who has read-only access to dashboards.
--
-- -   @AUTHOR@: A user who can create data sources, datasets, analyses,
--     and dashboards.
--
-- -   @ADMIN@: A user who is an author, who can also manage Amazon Amazon
--     QuickSight settings.
--
-- -   @RESTRICTED_READER@: This role isn\'t currently available for use.
--
-- -   @RESTRICTED_AUTHOR@: This role isn\'t currently available for use.
--
-- 'externalLoginFederationProviderType', 'user_externalLoginFederationProviderType' - The type of supported external login provider that provides identity to
-- let the user federate into Amazon QuickSight with an associated IAMrole.
-- The type can be one of the following.
--
-- -   @COGNITO@: Amazon Cognito. The provider URL is
--     cognito-identity.amazonaws.com.
--
-- -   @CUSTOM_OIDC@: Custom OpenID Connect (OIDC) provider.
--
-- 'externalLoginId', 'user_externalLoginId' - The identity ID for the user in the external login provider.
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
    }

-- | The user\'s email address.
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)

-- | The principal ID of the 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)

-- | The Amazon Resource Name (ARN) for the 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)

-- | The user\'s user name.
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)

-- | The type of identity authentication used by the 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)

-- | The URL of the external login provider.
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)

-- | The custom permissions profile associated with this 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)

-- | The active status of user. When you create an Amazon QuickSight user
-- that’s not an IAM user or an Active Directory user, that user is
-- inactive until they sign in and provide a password.
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)

-- | The Amazon QuickSight role for the user. The user role can be one of the
-- following:.
--
-- -   @READER@: A user who has read-only access to dashboards.
--
-- -   @AUTHOR@: A user who can create data sources, datasets, analyses,
--     and dashboards.
--
-- -   @ADMIN@: A user who is an author, who can also manage Amazon Amazon
--     QuickSight settings.
--
-- -   @RESTRICTED_READER@: This role isn\'t currently available for use.
--
-- -   @RESTRICTED_AUTHOR@: This role isn\'t currently available for use.
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)

-- | The type of supported external login provider that provides identity to
-- let the user federate into Amazon QuickSight with an associated IAMrole.
-- The type can be one of the following.
--
-- -   @COGNITO@: Amazon Cognito. The provider URL is
--     cognito-identity.amazonaws.com.
--
-- -   @CUSTOM_OIDC@: Custom OpenID Connect (OIDC) provider.
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)

-- | The identity ID for the user in the external login provider.
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