{-# 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.AlertSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LookoutMetrics.Types.AlertStatus
import Amazonka.LookoutMetrics.Types.AlertType
import qualified Amazonka.Prelude as Prelude
data AlertSummary = AlertSummary'
{
AlertSummary -> Maybe Text
alertArn :: Prelude.Maybe Prelude.Text,
AlertSummary -> Maybe Text
alertName :: Prelude.Maybe Prelude.Text,
AlertSummary -> Maybe Natural
alertSensitivityThreshold :: Prelude.Maybe Prelude.Natural,
AlertSummary -> Maybe AlertStatus
alertStatus :: Prelude.Maybe AlertStatus,
AlertSummary -> Maybe AlertType
alertType :: Prelude.Maybe AlertType,
AlertSummary -> Maybe Text
anomalyDetectorArn :: Prelude.Maybe Prelude.Text,
AlertSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
AlertSummary -> Maybe POSIX
lastModificationTime :: Prelude.Maybe Data.POSIX,
AlertSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (AlertSummary -> AlertSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlertSummary -> AlertSummary -> Bool
$c/= :: AlertSummary -> AlertSummary -> Bool
== :: AlertSummary -> AlertSummary -> Bool
$c== :: AlertSummary -> AlertSummary -> Bool
Prelude.Eq, ReadPrec [AlertSummary]
ReadPrec AlertSummary
Int -> ReadS AlertSummary
ReadS [AlertSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AlertSummary]
$creadListPrec :: ReadPrec [AlertSummary]
readPrec :: ReadPrec AlertSummary
$creadPrec :: ReadPrec AlertSummary
readList :: ReadS [AlertSummary]
$creadList :: ReadS [AlertSummary]
readsPrec :: Int -> ReadS AlertSummary
$creadsPrec :: Int -> ReadS AlertSummary
Prelude.Read, Int -> AlertSummary -> ShowS
[AlertSummary] -> ShowS
AlertSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AlertSummary] -> ShowS
$cshowList :: [AlertSummary] -> ShowS
show :: AlertSummary -> String
$cshow :: AlertSummary -> String
showsPrec :: Int -> AlertSummary -> ShowS
$cshowsPrec :: Int -> AlertSummary -> ShowS
Prelude.Show, forall x. Rep AlertSummary x -> AlertSummary
forall x. AlertSummary -> Rep AlertSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AlertSummary x -> AlertSummary
$cfrom :: forall x. AlertSummary -> Rep AlertSummary x
Prelude.Generic)
newAlertSummary ::
AlertSummary
newAlertSummary :: AlertSummary
newAlertSummary =
AlertSummary'
{ $sel:alertArn:AlertSummary' :: Maybe Text
alertArn = forall a. Maybe a
Prelude.Nothing,
$sel:alertName:AlertSummary' :: Maybe Text
alertName = forall a. Maybe a
Prelude.Nothing,
$sel:alertSensitivityThreshold:AlertSummary' :: Maybe Natural
alertSensitivityThreshold = forall a. Maybe a
Prelude.Nothing,
$sel:alertStatus:AlertSummary' :: Maybe AlertStatus
alertStatus = forall a. Maybe a
Prelude.Nothing,
$sel:alertType:AlertSummary' :: Maybe AlertType
alertType = forall a. Maybe a
Prelude.Nothing,
$sel:anomalyDetectorArn:AlertSummary' :: Maybe Text
anomalyDetectorArn = forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:AlertSummary' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:lastModificationTime:AlertSummary' :: Maybe POSIX
lastModificationTime = forall a. Maybe a
Prelude.Nothing,
$sel:tags:AlertSummary' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
}
alertSummary_alertArn :: Lens.Lens' AlertSummary (Prelude.Maybe Prelude.Text)
alertSummary_alertArn :: Lens' AlertSummary (Maybe Text)
alertSummary_alertArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlertSummary' {Maybe Text
alertArn :: Maybe Text
$sel:alertArn:AlertSummary' :: AlertSummary -> Maybe Text
alertArn} -> Maybe Text
alertArn) (\s :: AlertSummary
s@AlertSummary' {} Maybe Text
a -> AlertSummary
s {$sel:alertArn:AlertSummary' :: Maybe Text
alertArn = Maybe Text
a} :: AlertSummary)
alertSummary_alertName :: Lens.Lens' AlertSummary (Prelude.Maybe Prelude.Text)
alertSummary_alertName :: Lens' AlertSummary (Maybe Text)
alertSummary_alertName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlertSummary' {Maybe Text
alertName :: Maybe Text
$sel:alertName:AlertSummary' :: AlertSummary -> Maybe Text
alertName} -> Maybe Text
alertName) (\s :: AlertSummary
s@AlertSummary' {} Maybe Text
a -> AlertSummary
s {$sel:alertName:AlertSummary' :: Maybe Text
alertName = Maybe Text
a} :: AlertSummary)
alertSummary_alertSensitivityThreshold :: Lens.Lens' AlertSummary (Prelude.Maybe Prelude.Natural)
alertSummary_alertSensitivityThreshold :: Lens' AlertSummary (Maybe Natural)
alertSummary_alertSensitivityThreshold = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlertSummary' {Maybe Natural
alertSensitivityThreshold :: Maybe Natural
$sel:alertSensitivityThreshold:AlertSummary' :: AlertSummary -> Maybe Natural
alertSensitivityThreshold} -> Maybe Natural
alertSensitivityThreshold) (\s :: AlertSummary
s@AlertSummary' {} Maybe Natural
a -> AlertSummary
s {$sel:alertSensitivityThreshold:AlertSummary' :: Maybe Natural
alertSensitivityThreshold = Maybe Natural
a} :: AlertSummary)
alertSummary_alertStatus :: Lens.Lens' AlertSummary (Prelude.Maybe AlertStatus)
alertSummary_alertStatus :: Lens' AlertSummary (Maybe AlertStatus)
alertSummary_alertStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlertSummary' {Maybe AlertStatus
alertStatus :: Maybe AlertStatus
$sel:alertStatus:AlertSummary' :: AlertSummary -> Maybe AlertStatus
alertStatus} -> Maybe AlertStatus
alertStatus) (\s :: AlertSummary
s@AlertSummary' {} Maybe AlertStatus
a -> AlertSummary
s {$sel:alertStatus:AlertSummary' :: Maybe AlertStatus
alertStatus = Maybe AlertStatus
a} :: AlertSummary)
alertSummary_alertType :: Lens.Lens' AlertSummary (Prelude.Maybe AlertType)
alertSummary_alertType :: Lens' AlertSummary (Maybe AlertType)
alertSummary_alertType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlertSummary' {Maybe AlertType
alertType :: Maybe AlertType
$sel:alertType:AlertSummary' :: AlertSummary -> Maybe AlertType
alertType} -> Maybe AlertType
alertType) (\s :: AlertSummary
s@AlertSummary' {} Maybe AlertType
a -> AlertSummary
s {$sel:alertType:AlertSummary' :: Maybe AlertType
alertType = Maybe AlertType
a} :: AlertSummary)
alertSummary_anomalyDetectorArn :: Lens.Lens' AlertSummary (Prelude.Maybe Prelude.Text)
alertSummary_anomalyDetectorArn :: Lens' AlertSummary (Maybe Text)
alertSummary_anomalyDetectorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlertSummary' {Maybe Text
anomalyDetectorArn :: Maybe Text
$sel:anomalyDetectorArn:AlertSummary' :: AlertSummary -> Maybe Text
anomalyDetectorArn} -> Maybe Text
anomalyDetectorArn) (\s :: AlertSummary
s@AlertSummary' {} Maybe Text
a -> AlertSummary
s {$sel:anomalyDetectorArn:AlertSummary' :: Maybe Text
anomalyDetectorArn = Maybe Text
a} :: AlertSummary)
alertSummary_creationTime :: Lens.Lens' AlertSummary (Prelude.Maybe Prelude.UTCTime)
alertSummary_creationTime :: Lens' AlertSummary (Maybe UTCTime)
alertSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlertSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:AlertSummary' :: AlertSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: AlertSummary
s@AlertSummary' {} Maybe POSIX
a -> AlertSummary
s {$sel:creationTime:AlertSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: AlertSummary) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time
alertSummary_lastModificationTime :: Lens.Lens' AlertSummary (Prelude.Maybe Prelude.UTCTime)
alertSummary_lastModificationTime :: Lens' AlertSummary (Maybe UTCTime)
alertSummary_lastModificationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlertSummary' {Maybe POSIX
lastModificationTime :: Maybe POSIX
$sel:lastModificationTime:AlertSummary' :: AlertSummary -> Maybe POSIX
lastModificationTime} -> Maybe POSIX
lastModificationTime) (\s :: AlertSummary
s@AlertSummary' {} Maybe POSIX
a -> AlertSummary
s {$sel:lastModificationTime:AlertSummary' :: Maybe POSIX
lastModificationTime = Maybe POSIX
a} :: AlertSummary) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time
alertSummary_tags :: Lens.Lens' AlertSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
alertSummary_tags :: Lens' AlertSummary (Maybe (HashMap Text Text))
alertSummary_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlertSummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:AlertSummary' :: AlertSummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: AlertSummary
s@AlertSummary' {} Maybe (HashMap Text Text)
a -> AlertSummary
s {$sel:tags:AlertSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: AlertSummary) 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
instance Data.FromJSON AlertSummary where
parseJSON :: Value -> Parser AlertSummary
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AlertSummary"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe AlertStatus
-> Maybe AlertType
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> AlertSummary
AlertSummary'
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
"AlertArn")
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
"AlertName")
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
"AlertSensitivityThreshold")
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
"AlertStatus")
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
"AlertType")
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
"AnomalyDetectorArn")
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
"CreationTime")
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
"LastModificationTime")
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
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable AlertSummary where
hashWithSalt :: Int -> AlertSummary -> Int
hashWithSalt Int
_salt AlertSummary' {Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
Maybe AlertStatus
Maybe AlertType
tags :: Maybe (HashMap Text Text)
lastModificationTime :: Maybe POSIX
creationTime :: Maybe POSIX
anomalyDetectorArn :: Maybe Text
alertType :: Maybe AlertType
alertStatus :: Maybe AlertStatus
alertSensitivityThreshold :: Maybe Natural
alertName :: Maybe Text
alertArn :: Maybe Text
$sel:tags:AlertSummary' :: AlertSummary -> Maybe (HashMap Text Text)
$sel:lastModificationTime:AlertSummary' :: AlertSummary -> Maybe POSIX
$sel:creationTime:AlertSummary' :: AlertSummary -> Maybe POSIX
$sel:anomalyDetectorArn:AlertSummary' :: AlertSummary -> Maybe Text
$sel:alertType:AlertSummary' :: AlertSummary -> Maybe AlertType
$sel:alertStatus:AlertSummary' :: AlertSummary -> Maybe AlertStatus
$sel:alertSensitivityThreshold:AlertSummary' :: AlertSummary -> Maybe Natural
$sel:alertName:AlertSummary' :: AlertSummary -> Maybe Text
$sel:alertArn:AlertSummary' :: AlertSummary -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
alertArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
alertName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
alertSensitivityThreshold
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AlertStatus
alertStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AlertType
alertType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
anomalyDetectorArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModificationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
instance Prelude.NFData AlertSummary where
rnf :: AlertSummary -> ()
rnf AlertSummary' {Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
Maybe AlertStatus
Maybe AlertType
tags :: Maybe (HashMap Text Text)
lastModificationTime :: Maybe POSIX
creationTime :: Maybe POSIX
anomalyDetectorArn :: Maybe Text
alertType :: Maybe AlertType
alertStatus :: Maybe AlertStatus
alertSensitivityThreshold :: Maybe Natural
alertName :: Maybe Text
alertArn :: Maybe Text
$sel:tags:AlertSummary' :: AlertSummary -> Maybe (HashMap Text Text)
$sel:lastModificationTime:AlertSummary' :: AlertSummary -> Maybe POSIX
$sel:creationTime:AlertSummary' :: AlertSummary -> Maybe POSIX
$sel:anomalyDetectorArn:AlertSummary' :: AlertSummary -> Maybe Text
$sel:alertType:AlertSummary' :: AlertSummary -> Maybe AlertType
$sel:alertStatus:AlertSummary' :: AlertSummary -> Maybe AlertStatus
$sel:alertSensitivityThreshold:AlertSummary' :: AlertSummary -> Maybe Natural
$sel:alertName:AlertSummary' :: AlertSummary -> Maybe Text
$sel:alertArn:AlertSummary' :: AlertSummary -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
alertArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
alertName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
alertSensitivityThreshold
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AlertStatus
alertStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AlertType
alertType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
anomalyDetectorArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModificationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags