{-# 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.DocumentAttributeTarget 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.DocumentAttributeValue
import qualified Amazonka.Prelude as Prelude
data DocumentAttributeTarget = DocumentAttributeTarget'
{
DocumentAttributeTarget -> Maybe Text
targetDocumentAttributeKey :: Prelude.Maybe Prelude.Text,
DocumentAttributeTarget -> Maybe DocumentAttributeValue
targetDocumentAttributeValue :: Prelude.Maybe DocumentAttributeValue,
DocumentAttributeTarget -> Maybe Bool
targetDocumentAttributeValueDeletion :: Prelude.Maybe Prelude.Bool
}
deriving (DocumentAttributeTarget -> DocumentAttributeTarget -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentAttributeTarget -> DocumentAttributeTarget -> Bool
$c/= :: DocumentAttributeTarget -> DocumentAttributeTarget -> Bool
== :: DocumentAttributeTarget -> DocumentAttributeTarget -> Bool
$c== :: DocumentAttributeTarget -> DocumentAttributeTarget -> Bool
Prelude.Eq, ReadPrec [DocumentAttributeTarget]
ReadPrec DocumentAttributeTarget
Int -> ReadS DocumentAttributeTarget
ReadS [DocumentAttributeTarget]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentAttributeTarget]
$creadListPrec :: ReadPrec [DocumentAttributeTarget]
readPrec :: ReadPrec DocumentAttributeTarget
$creadPrec :: ReadPrec DocumentAttributeTarget
readList :: ReadS [DocumentAttributeTarget]
$creadList :: ReadS [DocumentAttributeTarget]
readsPrec :: Int -> ReadS DocumentAttributeTarget
$creadsPrec :: Int -> ReadS DocumentAttributeTarget
Prelude.Read, Int -> DocumentAttributeTarget -> ShowS
[DocumentAttributeTarget] -> ShowS
DocumentAttributeTarget -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentAttributeTarget] -> ShowS
$cshowList :: [DocumentAttributeTarget] -> ShowS
show :: DocumentAttributeTarget -> String
$cshow :: DocumentAttributeTarget -> String
showsPrec :: Int -> DocumentAttributeTarget -> ShowS
$cshowsPrec :: Int -> DocumentAttributeTarget -> ShowS
Prelude.Show, forall x. Rep DocumentAttributeTarget x -> DocumentAttributeTarget
forall x. DocumentAttributeTarget -> Rep DocumentAttributeTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DocumentAttributeTarget x -> DocumentAttributeTarget
$cfrom :: forall x. DocumentAttributeTarget -> Rep DocumentAttributeTarget x
Prelude.Generic)
newDocumentAttributeTarget ::
DocumentAttributeTarget
newDocumentAttributeTarget :: DocumentAttributeTarget
newDocumentAttributeTarget =
DocumentAttributeTarget'
{ $sel:targetDocumentAttributeKey:DocumentAttributeTarget' :: Maybe Text
targetDocumentAttributeKey =
forall a. Maybe a
Prelude.Nothing,
$sel:targetDocumentAttributeValue:DocumentAttributeTarget' :: Maybe DocumentAttributeValue
targetDocumentAttributeValue = forall a. Maybe a
Prelude.Nothing,
$sel:targetDocumentAttributeValueDeletion:DocumentAttributeTarget' :: Maybe Bool
targetDocumentAttributeValueDeletion =
forall a. Maybe a
Prelude.Nothing
}
documentAttributeTarget_targetDocumentAttributeKey :: Lens.Lens' DocumentAttributeTarget (Prelude.Maybe Prelude.Text)
documentAttributeTarget_targetDocumentAttributeKey :: Lens' DocumentAttributeTarget (Maybe Text)
documentAttributeTarget_targetDocumentAttributeKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentAttributeTarget' {Maybe Text
targetDocumentAttributeKey :: Maybe Text
$sel:targetDocumentAttributeKey:DocumentAttributeTarget' :: DocumentAttributeTarget -> Maybe Text
targetDocumentAttributeKey} -> Maybe Text
targetDocumentAttributeKey) (\s :: DocumentAttributeTarget
s@DocumentAttributeTarget' {} Maybe Text
a -> DocumentAttributeTarget
s {$sel:targetDocumentAttributeKey:DocumentAttributeTarget' :: Maybe Text
targetDocumentAttributeKey = Maybe Text
a} :: DocumentAttributeTarget)
documentAttributeTarget_targetDocumentAttributeValue :: Lens.Lens' DocumentAttributeTarget (Prelude.Maybe DocumentAttributeValue)
documentAttributeTarget_targetDocumentAttributeValue :: Lens' DocumentAttributeTarget (Maybe DocumentAttributeValue)
documentAttributeTarget_targetDocumentAttributeValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentAttributeTarget' {Maybe DocumentAttributeValue
targetDocumentAttributeValue :: Maybe DocumentAttributeValue
$sel:targetDocumentAttributeValue:DocumentAttributeTarget' :: DocumentAttributeTarget -> Maybe DocumentAttributeValue
targetDocumentAttributeValue} -> Maybe DocumentAttributeValue
targetDocumentAttributeValue) (\s :: DocumentAttributeTarget
s@DocumentAttributeTarget' {} Maybe DocumentAttributeValue
a -> DocumentAttributeTarget
s {$sel:targetDocumentAttributeValue:DocumentAttributeTarget' :: Maybe DocumentAttributeValue
targetDocumentAttributeValue = Maybe DocumentAttributeValue
a} :: DocumentAttributeTarget)
documentAttributeTarget_targetDocumentAttributeValueDeletion :: Lens.Lens' DocumentAttributeTarget (Prelude.Maybe Prelude.Bool)
documentAttributeTarget_targetDocumentAttributeValueDeletion :: Lens' DocumentAttributeTarget (Maybe Bool)
documentAttributeTarget_targetDocumentAttributeValueDeletion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentAttributeTarget' {Maybe Bool
targetDocumentAttributeValueDeletion :: Maybe Bool
$sel:targetDocumentAttributeValueDeletion:DocumentAttributeTarget' :: DocumentAttributeTarget -> Maybe Bool
targetDocumentAttributeValueDeletion} -> Maybe Bool
targetDocumentAttributeValueDeletion) (\s :: DocumentAttributeTarget
s@DocumentAttributeTarget' {} Maybe Bool
a -> DocumentAttributeTarget
s {$sel:targetDocumentAttributeValueDeletion:DocumentAttributeTarget' :: Maybe Bool
targetDocumentAttributeValueDeletion = Maybe Bool
a} :: DocumentAttributeTarget)
instance Data.FromJSON DocumentAttributeTarget where
parseJSON :: Value -> Parser DocumentAttributeTarget
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DocumentAttributeTarget"
( \Object
x ->
Maybe Text
-> Maybe DocumentAttributeValue
-> Maybe Bool
-> DocumentAttributeTarget
DocumentAttributeTarget'
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
"TargetDocumentAttributeKey")
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
"TargetDocumentAttributeValue")
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
"TargetDocumentAttributeValueDeletion")
)
instance Prelude.Hashable DocumentAttributeTarget where
hashWithSalt :: Int -> DocumentAttributeTarget -> Int
hashWithSalt Int
_salt DocumentAttributeTarget' {Maybe Bool
Maybe Text
Maybe DocumentAttributeValue
targetDocumentAttributeValueDeletion :: Maybe Bool
targetDocumentAttributeValue :: Maybe DocumentAttributeValue
targetDocumentAttributeKey :: Maybe Text
$sel:targetDocumentAttributeValueDeletion:DocumentAttributeTarget' :: DocumentAttributeTarget -> Maybe Bool
$sel:targetDocumentAttributeValue:DocumentAttributeTarget' :: DocumentAttributeTarget -> Maybe DocumentAttributeValue
$sel:targetDocumentAttributeKey:DocumentAttributeTarget' :: DocumentAttributeTarget -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetDocumentAttributeKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DocumentAttributeValue
targetDocumentAttributeValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
targetDocumentAttributeValueDeletion
instance Prelude.NFData DocumentAttributeTarget where
rnf :: DocumentAttributeTarget -> ()
rnf DocumentAttributeTarget' {Maybe Bool
Maybe Text
Maybe DocumentAttributeValue
targetDocumentAttributeValueDeletion :: Maybe Bool
targetDocumentAttributeValue :: Maybe DocumentAttributeValue
targetDocumentAttributeKey :: Maybe Text
$sel:targetDocumentAttributeValueDeletion:DocumentAttributeTarget' :: DocumentAttributeTarget -> Maybe Bool
$sel:targetDocumentAttributeValue:DocumentAttributeTarget' :: DocumentAttributeTarget -> Maybe DocumentAttributeValue
$sel:targetDocumentAttributeKey:DocumentAttributeTarget' :: DocumentAttributeTarget -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetDocumentAttributeKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DocumentAttributeValue
targetDocumentAttributeValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
targetDocumentAttributeValueDeletion
instance Data.ToJSON DocumentAttributeTarget where
toJSON :: DocumentAttributeTarget -> Value
toJSON DocumentAttributeTarget' {Maybe Bool
Maybe Text
Maybe DocumentAttributeValue
targetDocumentAttributeValueDeletion :: Maybe Bool
targetDocumentAttributeValue :: Maybe DocumentAttributeValue
targetDocumentAttributeKey :: Maybe Text
$sel:targetDocumentAttributeValueDeletion:DocumentAttributeTarget' :: DocumentAttributeTarget -> Maybe Bool
$sel:targetDocumentAttributeValue:DocumentAttributeTarget' :: DocumentAttributeTarget -> Maybe DocumentAttributeValue
$sel:targetDocumentAttributeKey:DocumentAttributeTarget' :: DocumentAttributeTarget -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"TargetDocumentAttributeKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
targetDocumentAttributeKey,
(Key
"TargetDocumentAttributeValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DocumentAttributeValue
targetDocumentAttributeValue,
(Key
"TargetDocumentAttributeValueDeletion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
targetDocumentAttributeValueDeletion
]
)