{-# 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.Rekognition.Types.EvaluationResult where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.Summary
data EvaluationResult = EvaluationResult'
{
EvaluationResult -> Maybe Summary
summary :: Prelude.Maybe Summary,
EvaluationResult -> Maybe Double
f1Score :: Prelude.Maybe Prelude.Double
}
deriving (EvaluationResult -> EvaluationResult -> Bool
(EvaluationResult -> EvaluationResult -> Bool)
-> (EvaluationResult -> EvaluationResult -> Bool)
-> Eq EvaluationResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EvaluationResult -> EvaluationResult -> Bool
$c/= :: EvaluationResult -> EvaluationResult -> Bool
== :: EvaluationResult -> EvaluationResult -> Bool
$c== :: EvaluationResult -> EvaluationResult -> Bool
Prelude.Eq, ReadPrec [EvaluationResult]
ReadPrec EvaluationResult
Int -> ReadS EvaluationResult
ReadS [EvaluationResult]
(Int -> ReadS EvaluationResult)
-> ReadS [EvaluationResult]
-> ReadPrec EvaluationResult
-> ReadPrec [EvaluationResult]
-> Read EvaluationResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EvaluationResult]
$creadListPrec :: ReadPrec [EvaluationResult]
readPrec :: ReadPrec EvaluationResult
$creadPrec :: ReadPrec EvaluationResult
readList :: ReadS [EvaluationResult]
$creadList :: ReadS [EvaluationResult]
readsPrec :: Int -> ReadS EvaluationResult
$creadsPrec :: Int -> ReadS EvaluationResult
Prelude.Read, Int -> EvaluationResult -> ShowS
[EvaluationResult] -> ShowS
EvaluationResult -> String
(Int -> EvaluationResult -> ShowS)
-> (EvaluationResult -> String)
-> ([EvaluationResult] -> ShowS)
-> Show EvaluationResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EvaluationResult] -> ShowS
$cshowList :: [EvaluationResult] -> ShowS
show :: EvaluationResult -> String
$cshow :: EvaluationResult -> String
showsPrec :: Int -> EvaluationResult -> ShowS
$cshowsPrec :: Int -> EvaluationResult -> ShowS
Prelude.Show, (forall x. EvaluationResult -> Rep EvaluationResult x)
-> (forall x. Rep EvaluationResult x -> EvaluationResult)
-> Generic EvaluationResult
forall x. Rep EvaluationResult x -> EvaluationResult
forall x. EvaluationResult -> Rep EvaluationResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EvaluationResult x -> EvaluationResult
$cfrom :: forall x. EvaluationResult -> Rep EvaluationResult x
Prelude.Generic)
newEvaluationResult ::
EvaluationResult
newEvaluationResult :: EvaluationResult
newEvaluationResult =
EvaluationResult' :: Maybe Summary -> Maybe Double -> EvaluationResult
EvaluationResult'
{ $sel:summary:EvaluationResult' :: Maybe Summary
summary = Maybe Summary
forall a. Maybe a
Prelude.Nothing,
$sel:f1Score:EvaluationResult' :: Maybe Double
f1Score = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
evaluationResult_summary :: Lens.Lens' EvaluationResult (Prelude.Maybe Summary)
evaluationResult_summary :: (Maybe Summary -> f (Maybe Summary))
-> EvaluationResult -> f EvaluationResult
evaluationResult_summary = (EvaluationResult -> Maybe Summary)
-> (EvaluationResult -> Maybe Summary -> EvaluationResult)
-> Lens
EvaluationResult EvaluationResult (Maybe Summary) (Maybe Summary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationResult' {Maybe Summary
summary :: Maybe Summary
$sel:summary:EvaluationResult' :: EvaluationResult -> Maybe Summary
summary} -> Maybe Summary
summary) (\s :: EvaluationResult
s@EvaluationResult' {} Maybe Summary
a -> EvaluationResult
s {$sel:summary:EvaluationResult' :: Maybe Summary
summary = Maybe Summary
a} :: EvaluationResult)
evaluationResult_f1Score :: Lens.Lens' EvaluationResult (Prelude.Maybe Prelude.Double)
evaluationResult_f1Score :: (Maybe Double -> f (Maybe Double))
-> EvaluationResult -> f EvaluationResult
evaluationResult_f1Score = (EvaluationResult -> Maybe Double)
-> (EvaluationResult -> Maybe Double -> EvaluationResult)
-> Lens
EvaluationResult EvaluationResult (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationResult' {Maybe Double
f1Score :: Maybe Double
$sel:f1Score:EvaluationResult' :: EvaluationResult -> Maybe Double
f1Score} -> Maybe Double
f1Score) (\s :: EvaluationResult
s@EvaluationResult' {} Maybe Double
a -> EvaluationResult
s {$sel:f1Score:EvaluationResult' :: Maybe Double
f1Score = Maybe Double
a} :: EvaluationResult)
instance Core.FromJSON EvaluationResult where
parseJSON :: Value -> Parser EvaluationResult
parseJSON =
String
-> (Object -> Parser EvaluationResult)
-> Value
-> Parser EvaluationResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EvaluationResult"
( \Object
x ->
Maybe Summary -> Maybe Double -> EvaluationResult
EvaluationResult'
(Maybe Summary -> Maybe Double -> EvaluationResult)
-> Parser (Maybe Summary)
-> Parser (Maybe Double -> EvaluationResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Summary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Summary")
Parser (Maybe Double -> EvaluationResult)
-> Parser (Maybe Double) -> Parser EvaluationResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"F1Score")
)
instance Prelude.Hashable EvaluationResult
instance Prelude.NFData EvaluationResult