{-# 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.DocumentRelevanceConfiguration 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.Relevance
import qualified Amazonka.Prelude as Prelude
data DocumentRelevanceConfiguration = DocumentRelevanceConfiguration'
{
DocumentRelevanceConfiguration -> Text
name :: Prelude.Text,
DocumentRelevanceConfiguration -> Relevance
relevance :: Relevance
}
deriving (DocumentRelevanceConfiguration
-> DocumentRelevanceConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentRelevanceConfiguration
-> DocumentRelevanceConfiguration -> Bool
$c/= :: DocumentRelevanceConfiguration
-> DocumentRelevanceConfiguration -> Bool
== :: DocumentRelevanceConfiguration
-> DocumentRelevanceConfiguration -> Bool
$c== :: DocumentRelevanceConfiguration
-> DocumentRelevanceConfiguration -> Bool
Prelude.Eq, ReadPrec [DocumentRelevanceConfiguration]
ReadPrec DocumentRelevanceConfiguration
Int -> ReadS DocumentRelevanceConfiguration
ReadS [DocumentRelevanceConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentRelevanceConfiguration]
$creadListPrec :: ReadPrec [DocumentRelevanceConfiguration]
readPrec :: ReadPrec DocumentRelevanceConfiguration
$creadPrec :: ReadPrec DocumentRelevanceConfiguration
readList :: ReadS [DocumentRelevanceConfiguration]
$creadList :: ReadS [DocumentRelevanceConfiguration]
readsPrec :: Int -> ReadS DocumentRelevanceConfiguration
$creadsPrec :: Int -> ReadS DocumentRelevanceConfiguration
Prelude.Read, Int -> DocumentRelevanceConfiguration -> ShowS
[DocumentRelevanceConfiguration] -> ShowS
DocumentRelevanceConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentRelevanceConfiguration] -> ShowS
$cshowList :: [DocumentRelevanceConfiguration] -> ShowS
show :: DocumentRelevanceConfiguration -> String
$cshow :: DocumentRelevanceConfiguration -> String
showsPrec :: Int -> DocumentRelevanceConfiguration -> ShowS
$cshowsPrec :: Int -> DocumentRelevanceConfiguration -> ShowS
Prelude.Show, forall x.
Rep DocumentRelevanceConfiguration x
-> DocumentRelevanceConfiguration
forall x.
DocumentRelevanceConfiguration
-> Rep DocumentRelevanceConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DocumentRelevanceConfiguration x
-> DocumentRelevanceConfiguration
$cfrom :: forall x.
DocumentRelevanceConfiguration
-> Rep DocumentRelevanceConfiguration x
Prelude.Generic)
newDocumentRelevanceConfiguration ::
Prelude.Text ->
Relevance ->
DocumentRelevanceConfiguration
newDocumentRelevanceConfiguration :: Text -> Relevance -> DocumentRelevanceConfiguration
newDocumentRelevanceConfiguration Text
pName_ Relevance
pRelevance_ =
DocumentRelevanceConfiguration'
{ $sel:name:DocumentRelevanceConfiguration' :: Text
name = Text
pName_,
$sel:relevance:DocumentRelevanceConfiguration' :: Relevance
relevance = Relevance
pRelevance_
}
documentRelevanceConfiguration_name :: Lens.Lens' DocumentRelevanceConfiguration Prelude.Text
documentRelevanceConfiguration_name :: Lens' DocumentRelevanceConfiguration Text
documentRelevanceConfiguration_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentRelevanceConfiguration' {Text
name :: Text
$sel:name:DocumentRelevanceConfiguration' :: DocumentRelevanceConfiguration -> Text
name} -> Text
name) (\s :: DocumentRelevanceConfiguration
s@DocumentRelevanceConfiguration' {} Text
a -> DocumentRelevanceConfiguration
s {$sel:name:DocumentRelevanceConfiguration' :: Text
name = Text
a} :: DocumentRelevanceConfiguration)
documentRelevanceConfiguration_relevance :: Lens.Lens' DocumentRelevanceConfiguration Relevance
documentRelevanceConfiguration_relevance :: Lens' DocumentRelevanceConfiguration Relevance
documentRelevanceConfiguration_relevance = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentRelevanceConfiguration' {Relevance
relevance :: Relevance
$sel:relevance:DocumentRelevanceConfiguration' :: DocumentRelevanceConfiguration -> Relevance
relevance} -> Relevance
relevance) (\s :: DocumentRelevanceConfiguration
s@DocumentRelevanceConfiguration' {} Relevance
a -> DocumentRelevanceConfiguration
s {$sel:relevance:DocumentRelevanceConfiguration' :: Relevance
relevance = Relevance
a} :: DocumentRelevanceConfiguration)
instance
Prelude.Hashable
DocumentRelevanceConfiguration
where
hashWithSalt :: Int -> DocumentRelevanceConfiguration -> Int
hashWithSalt
Int
_salt
DocumentRelevanceConfiguration' {Text
Relevance
relevance :: Relevance
name :: Text
$sel:relevance:DocumentRelevanceConfiguration' :: DocumentRelevanceConfiguration -> Relevance
$sel:name:DocumentRelevanceConfiguration' :: DocumentRelevanceConfiguration -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Relevance
relevance
instance
Prelude.NFData
DocumentRelevanceConfiguration
where
rnf :: DocumentRelevanceConfiguration -> ()
rnf DocumentRelevanceConfiguration' {Text
Relevance
relevance :: Relevance
name :: Text
$sel:relevance:DocumentRelevanceConfiguration' :: DocumentRelevanceConfiguration -> Relevance
$sel:name:DocumentRelevanceConfiguration' :: DocumentRelevanceConfiguration -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Relevance
relevance
instance Data.ToJSON DocumentRelevanceConfiguration where
toJSON :: DocumentRelevanceConfiguration -> Value
toJSON DocumentRelevanceConfiguration' {Text
Relevance
relevance :: Relevance
name :: Text
$sel:relevance:DocumentRelevanceConfiguration' :: DocumentRelevanceConfiguration -> Relevance
$sel:name:DocumentRelevanceConfiguration' :: DocumentRelevanceConfiguration -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"Relevance" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Relevance
relevance)
]
)