{-# 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.LexModels.Types.KendraConfiguration 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 KendraConfiguration = KendraConfiguration'
{
KendraConfiguration -> Maybe Text
queryFilterString :: Prelude.Maybe Prelude.Text,
KendraConfiguration -> Text
kendraIndex :: Prelude.Text,
KendraConfiguration -> Text
role' :: Prelude.Text
}
deriving (KendraConfiguration -> KendraConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KendraConfiguration -> KendraConfiguration -> Bool
$c/= :: KendraConfiguration -> KendraConfiguration -> Bool
== :: KendraConfiguration -> KendraConfiguration -> Bool
$c== :: KendraConfiguration -> KendraConfiguration -> Bool
Prelude.Eq, ReadPrec [KendraConfiguration]
ReadPrec KendraConfiguration
Int -> ReadS KendraConfiguration
ReadS [KendraConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KendraConfiguration]
$creadListPrec :: ReadPrec [KendraConfiguration]
readPrec :: ReadPrec KendraConfiguration
$creadPrec :: ReadPrec KendraConfiguration
readList :: ReadS [KendraConfiguration]
$creadList :: ReadS [KendraConfiguration]
readsPrec :: Int -> ReadS KendraConfiguration
$creadsPrec :: Int -> ReadS KendraConfiguration
Prelude.Read, Int -> KendraConfiguration -> ShowS
[KendraConfiguration] -> ShowS
KendraConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KendraConfiguration] -> ShowS
$cshowList :: [KendraConfiguration] -> ShowS
show :: KendraConfiguration -> String
$cshow :: KendraConfiguration -> String
showsPrec :: Int -> KendraConfiguration -> ShowS
$cshowsPrec :: Int -> KendraConfiguration -> ShowS
Prelude.Show, forall x. Rep KendraConfiguration x -> KendraConfiguration
forall x. KendraConfiguration -> Rep KendraConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KendraConfiguration x -> KendraConfiguration
$cfrom :: forall x. KendraConfiguration -> Rep KendraConfiguration x
Prelude.Generic)
newKendraConfiguration ::
Prelude.Text ->
Prelude.Text ->
KendraConfiguration
newKendraConfiguration :: Text -> Text -> KendraConfiguration
newKendraConfiguration Text
pKendraIndex_ Text
pRole_ =
KendraConfiguration'
{ $sel:queryFilterString:KendraConfiguration' :: Maybe Text
queryFilterString =
forall a. Maybe a
Prelude.Nothing,
$sel:kendraIndex:KendraConfiguration' :: Text
kendraIndex = Text
pKendraIndex_,
$sel:role':KendraConfiguration' :: Text
role' = Text
pRole_
}
kendraConfiguration_queryFilterString :: Lens.Lens' KendraConfiguration (Prelude.Maybe Prelude.Text)
kendraConfiguration_queryFilterString :: Lens' KendraConfiguration (Maybe Text)
kendraConfiguration_queryFilterString = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KendraConfiguration' {Maybe Text
queryFilterString :: Maybe Text
$sel:queryFilterString:KendraConfiguration' :: KendraConfiguration -> Maybe Text
queryFilterString} -> Maybe Text
queryFilterString) (\s :: KendraConfiguration
s@KendraConfiguration' {} Maybe Text
a -> KendraConfiguration
s {$sel:queryFilterString:KendraConfiguration' :: Maybe Text
queryFilterString = Maybe Text
a} :: KendraConfiguration)
kendraConfiguration_kendraIndex :: Lens.Lens' KendraConfiguration Prelude.Text
kendraConfiguration_kendraIndex :: Lens' KendraConfiguration Text
kendraConfiguration_kendraIndex = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KendraConfiguration' {Text
kendraIndex :: Text
$sel:kendraIndex:KendraConfiguration' :: KendraConfiguration -> Text
kendraIndex} -> Text
kendraIndex) (\s :: KendraConfiguration
s@KendraConfiguration' {} Text
a -> KendraConfiguration
s {$sel:kendraIndex:KendraConfiguration' :: Text
kendraIndex = Text
a} :: KendraConfiguration)
kendraConfiguration_role :: Lens.Lens' KendraConfiguration Prelude.Text
kendraConfiguration_role :: Lens' KendraConfiguration Text
kendraConfiguration_role = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KendraConfiguration' {Text
role' :: Text
$sel:role':KendraConfiguration' :: KendraConfiguration -> Text
role'} -> Text
role') (\s :: KendraConfiguration
s@KendraConfiguration' {} Text
a -> KendraConfiguration
s {$sel:role':KendraConfiguration' :: Text
role' = Text
a} :: KendraConfiguration)
instance Data.FromJSON KendraConfiguration where
parseJSON :: Value -> Parser KendraConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"KendraConfiguration"
( \Object
x ->
Maybe Text -> Text -> Text -> KendraConfiguration
KendraConfiguration'
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
"queryFilterString")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"kendraIndex")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"role")
)
instance Prelude.Hashable KendraConfiguration where
hashWithSalt :: Int -> KendraConfiguration -> Int
hashWithSalt Int
_salt KendraConfiguration' {Maybe Text
Text
role' :: Text
kendraIndex :: Text
queryFilterString :: Maybe Text
$sel:role':KendraConfiguration' :: KendraConfiguration -> Text
$sel:kendraIndex:KendraConfiguration' :: KendraConfiguration -> Text
$sel:queryFilterString:KendraConfiguration' :: KendraConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
queryFilterString
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
kendraIndex
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
role'
instance Prelude.NFData KendraConfiguration where
rnf :: KendraConfiguration -> ()
rnf KendraConfiguration' {Maybe Text
Text
role' :: Text
kendraIndex :: Text
queryFilterString :: Maybe Text
$sel:role':KendraConfiguration' :: KendraConfiguration -> Text
$sel:kendraIndex:KendraConfiguration' :: KendraConfiguration -> Text
$sel:queryFilterString:KendraConfiguration' :: KendraConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
queryFilterString
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
kendraIndex
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
role'
instance Data.ToJSON KendraConfiguration where
toJSON :: KendraConfiguration -> Value
toJSON KendraConfiguration' {Maybe Text
Text
role' :: Text
kendraIndex :: Text
queryFilterString :: Maybe Text
$sel:role':KendraConfiguration' :: KendraConfiguration -> Text
$sel:kendraIndex:KendraConfiguration' :: KendraConfiguration -> Text
$sel:queryFilterString:KendraConfiguration' :: KendraConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"queryFilterString" 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
queryFilterString,
forall a. a -> Maybe a
Prelude.Just (Key
"kendraIndex" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
kendraIndex),
forall a. a -> Maybe a
Prelude.Just (Key
"role" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
role')
]
)