{-# 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.FailedEntity 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
data FailedEntity = FailedEntity'
{
FailedEntity -> Maybe Text
entityId :: Prelude.Maybe Prelude.Text,
FailedEntity -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
}
deriving (FailedEntity -> FailedEntity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailedEntity -> FailedEntity -> Bool
$c/= :: FailedEntity -> FailedEntity -> Bool
== :: FailedEntity -> FailedEntity -> Bool
$c== :: FailedEntity -> FailedEntity -> Bool
Prelude.Eq, ReadPrec [FailedEntity]
ReadPrec FailedEntity
Int -> ReadS FailedEntity
ReadS [FailedEntity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FailedEntity]
$creadListPrec :: ReadPrec [FailedEntity]
readPrec :: ReadPrec FailedEntity
$creadPrec :: ReadPrec FailedEntity
readList :: ReadS [FailedEntity]
$creadList :: ReadS [FailedEntity]
readsPrec :: Int -> ReadS FailedEntity
$creadsPrec :: Int -> ReadS FailedEntity
Prelude.Read, Int -> FailedEntity -> ShowS
[FailedEntity] -> ShowS
FailedEntity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailedEntity] -> ShowS
$cshowList :: [FailedEntity] -> ShowS
show :: FailedEntity -> String
$cshow :: FailedEntity -> String
showsPrec :: Int -> FailedEntity -> ShowS
$cshowsPrec :: Int -> FailedEntity -> ShowS
Prelude.Show, forall x. Rep FailedEntity x -> FailedEntity
forall x. FailedEntity -> Rep FailedEntity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FailedEntity x -> FailedEntity
$cfrom :: forall x. FailedEntity -> Rep FailedEntity x
Prelude.Generic)
newFailedEntity ::
FailedEntity
newFailedEntity :: FailedEntity
newFailedEntity =
FailedEntity'
{ $sel:entityId:FailedEntity' :: Maybe Text
entityId = forall a. Maybe a
Prelude.Nothing,
$sel:errorMessage:FailedEntity' :: Maybe Text
errorMessage = forall a. Maybe a
Prelude.Nothing
}
failedEntity_entityId :: Lens.Lens' FailedEntity (Prelude.Maybe Prelude.Text)
failedEntity_entityId :: Lens' FailedEntity (Maybe Text)
failedEntity_entityId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedEntity' {Maybe Text
entityId :: Maybe Text
$sel:entityId:FailedEntity' :: FailedEntity -> Maybe Text
entityId} -> Maybe Text
entityId) (\s :: FailedEntity
s@FailedEntity' {} Maybe Text
a -> FailedEntity
s {$sel:entityId:FailedEntity' :: Maybe Text
entityId = Maybe Text
a} :: FailedEntity)
failedEntity_errorMessage :: Lens.Lens' FailedEntity (Prelude.Maybe Prelude.Text)
failedEntity_errorMessage :: Lens' FailedEntity (Maybe Text)
failedEntity_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedEntity' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:FailedEntity' :: FailedEntity -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: FailedEntity
s@FailedEntity' {} Maybe Text
a -> FailedEntity
s {$sel:errorMessage:FailedEntity' :: Maybe Text
errorMessage = Maybe Text
a} :: FailedEntity)
instance Data.FromJSON FailedEntity where
parseJSON :: Value -> Parser FailedEntity
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FailedEntity"
( \Object
x ->
Maybe Text -> Maybe Text -> FailedEntity
FailedEntity'
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
"EntityId")
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
"ErrorMessage")
)
instance Prelude.Hashable FailedEntity where
hashWithSalt :: Int -> FailedEntity -> Int
hashWithSalt Int
_salt FailedEntity' {Maybe Text
errorMessage :: Maybe Text
entityId :: Maybe Text
$sel:errorMessage:FailedEntity' :: FailedEntity -> Maybe Text
$sel:entityId:FailedEntity' :: FailedEntity -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
entityId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
instance Prelude.NFData FailedEntity where
rnf :: FailedEntity -> ()
rnf FailedEntity' {Maybe Text
errorMessage :: Maybe Text
entityId :: Maybe Text
$sel:errorMessage:FailedEntity' :: FailedEntity -> Maybe Text
$sel:entityId:FailedEntity' :: FailedEntity -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
entityId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage