{-# 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.Lens as Lens
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
(KendraConfiguration -> KendraConfiguration -> Bool)
-> (KendraConfiguration -> KendraConfiguration -> Bool)
-> Eq KendraConfiguration
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]
(Int -> ReadS KendraConfiguration)
-> ReadS [KendraConfiguration]
-> ReadPrec KendraConfiguration
-> ReadPrec [KendraConfiguration]
-> Read 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
(Int -> KendraConfiguration -> ShowS)
-> (KendraConfiguration -> String)
-> ([KendraConfiguration] -> ShowS)
-> Show KendraConfiguration
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. KendraConfiguration -> Rep KendraConfiguration x)
-> (forall x. Rep KendraConfiguration x -> KendraConfiguration)
-> Generic KendraConfiguration
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' :: Maybe Text -> Text -> Text -> KendraConfiguration
KendraConfiguration'
{ $sel:queryFilterString:KendraConfiguration' :: Maybe Text
queryFilterString =
Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> KendraConfiguration -> f KendraConfiguration
kendraConfiguration_queryFilterString = (KendraConfiguration -> Maybe Text)
-> (KendraConfiguration -> Maybe Text -> KendraConfiguration)
-> Lens
KendraConfiguration KendraConfiguration (Maybe Text) (Maybe Text)
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 :: (Text -> f Text) -> KendraConfiguration -> f KendraConfiguration
kendraConfiguration_kendraIndex = (KendraConfiguration -> Text)
-> (KendraConfiguration -> Text -> KendraConfiguration)
-> Lens KendraConfiguration KendraConfiguration Text Text
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 :: (Text -> f Text) -> KendraConfiguration -> f KendraConfiguration
kendraConfiguration_role = (KendraConfiguration -> Text)
-> (KendraConfiguration -> Text -> KendraConfiguration)
-> Lens KendraConfiguration KendraConfiguration Text Text
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 Core.FromJSON KendraConfiguration where
parseJSON :: Value -> Parser KendraConfiguration
parseJSON =
String
-> (Object -> Parser KendraConfiguration)
-> Value
-> Parser KendraConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"KendraConfiguration"
( \Object
x ->
Maybe Text -> Text -> Text -> KendraConfiguration
KendraConfiguration'
(Maybe Text -> Text -> Text -> KendraConfiguration)
-> Parser (Maybe Text)
-> Parser (Text -> Text -> KendraConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"queryFilterString")
Parser (Text -> Text -> KendraConfiguration)
-> Parser Text -> Parser (Text -> KendraConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"kendraIndex")
Parser (Text -> KendraConfiguration)
-> Parser Text -> Parser KendraConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"role")
)
instance Prelude.Hashable KendraConfiguration
instance Prelude.NFData KendraConfiguration
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"queryFilterString" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
queryFilterString,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"kendraIndex" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
kendraIndex),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"role" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
role')
]
)