{-# 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.Alert 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.Action
import Amazonka.LookoutMetrics.Types.AlertFilters
import Amazonka.LookoutMetrics.Types.AlertStatus
import Amazonka.LookoutMetrics.Types.AlertType
import qualified Amazonka.Prelude as Prelude
data Alert = Alert'
{
Alert -> Maybe Action
action :: Prelude.Maybe Action,
Alert -> Maybe Text
alertArn :: Prelude.Maybe Prelude.Text,
Alert -> Maybe Text
alertDescription :: Prelude.Maybe Prelude.Text,
Alert -> Maybe AlertFilters
alertFilters :: Prelude.Maybe AlertFilters,
Alert -> Maybe Text
alertName :: Prelude.Maybe Prelude.Text,
Alert -> Maybe Natural
alertSensitivityThreshold :: Prelude.Maybe Prelude.Natural,
Alert -> Maybe AlertStatus
alertStatus :: Prelude.Maybe AlertStatus,
Alert -> Maybe AlertType
alertType :: Prelude.Maybe AlertType,
Alert -> Maybe Text
anomalyDetectorArn :: Prelude.Maybe Prelude.Text,
Alert -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
Alert -> Maybe POSIX
lastModificationTime :: Prelude.Maybe Data.POSIX
}
deriving (Alert -> Alert -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Alert -> Alert -> Bool
$c/= :: Alert -> Alert -> Bool
== :: Alert -> Alert -> Bool
$c== :: Alert -> Alert -> Bool
Prelude.Eq, ReadPrec [Alert]
ReadPrec Alert
Int -> ReadS Alert
ReadS [Alert]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Alert]
$creadListPrec :: ReadPrec [Alert]
readPrec :: ReadPrec Alert
$creadPrec :: ReadPrec Alert
readList :: ReadS [Alert]
$creadList :: ReadS [Alert]
readsPrec :: Int -> ReadS Alert
$creadsPrec :: Int -> ReadS Alert
Prelude.Read, Int -> Alert -> ShowS
[Alert] -> ShowS
Alert -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Alert] -> ShowS
$cshowList :: [Alert] -> ShowS
show :: Alert -> String
$cshow :: Alert -> String
showsPrec :: Int -> Alert -> ShowS
$cshowsPrec :: Int -> Alert -> ShowS
Prelude.Show, forall x. Rep Alert x -> Alert
forall x. Alert -> Rep Alert x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Alert x -> Alert
$cfrom :: forall x. Alert -> Rep Alert x
Prelude.Generic)
newAlert ::
Alert
newAlert :: Alert
newAlert =
Alert'
{ $sel:action:Alert' :: Maybe Action
action = forall a. Maybe a
Prelude.Nothing,
$sel:alertArn:Alert' :: Maybe Text
alertArn = forall a. Maybe a
Prelude.Nothing,
$sel:alertDescription:Alert' :: Maybe Text
alertDescription = forall a. Maybe a
Prelude.Nothing,
$sel:alertFilters:Alert' :: Maybe AlertFilters
alertFilters = forall a. Maybe a
Prelude.Nothing,
$sel:alertName:Alert' :: Maybe Text
alertName = forall a. Maybe a
Prelude.Nothing,
$sel:alertSensitivityThreshold:Alert' :: Maybe Natural
alertSensitivityThreshold = forall a. Maybe a
Prelude.Nothing,
$sel:alertStatus:Alert' :: Maybe AlertStatus
alertStatus = forall a. Maybe a
Prelude.Nothing,
$sel:alertType:Alert' :: Maybe AlertType
alertType = forall a. Maybe a
Prelude.Nothing,
$sel:anomalyDetectorArn:Alert' :: Maybe Text
anomalyDetectorArn = forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:Alert' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:lastModificationTime:Alert' :: Maybe POSIX
lastModificationTime = forall a. Maybe a
Prelude.Nothing
}
alert_action :: Lens.Lens' Alert (Prelude.Maybe Action)
alert_action :: Lens' Alert (Maybe Action)
alert_action = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alert' {Maybe Action
action :: Maybe Action
$sel:action:Alert' :: Alert -> Maybe Action
action} -> Maybe Action
action) (\s :: Alert
s@Alert' {} Maybe Action
a -> Alert
s {$sel:action:Alert' :: Maybe Action
action = Maybe Action
a} :: Alert)
alert_alertArn :: Lens.Lens' Alert (Prelude.Maybe Prelude.Text)
alert_alertArn :: Lens' Alert (Maybe Text)
alert_alertArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alert' {Maybe Text
alertArn :: Maybe Text
$sel:alertArn:Alert' :: Alert -> Maybe Text
alertArn} -> Maybe Text
alertArn) (\s :: Alert
s@Alert' {} Maybe Text
a -> Alert
s {$sel:alertArn:Alert' :: Maybe Text
alertArn = Maybe Text
a} :: Alert)
alert_alertDescription :: Lens.Lens' Alert (Prelude.Maybe Prelude.Text)
alert_alertDescription :: Lens' Alert (Maybe Text)
alert_alertDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alert' {Maybe Text
alertDescription :: Maybe Text
$sel:alertDescription:Alert' :: Alert -> Maybe Text
alertDescription} -> Maybe Text
alertDescription) (\s :: Alert
s@Alert' {} Maybe Text
a -> Alert
s {$sel:alertDescription:Alert' :: Maybe Text
alertDescription = Maybe Text
a} :: Alert)
alert_alertFilters :: Lens.Lens' Alert (Prelude.Maybe AlertFilters)
alert_alertFilters :: Lens' Alert (Maybe AlertFilters)
alert_alertFilters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alert' {Maybe AlertFilters
alertFilters :: Maybe AlertFilters
$sel:alertFilters:Alert' :: Alert -> Maybe AlertFilters
alertFilters} -> Maybe AlertFilters
alertFilters) (\s :: Alert
s@Alert' {} Maybe AlertFilters
a -> Alert
s {$sel:alertFilters:Alert' :: Maybe AlertFilters
alertFilters = Maybe AlertFilters
a} :: Alert)
alert_alertName :: Lens.Lens' Alert (Prelude.Maybe Prelude.Text)
alert_alertName :: Lens' Alert (Maybe Text)
alert_alertName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alert' {Maybe Text
alertName :: Maybe Text
$sel:alertName:Alert' :: Alert -> Maybe Text
alertName} -> Maybe Text
alertName) (\s :: Alert
s@Alert' {} Maybe Text
a -> Alert
s {$sel:alertName:Alert' :: Maybe Text
alertName = Maybe Text
a} :: Alert)
alert_alertSensitivityThreshold :: Lens.Lens' Alert (Prelude.Maybe Prelude.Natural)
alert_alertSensitivityThreshold :: Lens' Alert (Maybe Natural)
alert_alertSensitivityThreshold = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alert' {Maybe Natural
alertSensitivityThreshold :: Maybe Natural
$sel:alertSensitivityThreshold:Alert' :: Alert -> Maybe Natural
alertSensitivityThreshold} -> Maybe Natural
alertSensitivityThreshold) (\s :: Alert
s@Alert' {} Maybe Natural
a -> Alert
s {$sel:alertSensitivityThreshold:Alert' :: Maybe Natural
alertSensitivityThreshold = Maybe Natural
a} :: Alert)
alert_alertStatus :: Lens.Lens' Alert (Prelude.Maybe AlertStatus)
alert_alertStatus :: Lens' Alert (Maybe AlertStatus)
alert_alertStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alert' {Maybe AlertStatus
alertStatus :: Maybe AlertStatus
$sel:alertStatus:Alert' :: Alert -> Maybe AlertStatus
alertStatus} -> Maybe AlertStatus
alertStatus) (\s :: Alert
s@Alert' {} Maybe AlertStatus
a -> Alert
s {$sel:alertStatus:Alert' :: Maybe AlertStatus
alertStatus = Maybe AlertStatus
a} :: Alert)
alert_alertType :: Lens.Lens' Alert (Prelude.Maybe AlertType)
alert_alertType :: Lens' Alert (Maybe AlertType)
alert_alertType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alert' {Maybe AlertType
alertType :: Maybe AlertType
$sel:alertType:Alert' :: Alert -> Maybe AlertType
alertType} -> Maybe AlertType
alertType) (\s :: Alert
s@Alert' {} Maybe AlertType
a -> Alert
s {$sel:alertType:Alert' :: Maybe AlertType
alertType = Maybe AlertType
a} :: Alert)
alert_anomalyDetectorArn :: Lens.Lens' Alert (Prelude.Maybe Prelude.Text)
alert_anomalyDetectorArn :: Lens' Alert (Maybe Text)
alert_anomalyDetectorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alert' {Maybe Text
anomalyDetectorArn :: Maybe Text
$sel:anomalyDetectorArn:Alert' :: Alert -> Maybe Text
anomalyDetectorArn} -> Maybe Text
anomalyDetectorArn) (\s :: Alert
s@Alert' {} Maybe Text
a -> Alert
s {$sel:anomalyDetectorArn:Alert' :: Maybe Text
anomalyDetectorArn = Maybe Text
a} :: Alert)
alert_creationTime :: Lens.Lens' Alert (Prelude.Maybe Prelude.UTCTime)
alert_creationTime :: Lens' Alert (Maybe UTCTime)
alert_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alert' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:Alert' :: Alert -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: Alert
s@Alert' {} Maybe POSIX
a -> Alert
s {$sel:creationTime:Alert' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: Alert) 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
alert_lastModificationTime :: Lens.Lens' Alert (Prelude.Maybe Prelude.UTCTime)
alert_lastModificationTime :: Lens' Alert (Maybe UTCTime)
alert_lastModificationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Alert' {Maybe POSIX
lastModificationTime :: Maybe POSIX
$sel:lastModificationTime:Alert' :: Alert -> Maybe POSIX
lastModificationTime} -> Maybe POSIX
lastModificationTime) (\s :: Alert
s@Alert' {} Maybe POSIX
a -> Alert
s {$sel:lastModificationTime:Alert' :: Maybe POSIX
lastModificationTime = Maybe POSIX
a} :: Alert) 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
instance Data.FromJSON Alert where
parseJSON :: Value -> Parser Alert
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Alert"
( \Object
x ->
Maybe Action
-> Maybe Text
-> Maybe Text
-> Maybe AlertFilters
-> Maybe Text
-> Maybe Natural
-> Maybe AlertStatus
-> Maybe AlertType
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Alert
Alert'
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
"Action")
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
"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
"AlertDescription")
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
"AlertFilters")
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")
)
instance Prelude.Hashable Alert where
hashWithSalt :: Int -> Alert -> Int
hashWithSalt Int
_salt Alert' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe AlertStatus
Maybe AlertType
Maybe AlertFilters
Maybe Action
lastModificationTime :: Maybe POSIX
creationTime :: Maybe POSIX
anomalyDetectorArn :: Maybe Text
alertType :: Maybe AlertType
alertStatus :: Maybe AlertStatus
alertSensitivityThreshold :: Maybe Natural
alertName :: Maybe Text
alertFilters :: Maybe AlertFilters
alertDescription :: Maybe Text
alertArn :: Maybe Text
action :: Maybe Action
$sel:lastModificationTime:Alert' :: Alert -> Maybe POSIX
$sel:creationTime:Alert' :: Alert -> Maybe POSIX
$sel:anomalyDetectorArn:Alert' :: Alert -> Maybe Text
$sel:alertType:Alert' :: Alert -> Maybe AlertType
$sel:alertStatus:Alert' :: Alert -> Maybe AlertStatus
$sel:alertSensitivityThreshold:Alert' :: Alert -> Maybe Natural
$sel:alertName:Alert' :: Alert -> Maybe Text
$sel:alertFilters:Alert' :: Alert -> Maybe AlertFilters
$sel:alertDescription:Alert' :: Alert -> Maybe Text
$sel:alertArn:Alert' :: Alert -> Maybe Text
$sel:action:Alert' :: Alert -> Maybe Action
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Action
action
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
alertArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
alertDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AlertFilters
alertFilters
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
instance Prelude.NFData Alert where
rnf :: Alert -> ()
rnf Alert' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe AlertStatus
Maybe AlertType
Maybe AlertFilters
Maybe Action
lastModificationTime :: Maybe POSIX
creationTime :: Maybe POSIX
anomalyDetectorArn :: Maybe Text
alertType :: Maybe AlertType
alertStatus :: Maybe AlertStatus
alertSensitivityThreshold :: Maybe Natural
alertName :: Maybe Text
alertFilters :: Maybe AlertFilters
alertDescription :: Maybe Text
alertArn :: Maybe Text
action :: Maybe Action
$sel:lastModificationTime:Alert' :: Alert -> Maybe POSIX
$sel:creationTime:Alert' :: Alert -> Maybe POSIX
$sel:anomalyDetectorArn:Alert' :: Alert -> Maybe Text
$sel:alertType:Alert' :: Alert -> Maybe AlertType
$sel:alertStatus:Alert' :: Alert -> Maybe AlertStatus
$sel:alertSensitivityThreshold:Alert' :: Alert -> Maybe Natural
$sel:alertName:Alert' :: Alert -> Maybe Text
$sel:alertFilters:Alert' :: Alert -> Maybe AlertFilters
$sel:alertDescription:Alert' :: Alert -> Maybe Text
$sel:alertArn:Alert' :: Alert -> Maybe Text
$sel:action:Alert' :: Alert -> Maybe Action
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Action
action
seq :: forall a b. a -> b -> b
`Prelude.seq` 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
alertDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AlertFilters
alertFilters
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