{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LookoutVision.Types.Anomaly
import Amazonka.LookoutVision.Types.ImageSource
import qualified Amazonka.Prelude as Prelude
data DetectAnomalyResult = DetectAnomalyResult'
{
DetectAnomalyResult -> Maybe [Anomaly]
anomalies :: Prelude.Maybe [Anomaly],
DetectAnomalyResult -> Maybe Base64
anomalyMask :: Prelude.Maybe Data.Base64,
DetectAnomalyResult -> Maybe Double
confidence :: Prelude.Maybe Prelude.Double,
DetectAnomalyResult -> Maybe Bool
isAnomalous :: Prelude.Maybe Prelude.Bool,
DetectAnomalyResult -> Maybe ImageSource
source :: Prelude.Maybe ImageSource
}
deriving (DetectAnomalyResult -> DetectAnomalyResult -> Bool
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]
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
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. 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'
{ $sel:anomalies:DetectAnomalyResult' :: Maybe [Anomaly]
anomalies = forall a. Maybe a
Prelude.Nothing,
$sel:anomalyMask:DetectAnomalyResult' :: Maybe Base64
anomalyMask = forall a. Maybe a
Prelude.Nothing,
$sel:confidence:DetectAnomalyResult' :: Maybe Double
confidence = forall a. Maybe a
Prelude.Nothing,
$sel:isAnomalous:DetectAnomalyResult' :: Maybe Bool
isAnomalous = forall a. Maybe a
Prelude.Nothing,
$sel:source:DetectAnomalyResult' :: Maybe ImageSource
source = forall a. Maybe a
Prelude.Nothing
}
detectAnomalyResult_anomalies :: Lens.Lens' DetectAnomalyResult (Prelude.Maybe [Anomaly])
detectAnomalyResult_anomalies :: Lens' DetectAnomalyResult (Maybe [Anomaly])
detectAnomalyResult_anomalies = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectAnomalyResult' {Maybe [Anomaly]
anomalies :: Maybe [Anomaly]
$sel:anomalies:DetectAnomalyResult' :: DetectAnomalyResult -> Maybe [Anomaly]
anomalies} -> Maybe [Anomaly]
anomalies) (\s :: DetectAnomalyResult
s@DetectAnomalyResult' {} Maybe [Anomaly]
a -> DetectAnomalyResult
s {$sel:anomalies:DetectAnomalyResult' :: Maybe [Anomaly]
anomalies = Maybe [Anomaly]
a} :: DetectAnomalyResult) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
detectAnomalyResult_anomalyMask :: Lens.Lens' DetectAnomalyResult (Prelude.Maybe Prelude.ByteString)
detectAnomalyResult_anomalyMask :: Lens' DetectAnomalyResult (Maybe ByteString)
detectAnomalyResult_anomalyMask = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetectAnomalyResult' {Maybe Base64
anomalyMask :: Maybe Base64
$sel:anomalyMask:DetectAnomalyResult' :: DetectAnomalyResult -> Maybe Base64
anomalyMask} -> Maybe Base64
anomalyMask) (\s :: DetectAnomalyResult
s@DetectAnomalyResult' {} Maybe Base64
a -> DetectAnomalyResult
s {$sel:anomalyMask:DetectAnomalyResult' :: Maybe Base64
anomalyMask = Maybe Base64
a} :: DetectAnomalyResult) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping Iso' Base64 ByteString
Data._Base64
detectAnomalyResult_confidence :: Lens.Lens' DetectAnomalyResult (Prelude.Maybe Prelude.Double)
detectAnomalyResult_confidence :: Lens' DetectAnomalyResult (Maybe Double)
detectAnomalyResult_confidence = 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_isAnomalous :: Lens.Lens' DetectAnomalyResult (Prelude.Maybe Prelude.Bool)
detectAnomalyResult_isAnomalous :: Lens' DetectAnomalyResult (Maybe Bool)
detectAnomalyResult_isAnomalous = 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_source :: Lens.Lens' DetectAnomalyResult (Prelude.Maybe ImageSource)
detectAnomalyResult_source :: Lens' DetectAnomalyResult (Maybe ImageSource)
detectAnomalyResult_source = 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 Data.FromJSON DetectAnomalyResult where
parseJSON :: Value -> Parser DetectAnomalyResult
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DetectAnomalyResult"
( \Object
x ->
Maybe [Anomaly]
-> Maybe Base64
-> Maybe Double
-> Maybe Bool
-> Maybe ImageSource
-> DetectAnomalyResult
DetectAnomalyResult'
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
"Anomalies" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AnomalyMask")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Confidence")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IsAnomalous")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Source")
)
instance Prelude.Hashable DetectAnomalyResult where
hashWithSalt :: Int -> DetectAnomalyResult -> Int
hashWithSalt Int
_salt DetectAnomalyResult' {Maybe Bool
Maybe Double
Maybe [Anomaly]
Maybe Base64
Maybe ImageSource
source :: Maybe ImageSource
isAnomalous :: Maybe Bool
confidence :: Maybe Double
anomalyMask :: Maybe Base64
anomalies :: Maybe [Anomaly]
$sel:source:DetectAnomalyResult' :: DetectAnomalyResult -> Maybe ImageSource
$sel:isAnomalous:DetectAnomalyResult' :: DetectAnomalyResult -> Maybe Bool
$sel:confidence:DetectAnomalyResult' :: DetectAnomalyResult -> Maybe Double
$sel:anomalyMask:DetectAnomalyResult' :: DetectAnomalyResult -> Maybe Base64
$sel:anomalies:DetectAnomalyResult' :: DetectAnomalyResult -> Maybe [Anomaly]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Anomaly]
anomalies
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Base64
anomalyMask
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
confidence
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isAnomalous
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ImageSource
source
instance Prelude.NFData DetectAnomalyResult where
rnf :: DetectAnomalyResult -> ()
rnf DetectAnomalyResult' {Maybe Bool
Maybe Double
Maybe [Anomaly]
Maybe Base64
Maybe ImageSource
source :: Maybe ImageSource
isAnomalous :: Maybe Bool
confidence :: Maybe Double
anomalyMask :: Maybe Base64
anomalies :: Maybe [Anomaly]
$sel:source:DetectAnomalyResult' :: DetectAnomalyResult -> Maybe ImageSource
$sel:isAnomalous:DetectAnomalyResult' :: DetectAnomalyResult -> Maybe Bool
$sel:confidence:DetectAnomalyResult' :: DetectAnomalyResult -> Maybe Double
$sel:anomalyMask:DetectAnomalyResult' :: DetectAnomalyResult -> Maybe Base64
$sel:anomalies:DetectAnomalyResult' :: DetectAnomalyResult -> Maybe [Anomaly]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Anomaly]
anomalies
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Base64
anomalyMask
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
confidence
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isAnomalous
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ImageSource
source