{-# 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.Kendra.Types.EntityPersonaConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kendra.Types.Persona
import qualified Amazonka.Prelude as Prelude
data EntityPersonaConfiguration = EntityPersonaConfiguration'
{
EntityPersonaConfiguration -> Text
entityId :: Prelude.Text,
EntityPersonaConfiguration -> Persona
persona :: Persona
}
deriving (EntityPersonaConfiguration -> EntityPersonaConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntityPersonaConfiguration -> EntityPersonaConfiguration -> Bool
$c/= :: EntityPersonaConfiguration -> EntityPersonaConfiguration -> Bool
== :: EntityPersonaConfiguration -> EntityPersonaConfiguration -> Bool
$c== :: EntityPersonaConfiguration -> EntityPersonaConfiguration -> Bool
Prelude.Eq, ReadPrec [EntityPersonaConfiguration]
ReadPrec EntityPersonaConfiguration
Int -> ReadS EntityPersonaConfiguration
ReadS [EntityPersonaConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EntityPersonaConfiguration]
$creadListPrec :: ReadPrec [EntityPersonaConfiguration]
readPrec :: ReadPrec EntityPersonaConfiguration
$creadPrec :: ReadPrec EntityPersonaConfiguration
readList :: ReadS [EntityPersonaConfiguration]
$creadList :: ReadS [EntityPersonaConfiguration]
readsPrec :: Int -> ReadS EntityPersonaConfiguration
$creadsPrec :: Int -> ReadS EntityPersonaConfiguration
Prelude.Read, Int -> EntityPersonaConfiguration -> ShowS
[EntityPersonaConfiguration] -> ShowS
EntityPersonaConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntityPersonaConfiguration] -> ShowS
$cshowList :: [EntityPersonaConfiguration] -> ShowS
show :: EntityPersonaConfiguration -> String
$cshow :: EntityPersonaConfiguration -> String
showsPrec :: Int -> EntityPersonaConfiguration -> ShowS
$cshowsPrec :: Int -> EntityPersonaConfiguration -> ShowS
Prelude.Show, forall x.
Rep EntityPersonaConfiguration x -> EntityPersonaConfiguration
forall x.
EntityPersonaConfiguration -> Rep EntityPersonaConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EntityPersonaConfiguration x -> EntityPersonaConfiguration
$cfrom :: forall x.
EntityPersonaConfiguration -> Rep EntityPersonaConfiguration x
Prelude.Generic)
newEntityPersonaConfiguration ::
Prelude.Text ->
Persona ->
EntityPersonaConfiguration
newEntityPersonaConfiguration :: Text -> Persona -> EntityPersonaConfiguration
newEntityPersonaConfiguration Text
pEntityId_ Persona
pPersona_ =
EntityPersonaConfiguration'
{ $sel:entityId:EntityPersonaConfiguration' :: Text
entityId = Text
pEntityId_,
$sel:persona:EntityPersonaConfiguration' :: Persona
persona = Persona
pPersona_
}
entityPersonaConfiguration_entityId :: Lens.Lens' EntityPersonaConfiguration Prelude.Text
entityPersonaConfiguration_entityId :: Lens' EntityPersonaConfiguration Text
entityPersonaConfiguration_entityId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityPersonaConfiguration' {Text
entityId :: Text
$sel:entityId:EntityPersonaConfiguration' :: EntityPersonaConfiguration -> Text
entityId} -> Text
entityId) (\s :: EntityPersonaConfiguration
s@EntityPersonaConfiguration' {} Text
a -> EntityPersonaConfiguration
s {$sel:entityId:EntityPersonaConfiguration' :: Text
entityId = Text
a} :: EntityPersonaConfiguration)
entityPersonaConfiguration_persona :: Lens.Lens' EntityPersonaConfiguration Persona
entityPersonaConfiguration_persona :: Lens' EntityPersonaConfiguration Persona
entityPersonaConfiguration_persona = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityPersonaConfiguration' {Persona
persona :: Persona
$sel:persona:EntityPersonaConfiguration' :: EntityPersonaConfiguration -> Persona
persona} -> Persona
persona) (\s :: EntityPersonaConfiguration
s@EntityPersonaConfiguration' {} Persona
a -> EntityPersonaConfiguration
s {$sel:persona:EntityPersonaConfiguration' :: Persona
persona = Persona
a} :: EntityPersonaConfiguration)
instance Prelude.Hashable EntityPersonaConfiguration where
hashWithSalt :: Int -> EntityPersonaConfiguration -> Int
hashWithSalt Int
_salt EntityPersonaConfiguration' {Text
Persona
persona :: Persona
entityId :: Text
$sel:persona:EntityPersonaConfiguration' :: EntityPersonaConfiguration -> Persona
$sel:entityId:EntityPersonaConfiguration' :: EntityPersonaConfiguration -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
entityId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Persona
persona
instance Prelude.NFData EntityPersonaConfiguration where
rnf :: EntityPersonaConfiguration -> ()
rnf EntityPersonaConfiguration' {Text
Persona
persona :: Persona
entityId :: Text
$sel:persona:EntityPersonaConfiguration' :: EntityPersonaConfiguration -> Persona
$sel:entityId:EntityPersonaConfiguration' :: EntityPersonaConfiguration -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
entityId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Persona
persona
instance Data.ToJSON EntityPersonaConfiguration where
toJSON :: EntityPersonaConfiguration -> Value
toJSON EntityPersonaConfiguration' {Text
Persona
persona :: Persona
entityId :: Text
$sel:persona:EntityPersonaConfiguration' :: EntityPersonaConfiguration -> Persona
$sel:entityId:EntityPersonaConfiguration' :: EntityPersonaConfiguration -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"EntityId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
entityId),
forall a. a -> Maybe a
Prelude.Just (Key
"Persona" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Persona
persona)
]
)