{-# 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.Kendra.Types.EntityDisplayData
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Kendra.Types.EntityDisplayData where

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

-- | Information about the user entity.
--
-- /See:/ 'newEntityDisplayData' smart constructor.
data EntityDisplayData = EntityDisplayData'
  { -- | The first name of the user.
    EntityDisplayData -> Maybe (Sensitive Text)
firstName :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The name of the group.
    EntityDisplayData -> Maybe (Sensitive Text)
groupName :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The user name of the user.
    EntityDisplayData -> Maybe (Sensitive Text)
identifiedUserName :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The last name of the user.
    EntityDisplayData -> Maybe (Sensitive Text)
lastName :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The name of the user.
    EntityDisplayData -> Maybe (Sensitive Text)
userName :: Prelude.Maybe (Data.Sensitive Prelude.Text)
  }
  deriving (EntityDisplayData -> EntityDisplayData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntityDisplayData -> EntityDisplayData -> Bool
$c/= :: EntityDisplayData -> EntityDisplayData -> Bool
== :: EntityDisplayData -> EntityDisplayData -> Bool
$c== :: EntityDisplayData -> EntityDisplayData -> Bool
Prelude.Eq, Int -> EntityDisplayData -> ShowS
[EntityDisplayData] -> ShowS
EntityDisplayData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntityDisplayData] -> ShowS
$cshowList :: [EntityDisplayData] -> ShowS
show :: EntityDisplayData -> String
$cshow :: EntityDisplayData -> String
showsPrec :: Int -> EntityDisplayData -> ShowS
$cshowsPrec :: Int -> EntityDisplayData -> ShowS
Prelude.Show, forall x. Rep EntityDisplayData x -> EntityDisplayData
forall x. EntityDisplayData -> Rep EntityDisplayData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EntityDisplayData x -> EntityDisplayData
$cfrom :: forall x. EntityDisplayData -> Rep EntityDisplayData x
Prelude.Generic)

-- |
-- Create a value of 'EntityDisplayData' 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:
--
-- 'firstName', 'entityDisplayData_firstName' - The first name of the user.
--
-- 'groupName', 'entityDisplayData_groupName' - The name of the group.
--
-- 'identifiedUserName', 'entityDisplayData_identifiedUserName' - The user name of the user.
--
-- 'lastName', 'entityDisplayData_lastName' - The last name of the user.
--
-- 'userName', 'entityDisplayData_userName' - The name of the user.
newEntityDisplayData ::
  EntityDisplayData
newEntityDisplayData :: EntityDisplayData
newEntityDisplayData =
  EntityDisplayData'
    { $sel:firstName:EntityDisplayData' :: Maybe (Sensitive Text)
firstName = forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:EntityDisplayData' :: Maybe (Sensitive Text)
groupName = forall a. Maybe a
Prelude.Nothing,
      $sel:identifiedUserName:EntityDisplayData' :: Maybe (Sensitive Text)
identifiedUserName = forall a. Maybe a
Prelude.Nothing,
      $sel:lastName:EntityDisplayData' :: Maybe (Sensitive Text)
lastName = forall a. Maybe a
Prelude.Nothing,
      $sel:userName:EntityDisplayData' :: Maybe (Sensitive Text)
userName = forall a. Maybe a
Prelude.Nothing
    }

-- | The first name of the user.
entityDisplayData_firstName :: Lens.Lens' EntityDisplayData (Prelude.Maybe Prelude.Text)
entityDisplayData_firstName :: Lens' EntityDisplayData (Maybe Text)
entityDisplayData_firstName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityDisplayData' {Maybe (Sensitive Text)
firstName :: Maybe (Sensitive Text)
$sel:firstName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
firstName} -> Maybe (Sensitive Text)
firstName) (\s :: EntityDisplayData
s@EntityDisplayData' {} Maybe (Sensitive Text)
a -> EntityDisplayData
s {$sel:firstName:EntityDisplayData' :: Maybe (Sensitive Text)
firstName = Maybe (Sensitive Text)
a} :: EntityDisplayData) 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

-- | The name of the group.
entityDisplayData_groupName :: Lens.Lens' EntityDisplayData (Prelude.Maybe Prelude.Text)
entityDisplayData_groupName :: Lens' EntityDisplayData (Maybe Text)
entityDisplayData_groupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityDisplayData' {Maybe (Sensitive Text)
groupName :: Maybe (Sensitive Text)
$sel:groupName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
groupName} -> Maybe (Sensitive Text)
groupName) (\s :: EntityDisplayData
s@EntityDisplayData' {} Maybe (Sensitive Text)
a -> EntityDisplayData
s {$sel:groupName:EntityDisplayData' :: Maybe (Sensitive Text)
groupName = Maybe (Sensitive Text)
a} :: EntityDisplayData) 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

-- | The user name of the user.
entityDisplayData_identifiedUserName :: Lens.Lens' EntityDisplayData (Prelude.Maybe Prelude.Text)
entityDisplayData_identifiedUserName :: Lens' EntityDisplayData (Maybe Text)
entityDisplayData_identifiedUserName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityDisplayData' {Maybe (Sensitive Text)
identifiedUserName :: Maybe (Sensitive Text)
$sel:identifiedUserName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
identifiedUserName} -> Maybe (Sensitive Text)
identifiedUserName) (\s :: EntityDisplayData
s@EntityDisplayData' {} Maybe (Sensitive Text)
a -> EntityDisplayData
s {$sel:identifiedUserName:EntityDisplayData' :: Maybe (Sensitive Text)
identifiedUserName = Maybe (Sensitive Text)
a} :: EntityDisplayData) 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

-- | The last name of the user.
entityDisplayData_lastName :: Lens.Lens' EntityDisplayData (Prelude.Maybe Prelude.Text)
entityDisplayData_lastName :: Lens' EntityDisplayData (Maybe Text)
entityDisplayData_lastName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityDisplayData' {Maybe (Sensitive Text)
lastName :: Maybe (Sensitive Text)
$sel:lastName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
lastName} -> Maybe (Sensitive Text)
lastName) (\s :: EntityDisplayData
s@EntityDisplayData' {} Maybe (Sensitive Text)
a -> EntityDisplayData
s {$sel:lastName:EntityDisplayData' :: Maybe (Sensitive Text)
lastName = Maybe (Sensitive Text)
a} :: EntityDisplayData) 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

-- | The name of the user.
entityDisplayData_userName :: Lens.Lens' EntityDisplayData (Prelude.Maybe Prelude.Text)
entityDisplayData_userName :: Lens' EntityDisplayData (Maybe Text)
entityDisplayData_userName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityDisplayData' {Maybe (Sensitive Text)
userName :: Maybe (Sensitive Text)
$sel:userName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
userName} -> Maybe (Sensitive Text)
userName) (\s :: EntityDisplayData
s@EntityDisplayData' {} Maybe (Sensitive Text)
a -> EntityDisplayData
s {$sel:userName:EntityDisplayData' :: Maybe (Sensitive Text)
userName = Maybe (Sensitive Text)
a} :: EntityDisplayData) 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 EntityDisplayData where
  parseJSON :: Value -> Parser EntityDisplayData
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EntityDisplayData"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> EntityDisplayData
EntityDisplayData'
            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
"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
"GroupName")
            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
"IdentifiedUserName")
            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
"UserName")
      )

instance Prelude.Hashable EntityDisplayData where
  hashWithSalt :: Int -> EntityDisplayData -> Int
hashWithSalt Int
_salt EntityDisplayData' {Maybe (Sensitive Text)
userName :: Maybe (Sensitive Text)
lastName :: Maybe (Sensitive Text)
identifiedUserName :: Maybe (Sensitive Text)
groupName :: Maybe (Sensitive Text)
firstName :: Maybe (Sensitive Text)
$sel:userName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
$sel:lastName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
$sel:identifiedUserName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
$sel:groupName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
$sel:firstName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
..} =
    Int
_salt
      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)
groupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
identifiedUserName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
lastName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
userName

instance Prelude.NFData EntityDisplayData where
  rnf :: EntityDisplayData -> ()
rnf EntityDisplayData' {Maybe (Sensitive Text)
userName :: Maybe (Sensitive Text)
lastName :: Maybe (Sensitive Text)
identifiedUserName :: Maybe (Sensitive Text)
groupName :: Maybe (Sensitive Text)
firstName :: Maybe (Sensitive Text)
$sel:userName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
$sel:lastName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
$sel:identifiedUserName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
$sel:groupName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
$sel:firstName:EntityDisplayData' :: EntityDisplayData -> Maybe (Sensitive Text)
..} =
    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)
groupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
identifiedUserName
      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 (Sensitive Text)
userName