{-# 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.LookoutMetrics.Types.AnomalyGroupSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AnomalyGroupSummary = AnomalyGroupSummary'
{
AnomalyGroupSummary -> Maybe Text
startTime :: Prelude.Maybe Prelude.Text,
AnomalyGroupSummary -> Maybe Text
anomalyGroupId :: Prelude.Maybe Prelude.Text,
AnomalyGroupSummary -> Maybe Double
anomalyGroupScore :: Prelude.Maybe Prelude.Double,
AnomalyGroupSummary -> Maybe Text
primaryMetricName :: Prelude.Maybe Prelude.Text,
AnomalyGroupSummary -> Maybe Text
endTime :: Prelude.Maybe Prelude.Text
}
deriving (AnomalyGroupSummary -> AnomalyGroupSummary -> Bool
(AnomalyGroupSummary -> AnomalyGroupSummary -> Bool)
-> (AnomalyGroupSummary -> AnomalyGroupSummary -> Bool)
-> Eq AnomalyGroupSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnomalyGroupSummary -> AnomalyGroupSummary -> Bool
$c/= :: AnomalyGroupSummary -> AnomalyGroupSummary -> Bool
== :: AnomalyGroupSummary -> AnomalyGroupSummary -> Bool
$c== :: AnomalyGroupSummary -> AnomalyGroupSummary -> Bool
Prelude.Eq, ReadPrec [AnomalyGroupSummary]
ReadPrec AnomalyGroupSummary
Int -> ReadS AnomalyGroupSummary
ReadS [AnomalyGroupSummary]
(Int -> ReadS AnomalyGroupSummary)
-> ReadS [AnomalyGroupSummary]
-> ReadPrec AnomalyGroupSummary
-> ReadPrec [AnomalyGroupSummary]
-> Read AnomalyGroupSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnomalyGroupSummary]
$creadListPrec :: ReadPrec [AnomalyGroupSummary]
readPrec :: ReadPrec AnomalyGroupSummary
$creadPrec :: ReadPrec AnomalyGroupSummary
readList :: ReadS [AnomalyGroupSummary]
$creadList :: ReadS [AnomalyGroupSummary]
readsPrec :: Int -> ReadS AnomalyGroupSummary
$creadsPrec :: Int -> ReadS AnomalyGroupSummary
Prelude.Read, Int -> AnomalyGroupSummary -> ShowS
[AnomalyGroupSummary] -> ShowS
AnomalyGroupSummary -> String
(Int -> AnomalyGroupSummary -> ShowS)
-> (AnomalyGroupSummary -> String)
-> ([AnomalyGroupSummary] -> ShowS)
-> Show AnomalyGroupSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnomalyGroupSummary] -> ShowS
$cshowList :: [AnomalyGroupSummary] -> ShowS
show :: AnomalyGroupSummary -> String
$cshow :: AnomalyGroupSummary -> String
showsPrec :: Int -> AnomalyGroupSummary -> ShowS
$cshowsPrec :: Int -> AnomalyGroupSummary -> ShowS
Prelude.Show, (forall x. AnomalyGroupSummary -> Rep AnomalyGroupSummary x)
-> (forall x. Rep AnomalyGroupSummary x -> AnomalyGroupSummary)
-> Generic AnomalyGroupSummary
forall x. Rep AnomalyGroupSummary x -> AnomalyGroupSummary
forall x. AnomalyGroupSummary -> Rep AnomalyGroupSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnomalyGroupSummary x -> AnomalyGroupSummary
$cfrom :: forall x. AnomalyGroupSummary -> Rep AnomalyGroupSummary x
Prelude.Generic)
newAnomalyGroupSummary ::
AnomalyGroupSummary
newAnomalyGroupSummary :: AnomalyGroupSummary
newAnomalyGroupSummary =
AnomalyGroupSummary' :: Maybe Text
-> Maybe Text
-> Maybe Double
-> Maybe Text
-> Maybe Text
-> AnomalyGroupSummary
AnomalyGroupSummary'
{ $sel:startTime:AnomalyGroupSummary' :: Maybe Text
startTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:anomalyGroupId:AnomalyGroupSummary' :: Maybe Text
anomalyGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:anomalyGroupScore:AnomalyGroupSummary' :: Maybe Double
anomalyGroupScore = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:primaryMetricName:AnomalyGroupSummary' :: Maybe Text
primaryMetricName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endTime:AnomalyGroupSummary' :: Maybe Text
endTime = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
anomalyGroupSummary_startTime :: Lens.Lens' AnomalyGroupSummary (Prelude.Maybe Prelude.Text)
anomalyGroupSummary_startTime :: (Maybe Text -> f (Maybe Text))
-> AnomalyGroupSummary -> f AnomalyGroupSummary
anomalyGroupSummary_startTime = (AnomalyGroupSummary -> Maybe Text)
-> (AnomalyGroupSummary -> Maybe Text -> AnomalyGroupSummary)
-> Lens
AnomalyGroupSummary AnomalyGroupSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyGroupSummary' {Maybe Text
startTime :: Maybe Text
$sel:startTime:AnomalyGroupSummary' :: AnomalyGroupSummary -> Maybe Text
startTime} -> Maybe Text
startTime) (\s :: AnomalyGroupSummary
s@AnomalyGroupSummary' {} Maybe Text
a -> AnomalyGroupSummary
s {$sel:startTime:AnomalyGroupSummary' :: Maybe Text
startTime = Maybe Text
a} :: AnomalyGroupSummary)
anomalyGroupSummary_anomalyGroupId :: Lens.Lens' AnomalyGroupSummary (Prelude.Maybe Prelude.Text)
anomalyGroupSummary_anomalyGroupId :: (Maybe Text -> f (Maybe Text))
-> AnomalyGroupSummary -> f AnomalyGroupSummary
anomalyGroupSummary_anomalyGroupId = (AnomalyGroupSummary -> Maybe Text)
-> (AnomalyGroupSummary -> Maybe Text -> AnomalyGroupSummary)
-> Lens
AnomalyGroupSummary AnomalyGroupSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyGroupSummary' {Maybe Text
anomalyGroupId :: Maybe Text
$sel:anomalyGroupId:AnomalyGroupSummary' :: AnomalyGroupSummary -> Maybe Text
anomalyGroupId} -> Maybe Text
anomalyGroupId) (\s :: AnomalyGroupSummary
s@AnomalyGroupSummary' {} Maybe Text
a -> AnomalyGroupSummary
s {$sel:anomalyGroupId:AnomalyGroupSummary' :: Maybe Text
anomalyGroupId = Maybe Text
a} :: AnomalyGroupSummary)
anomalyGroupSummary_anomalyGroupScore :: Lens.Lens' AnomalyGroupSummary (Prelude.Maybe Prelude.Double)
anomalyGroupSummary_anomalyGroupScore :: (Maybe Double -> f (Maybe Double))
-> AnomalyGroupSummary -> f AnomalyGroupSummary
anomalyGroupSummary_anomalyGroupScore = (AnomalyGroupSummary -> Maybe Double)
-> (AnomalyGroupSummary -> Maybe Double -> AnomalyGroupSummary)
-> Lens
AnomalyGroupSummary
AnomalyGroupSummary
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyGroupSummary' {Maybe Double
anomalyGroupScore :: Maybe Double
$sel:anomalyGroupScore:AnomalyGroupSummary' :: AnomalyGroupSummary -> Maybe Double
anomalyGroupScore} -> Maybe Double
anomalyGroupScore) (\s :: AnomalyGroupSummary
s@AnomalyGroupSummary' {} Maybe Double
a -> AnomalyGroupSummary
s {$sel:anomalyGroupScore:AnomalyGroupSummary' :: Maybe Double
anomalyGroupScore = Maybe Double
a} :: AnomalyGroupSummary)
anomalyGroupSummary_primaryMetricName :: Lens.Lens' AnomalyGroupSummary (Prelude.Maybe Prelude.Text)
anomalyGroupSummary_primaryMetricName :: (Maybe Text -> f (Maybe Text))
-> AnomalyGroupSummary -> f AnomalyGroupSummary
anomalyGroupSummary_primaryMetricName = (AnomalyGroupSummary -> Maybe Text)
-> (AnomalyGroupSummary -> Maybe Text -> AnomalyGroupSummary)
-> Lens
AnomalyGroupSummary AnomalyGroupSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyGroupSummary' {Maybe Text
primaryMetricName :: Maybe Text
$sel:primaryMetricName:AnomalyGroupSummary' :: AnomalyGroupSummary -> Maybe Text
primaryMetricName} -> Maybe Text
primaryMetricName) (\s :: AnomalyGroupSummary
s@AnomalyGroupSummary' {} Maybe Text
a -> AnomalyGroupSummary
s {$sel:primaryMetricName:AnomalyGroupSummary' :: Maybe Text
primaryMetricName = Maybe Text
a} :: AnomalyGroupSummary)
anomalyGroupSummary_endTime :: Lens.Lens' AnomalyGroupSummary (Prelude.Maybe Prelude.Text)
anomalyGroupSummary_endTime :: (Maybe Text -> f (Maybe Text))
-> AnomalyGroupSummary -> f AnomalyGroupSummary
anomalyGroupSummary_endTime = (AnomalyGroupSummary -> Maybe Text)
-> (AnomalyGroupSummary -> Maybe Text -> AnomalyGroupSummary)
-> Lens
AnomalyGroupSummary AnomalyGroupSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyGroupSummary' {Maybe Text
endTime :: Maybe Text
$sel:endTime:AnomalyGroupSummary' :: AnomalyGroupSummary -> Maybe Text
endTime} -> Maybe Text
endTime) (\s :: AnomalyGroupSummary
s@AnomalyGroupSummary' {} Maybe Text
a -> AnomalyGroupSummary
s {$sel:endTime:AnomalyGroupSummary' :: Maybe Text
endTime = Maybe Text
a} :: AnomalyGroupSummary)
instance Core.FromJSON AnomalyGroupSummary where
parseJSON :: Value -> Parser AnomalyGroupSummary
parseJSON =
String
-> (Object -> Parser AnomalyGroupSummary)
-> Value
-> Parser AnomalyGroupSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AnomalyGroupSummary"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Double
-> Maybe Text
-> Maybe Text
-> AnomalyGroupSummary
AnomalyGroupSummary'
(Maybe Text
-> Maybe Text
-> Maybe Double
-> Maybe Text
-> Maybe Text
-> AnomalyGroupSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Double -> Maybe Text -> Maybe Text -> AnomalyGroupSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StartTime")
Parser
(Maybe Text
-> Maybe Double -> Maybe Text -> Maybe Text -> AnomalyGroupSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Double -> Maybe Text -> Maybe Text -> AnomalyGroupSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AnomalyGroupId")
Parser
(Maybe Double -> Maybe Text -> Maybe Text -> AnomalyGroupSummary)
-> Parser (Maybe Double)
-> Parser (Maybe Text -> Maybe Text -> AnomalyGroupSummary)
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
"AnomalyGroupScore")
Parser (Maybe Text -> Maybe Text -> AnomalyGroupSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AnomalyGroupSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PrimaryMetricName")
Parser (Maybe Text -> AnomalyGroupSummary)
-> Parser (Maybe Text) -> Parser AnomalyGroupSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndTime")
)
instance Prelude.Hashable AnomalyGroupSummary
instance Prelude.NFData AnomalyGroupSummary