module Stratosphere.LookoutMetrics.Alert (
module Exports, Alert(..), mkAlert
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.LookoutMetrics.Alert.ActionProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data Alert
=
Alert {Alert -> ()
haddock_workaround_ :: (),
Alert -> ActionProperty
action :: ActionProperty,
Alert -> Maybe (Value Text)
alertDescription :: (Prelude.Maybe (Value Prelude.Text)),
Alert -> Maybe (Value Text)
alertName :: (Prelude.Maybe (Value Prelude.Text)),
Alert -> Value Integer
alertSensitivityThreshold :: (Value Prelude.Integer),
Alert -> Value Text
anomalyDetectorArn :: (Value Prelude.Text)}
deriving stock (Alert -> Alert -> Bool
(Alert -> Alert -> Bool) -> (Alert -> Alert -> Bool) -> Eq Alert
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Alert -> Alert -> Bool
== :: Alert -> Alert -> Bool
$c/= :: Alert -> Alert -> Bool
/= :: Alert -> Alert -> Bool
Prelude.Eq, Int -> Alert -> ShowS
[Alert] -> ShowS
Alert -> String
(Int -> Alert -> ShowS)
-> (Alert -> String) -> ([Alert] -> ShowS) -> Show Alert
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Alert -> ShowS
showsPrec :: Int -> Alert -> ShowS
$cshow :: Alert -> String
show :: Alert -> String
$cshowList :: [Alert] -> ShowS
showList :: [Alert] -> ShowS
Prelude.Show)
mkAlert ::
ActionProperty
-> Value Prelude.Integer -> Value Prelude.Text -> Alert
mkAlert :: ActionProperty -> Value Integer -> Value Text -> Alert
mkAlert ActionProperty
action Value Integer
alertSensitivityThreshold Value Text
anomalyDetectorArn
= Alert
{haddock_workaround_ :: ()
haddock_workaround_ = (), action :: ActionProperty
action = ActionProperty
action,
alertSensitivityThreshold :: Value Integer
alertSensitivityThreshold = Value Integer
alertSensitivityThreshold,
anomalyDetectorArn :: Value Text
anomalyDetectorArn = Value Text
anomalyDetectorArn,
alertDescription :: Maybe (Value Text)
alertDescription = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, alertName :: Maybe (Value Text)
alertName = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Alert where
toResourceProperties :: Alert -> ResourceProperties
toResourceProperties Alert {Maybe (Value Text)
()
Value Integer
Value Text
ActionProperty
haddock_workaround_ :: Alert -> ()
action :: Alert -> ActionProperty
alertDescription :: Alert -> Maybe (Value Text)
alertName :: Alert -> Maybe (Value Text)
alertSensitivityThreshold :: Alert -> Value Integer
anomalyDetectorArn :: Alert -> Value Text
haddock_workaround_ :: ()
action :: ActionProperty
alertDescription :: Maybe (Value Text)
alertName :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
anomalyDetectorArn :: Value Text
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::LookoutMetrics::Alert",
supportsTags :: Bool
supportsTags = Bool
Prelude.False,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"Action" Key -> ActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ActionProperty
action,
Key
"AlertSensitivityThreshold" Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Integer
alertSensitivityThreshold,
Key
"AnomalyDetectorArn" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
anomalyDetectorArn]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AlertDescription" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
alertDescription,
Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AlertName" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
alertName]))}
instance JSON.ToJSON Alert where
toJSON :: Alert -> Value
toJSON Alert {Maybe (Value Text)
()
Value Integer
Value Text
ActionProperty
haddock_workaround_ :: Alert -> ()
action :: Alert -> ActionProperty
alertDescription :: Alert -> Maybe (Value Text)
alertName :: Alert -> Maybe (Value Text)
alertSensitivityThreshold :: Alert -> Value Integer
anomalyDetectorArn :: Alert -> Value Text
haddock_workaround_ :: ()
action :: ActionProperty
alertDescription :: Maybe (Value Text)
alertName :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
anomalyDetectorArn :: Value Text
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"Action" Key -> ActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ActionProperty
action,
Key
"AlertSensitivityThreshold" Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Integer
alertSensitivityThreshold,
Key
"AnomalyDetectorArn" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
anomalyDetectorArn]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AlertDescription" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
alertDescription,
Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AlertName" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
alertName])))
instance Property "Action" Alert where
type PropertyType "Action" Alert = ActionProperty
set :: PropertyType "Action" Alert -> Alert -> Alert
set PropertyType "Action" Alert
newValue Alert {Maybe (Value Text)
()
Value Integer
Value Text
ActionProperty
haddock_workaround_ :: Alert -> ()
action :: Alert -> ActionProperty
alertDescription :: Alert -> Maybe (Value Text)
alertName :: Alert -> Maybe (Value Text)
alertSensitivityThreshold :: Alert -> Value Integer
anomalyDetectorArn :: Alert -> Value Text
haddock_workaround_ :: ()
action :: ActionProperty
alertDescription :: Maybe (Value Text)
alertName :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
anomalyDetectorArn :: Value Text
..} = Alert {action :: ActionProperty
action = PropertyType "Action" Alert
ActionProperty
newValue, Maybe (Value Text)
()
Value Integer
Value Text
haddock_workaround_ :: ()
alertDescription :: Maybe (Value Text)
alertName :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
anomalyDetectorArn :: Value Text
haddock_workaround_ :: ()
alertDescription :: Maybe (Value Text)
alertName :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
anomalyDetectorArn :: Value Text
..}
instance Property "AlertDescription" Alert where
type PropertyType "AlertDescription" Alert = Value Prelude.Text
set :: PropertyType "AlertDescription" Alert -> Alert -> Alert
set PropertyType "AlertDescription" Alert
newValue Alert {Maybe (Value Text)
()
Value Integer
Value Text
ActionProperty
haddock_workaround_ :: Alert -> ()
action :: Alert -> ActionProperty
alertDescription :: Alert -> Maybe (Value Text)
alertName :: Alert -> Maybe (Value Text)
alertSensitivityThreshold :: Alert -> Value Integer
anomalyDetectorArn :: Alert -> Value Text
haddock_workaround_ :: ()
action :: ActionProperty
alertDescription :: Maybe (Value Text)
alertName :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
anomalyDetectorArn :: Value Text
..}
= Alert {alertDescription :: Maybe (Value Text)
alertDescription = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AlertDescription" Alert
Value Text
newValue, Maybe (Value Text)
()
Value Integer
Value Text
ActionProperty
haddock_workaround_ :: ()
action :: ActionProperty
alertName :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
anomalyDetectorArn :: Value Text
haddock_workaround_ :: ()
action :: ActionProperty
alertName :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
anomalyDetectorArn :: Value Text
..}
instance Property "AlertName" Alert where
type PropertyType "AlertName" Alert = Value Prelude.Text
set :: PropertyType "AlertName" Alert -> Alert -> Alert
set PropertyType "AlertName" Alert
newValue Alert {Maybe (Value Text)
()
Value Integer
Value Text
ActionProperty
haddock_workaround_ :: Alert -> ()
action :: Alert -> ActionProperty
alertDescription :: Alert -> Maybe (Value Text)
alertName :: Alert -> Maybe (Value Text)
alertSensitivityThreshold :: Alert -> Value Integer
anomalyDetectorArn :: Alert -> Value Text
haddock_workaround_ :: ()
action :: ActionProperty
alertDescription :: Maybe (Value Text)
alertName :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
anomalyDetectorArn :: Value Text
..}
= Alert {alertName :: Maybe (Value Text)
alertName = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AlertName" Alert
Value Text
newValue, Maybe (Value Text)
()
Value Integer
Value Text
ActionProperty
haddock_workaround_ :: ()
action :: ActionProperty
alertDescription :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
anomalyDetectorArn :: Value Text
haddock_workaround_ :: ()
action :: ActionProperty
alertDescription :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
anomalyDetectorArn :: Value Text
..}
instance Property "AlertSensitivityThreshold" Alert where
type PropertyType "AlertSensitivityThreshold" Alert = Value Prelude.Integer
set :: PropertyType "AlertSensitivityThreshold" Alert -> Alert -> Alert
set PropertyType "AlertSensitivityThreshold" Alert
newValue Alert {Maybe (Value Text)
()
Value Integer
Value Text
ActionProperty
haddock_workaround_ :: Alert -> ()
action :: Alert -> ActionProperty
alertDescription :: Alert -> Maybe (Value Text)
alertName :: Alert -> Maybe (Value Text)
alertSensitivityThreshold :: Alert -> Value Integer
anomalyDetectorArn :: Alert -> Value Text
haddock_workaround_ :: ()
action :: ActionProperty
alertDescription :: Maybe (Value Text)
alertName :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
anomalyDetectorArn :: Value Text
..}
= Alert {alertSensitivityThreshold :: Value Integer
alertSensitivityThreshold = PropertyType "AlertSensitivityThreshold" Alert
Value Integer
newValue, Maybe (Value Text)
()
Value Text
ActionProperty
haddock_workaround_ :: ()
action :: ActionProperty
alertDescription :: Maybe (Value Text)
alertName :: Maybe (Value Text)
anomalyDetectorArn :: Value Text
haddock_workaround_ :: ()
action :: ActionProperty
alertDescription :: Maybe (Value Text)
alertName :: Maybe (Value Text)
anomalyDetectorArn :: Value Text
..}
instance Property "AnomalyDetectorArn" Alert where
type PropertyType "AnomalyDetectorArn" Alert = Value Prelude.Text
set :: PropertyType "AnomalyDetectorArn" Alert -> Alert -> Alert
set PropertyType "AnomalyDetectorArn" Alert
newValue Alert {Maybe (Value Text)
()
Value Integer
Value Text
ActionProperty
haddock_workaround_ :: Alert -> ()
action :: Alert -> ActionProperty
alertDescription :: Alert -> Maybe (Value Text)
alertName :: Alert -> Maybe (Value Text)
alertSensitivityThreshold :: Alert -> Value Integer
anomalyDetectorArn :: Alert -> Value Text
haddock_workaround_ :: ()
action :: ActionProperty
alertDescription :: Maybe (Value Text)
alertName :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
anomalyDetectorArn :: Value Text
..} = Alert {anomalyDetectorArn :: Value Text
anomalyDetectorArn = PropertyType "AnomalyDetectorArn" Alert
Value Text
newValue, Maybe (Value Text)
()
Value Integer
ActionProperty
haddock_workaround_ :: ()
action :: ActionProperty
alertDescription :: Maybe (Value Text)
alertName :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
haddock_workaround_ :: ()
action :: ActionProperty
alertDescription :: Maybe (Value Text)
alertName :: Maybe (Value Text)
alertSensitivityThreshold :: Value Integer
..}