{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Kendra.Types.ScoreAttributes
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Kendra.Types.ScoreAttributes 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.ScoreConfidence
import qualified Amazonka.Prelude as Prelude

-- | Provides a relative ranking that indicates how confident Amazon Kendra
-- is that the response matches the query.
--
-- /See:/ 'newScoreAttributes' smart constructor.
data ScoreAttributes = ScoreAttributes'
  { -- | A relative ranking for how well the response matches the query.
    ScoreAttributes -> Maybe ScoreConfidence
scoreConfidence :: Prelude.Maybe ScoreConfidence
  }
  deriving (ScoreAttributes -> ScoreAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScoreAttributes -> ScoreAttributes -> Bool
$c/= :: ScoreAttributes -> ScoreAttributes -> Bool
== :: ScoreAttributes -> ScoreAttributes -> Bool
$c== :: ScoreAttributes -> ScoreAttributes -> Bool
Prelude.Eq, ReadPrec [ScoreAttributes]
ReadPrec ScoreAttributes
Int -> ReadS ScoreAttributes
ReadS [ScoreAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScoreAttributes]
$creadListPrec :: ReadPrec [ScoreAttributes]
readPrec :: ReadPrec ScoreAttributes
$creadPrec :: ReadPrec ScoreAttributes
readList :: ReadS [ScoreAttributes]
$creadList :: ReadS [ScoreAttributes]
readsPrec :: Int -> ReadS ScoreAttributes
$creadsPrec :: Int -> ReadS ScoreAttributes
Prelude.Read, Int -> ScoreAttributes -> ShowS
[ScoreAttributes] -> ShowS
ScoreAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScoreAttributes] -> ShowS
$cshowList :: [ScoreAttributes] -> ShowS
show :: ScoreAttributes -> String
$cshow :: ScoreAttributes -> String
showsPrec :: Int -> ScoreAttributes -> ShowS
$cshowsPrec :: Int -> ScoreAttributes -> ShowS
Prelude.Show, forall x. Rep ScoreAttributes x -> ScoreAttributes
forall x. ScoreAttributes -> Rep ScoreAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScoreAttributes x -> ScoreAttributes
$cfrom :: forall x. ScoreAttributes -> Rep ScoreAttributes x
Prelude.Generic)

-- |
-- Create a value of 'ScoreAttributes' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'scoreConfidence', 'scoreAttributes_scoreConfidence' - A relative ranking for how well the response matches the query.
newScoreAttributes ::
  ScoreAttributes
newScoreAttributes :: ScoreAttributes
newScoreAttributes =
  ScoreAttributes' {$sel:scoreConfidence:ScoreAttributes' :: Maybe ScoreConfidence
scoreConfidence = forall a. Maybe a
Prelude.Nothing}

-- | A relative ranking for how well the response matches the query.
scoreAttributes_scoreConfidence :: Lens.Lens' ScoreAttributes (Prelude.Maybe ScoreConfidence)
scoreAttributes_scoreConfidence :: Lens' ScoreAttributes (Maybe ScoreConfidence)
scoreAttributes_scoreConfidence = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScoreAttributes' {Maybe ScoreConfidence
scoreConfidence :: Maybe ScoreConfidence
$sel:scoreConfidence:ScoreAttributes' :: ScoreAttributes -> Maybe ScoreConfidence
scoreConfidence} -> Maybe ScoreConfidence
scoreConfidence) (\s :: ScoreAttributes
s@ScoreAttributes' {} Maybe ScoreConfidence
a -> ScoreAttributes
s {$sel:scoreConfidence:ScoreAttributes' :: Maybe ScoreConfidence
scoreConfidence = Maybe ScoreConfidence
a} :: ScoreAttributes)

instance Data.FromJSON ScoreAttributes where
  parseJSON :: Value -> Parser ScoreAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ScoreAttributes"
      ( \Object
x ->
          Maybe ScoreConfidence -> ScoreAttributes
ScoreAttributes'
            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
"ScoreConfidence")
      )

instance Prelude.Hashable ScoreAttributes where
  hashWithSalt :: Int -> ScoreAttributes -> Int
hashWithSalt Int
_salt ScoreAttributes' {Maybe ScoreConfidence
scoreConfidence :: Maybe ScoreConfidence
$sel:scoreConfidence:ScoreAttributes' :: ScoreAttributes -> Maybe ScoreConfidence
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ScoreConfidence
scoreConfidence

instance Prelude.NFData ScoreAttributes where
  rnf :: ScoreAttributes -> ()
rnf ScoreAttributes' {Maybe ScoreConfidence
scoreConfidence :: Maybe ScoreConfidence
$sel:scoreConfidence:ScoreAttributes' :: ScoreAttributes -> Maybe ScoreConfidence
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ScoreConfidence
scoreConfidence