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