{-# 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.CustomDocumentEnrichmentConfiguration 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.HookConfiguration
import Amazonka.Kendra.Types.InlineCustomDocumentEnrichmentConfiguration
import qualified Amazonka.Prelude as Prelude
data CustomDocumentEnrichmentConfiguration = CustomDocumentEnrichmentConfiguration'
{
CustomDocumentEnrichmentConfiguration
-> Maybe [InlineCustomDocumentEnrichmentConfiguration]
inlineConfigurations :: Prelude.Maybe [InlineCustomDocumentEnrichmentConfiguration],
:: Prelude.Maybe HookConfiguration,
:: Prelude.Maybe HookConfiguration,
CustomDocumentEnrichmentConfiguration -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
}
deriving (CustomDocumentEnrichmentConfiguration
-> CustomDocumentEnrichmentConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomDocumentEnrichmentConfiguration
-> CustomDocumentEnrichmentConfiguration -> Bool
$c/= :: CustomDocumentEnrichmentConfiguration
-> CustomDocumentEnrichmentConfiguration -> Bool
== :: CustomDocumentEnrichmentConfiguration
-> CustomDocumentEnrichmentConfiguration -> Bool
$c== :: CustomDocumentEnrichmentConfiguration
-> CustomDocumentEnrichmentConfiguration -> Bool
Prelude.Eq, ReadPrec [CustomDocumentEnrichmentConfiguration]
ReadPrec CustomDocumentEnrichmentConfiguration
Int -> ReadS CustomDocumentEnrichmentConfiguration
ReadS [CustomDocumentEnrichmentConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomDocumentEnrichmentConfiguration]
$creadListPrec :: ReadPrec [CustomDocumentEnrichmentConfiguration]
readPrec :: ReadPrec CustomDocumentEnrichmentConfiguration
$creadPrec :: ReadPrec CustomDocumentEnrichmentConfiguration
readList :: ReadS [CustomDocumentEnrichmentConfiguration]
$creadList :: ReadS [CustomDocumentEnrichmentConfiguration]
readsPrec :: Int -> ReadS CustomDocumentEnrichmentConfiguration
$creadsPrec :: Int -> ReadS CustomDocumentEnrichmentConfiguration
Prelude.Read, Int -> CustomDocumentEnrichmentConfiguration -> ShowS
[CustomDocumentEnrichmentConfiguration] -> ShowS
CustomDocumentEnrichmentConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomDocumentEnrichmentConfiguration] -> ShowS
$cshowList :: [CustomDocumentEnrichmentConfiguration] -> ShowS
show :: CustomDocumentEnrichmentConfiguration -> String
$cshow :: CustomDocumentEnrichmentConfiguration -> String
showsPrec :: Int -> CustomDocumentEnrichmentConfiguration -> ShowS
$cshowsPrec :: Int -> CustomDocumentEnrichmentConfiguration -> ShowS
Prelude.Show, forall x.
Rep CustomDocumentEnrichmentConfiguration x
-> CustomDocumentEnrichmentConfiguration
forall x.
CustomDocumentEnrichmentConfiguration
-> Rep CustomDocumentEnrichmentConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomDocumentEnrichmentConfiguration x
-> CustomDocumentEnrichmentConfiguration
$cfrom :: forall x.
CustomDocumentEnrichmentConfiguration
-> Rep CustomDocumentEnrichmentConfiguration x
Prelude.Generic)
newCustomDocumentEnrichmentConfiguration ::
CustomDocumentEnrichmentConfiguration
newCustomDocumentEnrichmentConfiguration :: CustomDocumentEnrichmentConfiguration
newCustomDocumentEnrichmentConfiguration =
CustomDocumentEnrichmentConfiguration'
{ $sel:inlineConfigurations:CustomDocumentEnrichmentConfiguration' :: Maybe [InlineCustomDocumentEnrichmentConfiguration]
inlineConfigurations =
forall a. Maybe a
Prelude.Nothing,
$sel:postExtractionHookConfiguration:CustomDocumentEnrichmentConfiguration' :: Maybe HookConfiguration
postExtractionHookConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:preExtractionHookConfiguration:CustomDocumentEnrichmentConfiguration' :: Maybe HookConfiguration
preExtractionHookConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:CustomDocumentEnrichmentConfiguration' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing
}
customDocumentEnrichmentConfiguration_inlineConfigurations :: Lens.Lens' CustomDocumentEnrichmentConfiguration (Prelude.Maybe [InlineCustomDocumentEnrichmentConfiguration])
customDocumentEnrichmentConfiguration_inlineConfigurations :: Lens'
CustomDocumentEnrichmentConfiguration
(Maybe [InlineCustomDocumentEnrichmentConfiguration])
customDocumentEnrichmentConfiguration_inlineConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomDocumentEnrichmentConfiguration' {Maybe [InlineCustomDocumentEnrichmentConfiguration]
inlineConfigurations :: Maybe [InlineCustomDocumentEnrichmentConfiguration]
$sel:inlineConfigurations:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration
-> Maybe [InlineCustomDocumentEnrichmentConfiguration]
inlineConfigurations} -> Maybe [InlineCustomDocumentEnrichmentConfiguration]
inlineConfigurations) (\s :: CustomDocumentEnrichmentConfiguration
s@CustomDocumentEnrichmentConfiguration' {} Maybe [InlineCustomDocumentEnrichmentConfiguration]
a -> CustomDocumentEnrichmentConfiguration
s {$sel:inlineConfigurations:CustomDocumentEnrichmentConfiguration' :: Maybe [InlineCustomDocumentEnrichmentConfiguration]
inlineConfigurations = Maybe [InlineCustomDocumentEnrichmentConfiguration]
a} :: CustomDocumentEnrichmentConfiguration) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
customDocumentEnrichmentConfiguration_postExtractionHookConfiguration :: Lens.Lens' CustomDocumentEnrichmentConfiguration (Prelude.Maybe HookConfiguration)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomDocumentEnrichmentConfiguration' {Maybe HookConfiguration
postExtractionHookConfiguration :: Maybe HookConfiguration
$sel:postExtractionHookConfiguration:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration -> Maybe HookConfiguration
postExtractionHookConfiguration} -> Maybe HookConfiguration
postExtractionHookConfiguration) (\s :: CustomDocumentEnrichmentConfiguration
s@CustomDocumentEnrichmentConfiguration' {} Maybe HookConfiguration
a -> CustomDocumentEnrichmentConfiguration
s {$sel:postExtractionHookConfiguration:CustomDocumentEnrichmentConfiguration' :: Maybe HookConfiguration
postExtractionHookConfiguration = Maybe HookConfiguration
a} :: CustomDocumentEnrichmentConfiguration)
customDocumentEnrichmentConfiguration_preExtractionHookConfiguration :: Lens.Lens' CustomDocumentEnrichmentConfiguration (Prelude.Maybe HookConfiguration)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomDocumentEnrichmentConfiguration' {Maybe HookConfiguration
preExtractionHookConfiguration :: Maybe HookConfiguration
$sel:preExtractionHookConfiguration:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration -> Maybe HookConfiguration
preExtractionHookConfiguration} -> Maybe HookConfiguration
preExtractionHookConfiguration) (\s :: CustomDocumentEnrichmentConfiguration
s@CustomDocumentEnrichmentConfiguration' {} Maybe HookConfiguration
a -> CustomDocumentEnrichmentConfiguration
s {$sel:preExtractionHookConfiguration:CustomDocumentEnrichmentConfiguration' :: Maybe HookConfiguration
preExtractionHookConfiguration = Maybe HookConfiguration
a} :: CustomDocumentEnrichmentConfiguration)
customDocumentEnrichmentConfiguration_roleArn :: Lens.Lens' CustomDocumentEnrichmentConfiguration (Prelude.Maybe Prelude.Text)
customDocumentEnrichmentConfiguration_roleArn :: Lens' CustomDocumentEnrichmentConfiguration (Maybe Text)
customDocumentEnrichmentConfiguration_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomDocumentEnrichmentConfiguration' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: CustomDocumentEnrichmentConfiguration
s@CustomDocumentEnrichmentConfiguration' {} Maybe Text
a -> CustomDocumentEnrichmentConfiguration
s {$sel:roleArn:CustomDocumentEnrichmentConfiguration' :: Maybe Text
roleArn = Maybe Text
a} :: CustomDocumentEnrichmentConfiguration)
instance
Data.FromJSON
CustomDocumentEnrichmentConfiguration
where
parseJSON :: Value -> Parser CustomDocumentEnrichmentConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CustomDocumentEnrichmentConfiguration"
( \Object
x ->
Maybe [InlineCustomDocumentEnrichmentConfiguration]
-> Maybe HookConfiguration
-> Maybe HookConfiguration
-> Maybe Text
-> CustomDocumentEnrichmentConfiguration
CustomDocumentEnrichmentConfiguration'
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
"InlineConfigurations"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"PostExtractionHookConfiguration")
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
"PreExtractionHookConfiguration")
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
"RoleArn")
)
instance
Prelude.Hashable
CustomDocumentEnrichmentConfiguration
where
hashWithSalt :: Int -> CustomDocumentEnrichmentConfiguration -> Int
hashWithSalt
Int
_salt
CustomDocumentEnrichmentConfiguration' {Maybe [InlineCustomDocumentEnrichmentConfiguration]
Maybe Text
Maybe HookConfiguration
roleArn :: Maybe Text
preExtractionHookConfiguration :: Maybe HookConfiguration
postExtractionHookConfiguration :: Maybe HookConfiguration
inlineConfigurations :: Maybe [InlineCustomDocumentEnrichmentConfiguration]
$sel:roleArn:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration -> Maybe Text
$sel:preExtractionHookConfiguration:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration -> Maybe HookConfiguration
$sel:postExtractionHookConfiguration:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration -> Maybe HookConfiguration
$sel:inlineConfigurations:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration
-> Maybe [InlineCustomDocumentEnrichmentConfiguration]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [InlineCustomDocumentEnrichmentConfiguration]
inlineConfigurations
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HookConfiguration
postExtractionHookConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HookConfiguration
preExtractionHookConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn
instance
Prelude.NFData
CustomDocumentEnrichmentConfiguration
where
rnf :: CustomDocumentEnrichmentConfiguration -> ()
rnf CustomDocumentEnrichmentConfiguration' {Maybe [InlineCustomDocumentEnrichmentConfiguration]
Maybe Text
Maybe HookConfiguration
roleArn :: Maybe Text
preExtractionHookConfiguration :: Maybe HookConfiguration
postExtractionHookConfiguration :: Maybe HookConfiguration
inlineConfigurations :: Maybe [InlineCustomDocumentEnrichmentConfiguration]
$sel:roleArn:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration -> Maybe Text
$sel:preExtractionHookConfiguration:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration -> Maybe HookConfiguration
$sel:postExtractionHookConfiguration:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration -> Maybe HookConfiguration
$sel:inlineConfigurations:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration
-> Maybe [InlineCustomDocumentEnrichmentConfiguration]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [InlineCustomDocumentEnrichmentConfiguration]
inlineConfigurations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HookConfiguration
postExtractionHookConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HookConfiguration
preExtractionHookConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn
instance
Data.ToJSON
CustomDocumentEnrichmentConfiguration
where
toJSON :: CustomDocumentEnrichmentConfiguration -> Value
toJSON CustomDocumentEnrichmentConfiguration' {Maybe [InlineCustomDocumentEnrichmentConfiguration]
Maybe Text
Maybe HookConfiguration
roleArn :: Maybe Text
preExtractionHookConfiguration :: Maybe HookConfiguration
postExtractionHookConfiguration :: Maybe HookConfiguration
inlineConfigurations :: Maybe [InlineCustomDocumentEnrichmentConfiguration]
$sel:roleArn:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration -> Maybe Text
$sel:preExtractionHookConfiguration:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration -> Maybe HookConfiguration
$sel:postExtractionHookConfiguration:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration -> Maybe HookConfiguration
$sel:inlineConfigurations:CustomDocumentEnrichmentConfiguration' :: CustomDocumentEnrichmentConfiguration
-> Maybe [InlineCustomDocumentEnrichmentConfiguration]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"InlineConfigurations" 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 [InlineCustomDocumentEnrichmentConfiguration]
inlineConfigurations,
(Key
"PostExtractionHookConfiguration" 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 HookConfiguration
postExtractionHookConfiguration,
(Key
"PreExtractionHookConfiguration" 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 HookConfiguration
preExtractionHookConfiguration,
(Key
"RoleArn" 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
roleArn
]
)