{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Lightsail.PutAlarm
(
PutAlarm (..),
newPutAlarm,
putAlarm_contactProtocols,
putAlarm_datapointsToAlarm,
putAlarm_notificationEnabled,
putAlarm_notificationTriggers,
putAlarm_treatMissingData,
putAlarm_alarmName,
putAlarm_metricName,
putAlarm_monitoredResourceName,
putAlarm_comparisonOperator,
putAlarm_threshold,
putAlarm_evaluationPeriods,
PutAlarmResponse (..),
newPutAlarmResponse,
putAlarmResponse_operations,
putAlarmResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutAlarm = PutAlarm'
{
PutAlarm -> Maybe [ContactProtocol]
contactProtocols :: Prelude.Maybe [ContactProtocol],
PutAlarm -> Maybe Int
datapointsToAlarm :: Prelude.Maybe Prelude.Int,
PutAlarm -> Maybe Bool
notificationEnabled :: Prelude.Maybe Prelude.Bool,
PutAlarm -> Maybe [AlarmState]
notificationTriggers :: Prelude.Maybe [AlarmState],
PutAlarm -> Maybe TreatMissingData
treatMissingData :: Prelude.Maybe TreatMissingData,
PutAlarm -> Text
alarmName :: Prelude.Text,
PutAlarm -> MetricName
metricName :: MetricName,
PutAlarm -> Text
monitoredResourceName :: Prelude.Text,
PutAlarm -> ComparisonOperator
comparisonOperator :: ComparisonOperator,
PutAlarm -> Double
threshold :: Prelude.Double,
PutAlarm -> Int
evaluationPeriods :: Prelude.Int
}
deriving (PutAlarm -> PutAlarm -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAlarm -> PutAlarm -> Bool
$c/= :: PutAlarm -> PutAlarm -> Bool
== :: PutAlarm -> PutAlarm -> Bool
$c== :: PutAlarm -> PutAlarm -> Bool
Prelude.Eq, ReadPrec [PutAlarm]
ReadPrec PutAlarm
Int -> ReadS PutAlarm
ReadS [PutAlarm]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAlarm]
$creadListPrec :: ReadPrec [PutAlarm]
readPrec :: ReadPrec PutAlarm
$creadPrec :: ReadPrec PutAlarm
readList :: ReadS [PutAlarm]
$creadList :: ReadS [PutAlarm]
readsPrec :: Int -> ReadS PutAlarm
$creadsPrec :: Int -> ReadS PutAlarm
Prelude.Read, Int -> PutAlarm -> ShowS
[PutAlarm] -> ShowS
PutAlarm -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAlarm] -> ShowS
$cshowList :: [PutAlarm] -> ShowS
show :: PutAlarm -> String
$cshow :: PutAlarm -> String
showsPrec :: Int -> PutAlarm -> ShowS
$cshowsPrec :: Int -> PutAlarm -> ShowS
Prelude.Show, forall x. Rep PutAlarm x -> PutAlarm
forall x. PutAlarm -> Rep PutAlarm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutAlarm x -> PutAlarm
$cfrom :: forall x. PutAlarm -> Rep PutAlarm x
Prelude.Generic)
newPutAlarm ::
Prelude.Text ->
MetricName ->
Prelude.Text ->
ComparisonOperator ->
Prelude.Double ->
Prelude.Int ->
PutAlarm
newPutAlarm :: Text
-> MetricName
-> Text
-> ComparisonOperator
-> Double
-> Int
-> PutAlarm
newPutAlarm
Text
pAlarmName_
MetricName
pMetricName_
Text
pMonitoredResourceName_
ComparisonOperator
pComparisonOperator_
Double
pThreshold_
Int
pEvaluationPeriods_ =
PutAlarm'
{ $sel:contactProtocols:PutAlarm' :: Maybe [ContactProtocol]
contactProtocols = forall a. Maybe a
Prelude.Nothing,
$sel:datapointsToAlarm:PutAlarm' :: Maybe Int
datapointsToAlarm = forall a. Maybe a
Prelude.Nothing,
$sel:notificationEnabled:PutAlarm' :: Maybe Bool
notificationEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:notificationTriggers:PutAlarm' :: Maybe [AlarmState]
notificationTriggers = forall a. Maybe a
Prelude.Nothing,
$sel:treatMissingData:PutAlarm' :: Maybe TreatMissingData
treatMissingData = forall a. Maybe a
Prelude.Nothing,
$sel:alarmName:PutAlarm' :: Text
alarmName = Text
pAlarmName_,
$sel:metricName:PutAlarm' :: MetricName
metricName = MetricName
pMetricName_,
$sel:monitoredResourceName:PutAlarm' :: Text
monitoredResourceName = Text
pMonitoredResourceName_,
$sel:comparisonOperator:PutAlarm' :: ComparisonOperator
comparisonOperator = ComparisonOperator
pComparisonOperator_,
$sel:threshold:PutAlarm' :: Double
threshold = Double
pThreshold_,
$sel:evaluationPeriods:PutAlarm' :: Int
evaluationPeriods = Int
pEvaluationPeriods_
}
putAlarm_contactProtocols :: Lens.Lens' PutAlarm (Prelude.Maybe [ContactProtocol])
putAlarm_contactProtocols :: Lens' PutAlarm (Maybe [ContactProtocol])
putAlarm_contactProtocols = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAlarm' {Maybe [ContactProtocol]
contactProtocols :: Maybe [ContactProtocol]
$sel:contactProtocols:PutAlarm' :: PutAlarm -> Maybe [ContactProtocol]
contactProtocols} -> Maybe [ContactProtocol]
contactProtocols) (\s :: PutAlarm
s@PutAlarm' {} Maybe [ContactProtocol]
a -> PutAlarm
s {$sel:contactProtocols:PutAlarm' :: Maybe [ContactProtocol]
contactProtocols = Maybe [ContactProtocol]
a} :: PutAlarm) 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
putAlarm_datapointsToAlarm :: Lens.Lens' PutAlarm (Prelude.Maybe Prelude.Int)
putAlarm_datapointsToAlarm :: Lens' PutAlarm (Maybe Int)
putAlarm_datapointsToAlarm = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAlarm' {Maybe Int
datapointsToAlarm :: Maybe Int
$sel:datapointsToAlarm:PutAlarm' :: PutAlarm -> Maybe Int
datapointsToAlarm} -> Maybe Int
datapointsToAlarm) (\s :: PutAlarm
s@PutAlarm' {} Maybe Int
a -> PutAlarm
s {$sel:datapointsToAlarm:PutAlarm' :: Maybe Int
datapointsToAlarm = Maybe Int
a} :: PutAlarm)
putAlarm_notificationEnabled :: Lens.Lens' PutAlarm (Prelude.Maybe Prelude.Bool)
putAlarm_notificationEnabled :: Lens' PutAlarm (Maybe Bool)
putAlarm_notificationEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAlarm' {Maybe Bool
notificationEnabled :: Maybe Bool
$sel:notificationEnabled:PutAlarm' :: PutAlarm -> Maybe Bool
notificationEnabled} -> Maybe Bool
notificationEnabled) (\s :: PutAlarm
s@PutAlarm' {} Maybe Bool
a -> PutAlarm
s {$sel:notificationEnabled:PutAlarm' :: Maybe Bool
notificationEnabled = Maybe Bool
a} :: PutAlarm)
putAlarm_notificationTriggers :: Lens.Lens' PutAlarm (Prelude.Maybe [AlarmState])
putAlarm_notificationTriggers :: Lens' PutAlarm (Maybe [AlarmState])
putAlarm_notificationTriggers = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAlarm' {Maybe [AlarmState]
notificationTriggers :: Maybe [AlarmState]
$sel:notificationTriggers:PutAlarm' :: PutAlarm -> Maybe [AlarmState]
notificationTriggers} -> Maybe [AlarmState]
notificationTriggers) (\s :: PutAlarm
s@PutAlarm' {} Maybe [AlarmState]
a -> PutAlarm
s {$sel:notificationTriggers:PutAlarm' :: Maybe [AlarmState]
notificationTriggers = Maybe [AlarmState]
a} :: PutAlarm) 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
putAlarm_treatMissingData :: Lens.Lens' PutAlarm (Prelude.Maybe TreatMissingData)
putAlarm_treatMissingData :: Lens' PutAlarm (Maybe TreatMissingData)
putAlarm_treatMissingData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAlarm' {Maybe TreatMissingData
treatMissingData :: Maybe TreatMissingData
$sel:treatMissingData:PutAlarm' :: PutAlarm -> Maybe TreatMissingData
treatMissingData} -> Maybe TreatMissingData
treatMissingData) (\s :: PutAlarm
s@PutAlarm' {} Maybe TreatMissingData
a -> PutAlarm
s {$sel:treatMissingData:PutAlarm' :: Maybe TreatMissingData
treatMissingData = Maybe TreatMissingData
a} :: PutAlarm)
putAlarm_alarmName :: Lens.Lens' PutAlarm Prelude.Text
putAlarm_alarmName :: Lens' PutAlarm Text
putAlarm_alarmName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAlarm' {Text
alarmName :: Text
$sel:alarmName:PutAlarm' :: PutAlarm -> Text
alarmName} -> Text
alarmName) (\s :: PutAlarm
s@PutAlarm' {} Text
a -> PutAlarm
s {$sel:alarmName:PutAlarm' :: Text
alarmName = Text
a} :: PutAlarm)
putAlarm_metricName :: Lens.Lens' PutAlarm MetricName
putAlarm_metricName :: Lens' PutAlarm MetricName
putAlarm_metricName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAlarm' {MetricName
metricName :: MetricName
$sel:metricName:PutAlarm' :: PutAlarm -> MetricName
metricName} -> MetricName
metricName) (\s :: PutAlarm
s@PutAlarm' {} MetricName
a -> PutAlarm
s {$sel:metricName:PutAlarm' :: MetricName
metricName = MetricName
a} :: PutAlarm)
putAlarm_monitoredResourceName :: Lens.Lens' PutAlarm Prelude.Text
putAlarm_monitoredResourceName :: Lens' PutAlarm Text
putAlarm_monitoredResourceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAlarm' {Text
monitoredResourceName :: Text
$sel:monitoredResourceName:PutAlarm' :: PutAlarm -> Text
monitoredResourceName} -> Text
monitoredResourceName) (\s :: PutAlarm
s@PutAlarm' {} Text
a -> PutAlarm
s {$sel:monitoredResourceName:PutAlarm' :: Text
monitoredResourceName = Text
a} :: PutAlarm)
putAlarm_comparisonOperator :: Lens.Lens' PutAlarm ComparisonOperator
putAlarm_comparisonOperator :: Lens' PutAlarm ComparisonOperator
putAlarm_comparisonOperator = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAlarm' {ComparisonOperator
comparisonOperator :: ComparisonOperator
$sel:comparisonOperator:PutAlarm' :: PutAlarm -> ComparisonOperator
comparisonOperator} -> ComparisonOperator
comparisonOperator) (\s :: PutAlarm
s@PutAlarm' {} ComparisonOperator
a -> PutAlarm
s {$sel:comparisonOperator:PutAlarm' :: ComparisonOperator
comparisonOperator = ComparisonOperator
a} :: PutAlarm)
putAlarm_threshold :: Lens.Lens' PutAlarm Prelude.Double
putAlarm_threshold :: Lens' PutAlarm Double
putAlarm_threshold = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAlarm' {Double
threshold :: Double
$sel:threshold:PutAlarm' :: PutAlarm -> Double
threshold} -> Double
threshold) (\s :: PutAlarm
s@PutAlarm' {} Double
a -> PutAlarm
s {$sel:threshold:PutAlarm' :: Double
threshold = Double
a} :: PutAlarm)
putAlarm_evaluationPeriods :: Lens.Lens' PutAlarm Prelude.Int
putAlarm_evaluationPeriods :: Lens' PutAlarm Int
putAlarm_evaluationPeriods = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAlarm' {Int
evaluationPeriods :: Int
$sel:evaluationPeriods:PutAlarm' :: PutAlarm -> Int
evaluationPeriods} -> Int
evaluationPeriods) (\s :: PutAlarm
s@PutAlarm' {} Int
a -> PutAlarm
s {$sel:evaluationPeriods:PutAlarm' :: Int
evaluationPeriods = Int
a} :: PutAlarm)
instance Core.AWSRequest PutAlarm where
type AWSResponse PutAlarm = PutAlarmResponse
request :: (Service -> Service) -> PutAlarm -> Request PutAlarm
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutAlarm
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutAlarm)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [Operation] -> Int -> PutAlarmResponse
PutAlarmResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"operations" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PutAlarm where
hashWithSalt :: Int -> PutAlarm -> Int
hashWithSalt Int
_salt PutAlarm' {Double
Int
Maybe Bool
Maybe Int
Maybe [AlarmState]
Maybe [ContactProtocol]
Maybe TreatMissingData
Text
ComparisonOperator
MetricName
evaluationPeriods :: Int
threshold :: Double
comparisonOperator :: ComparisonOperator
monitoredResourceName :: Text
metricName :: MetricName
alarmName :: Text
treatMissingData :: Maybe TreatMissingData
notificationTriggers :: Maybe [AlarmState]
notificationEnabled :: Maybe Bool
datapointsToAlarm :: Maybe Int
contactProtocols :: Maybe [ContactProtocol]
$sel:evaluationPeriods:PutAlarm' :: PutAlarm -> Int
$sel:threshold:PutAlarm' :: PutAlarm -> Double
$sel:comparisonOperator:PutAlarm' :: PutAlarm -> ComparisonOperator
$sel:monitoredResourceName:PutAlarm' :: PutAlarm -> Text
$sel:metricName:PutAlarm' :: PutAlarm -> MetricName
$sel:alarmName:PutAlarm' :: PutAlarm -> Text
$sel:treatMissingData:PutAlarm' :: PutAlarm -> Maybe TreatMissingData
$sel:notificationTriggers:PutAlarm' :: PutAlarm -> Maybe [AlarmState]
$sel:notificationEnabled:PutAlarm' :: PutAlarm -> Maybe Bool
$sel:datapointsToAlarm:PutAlarm' :: PutAlarm -> Maybe Int
$sel:contactProtocols:PutAlarm' :: PutAlarm -> Maybe [ContactProtocol]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ContactProtocol]
contactProtocols
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
datapointsToAlarm
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
notificationEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AlarmState]
notificationTriggers
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TreatMissingData
treatMissingData
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
alarmName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` MetricName
metricName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
monitoredResourceName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ComparisonOperator
comparisonOperator
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
threshold
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
evaluationPeriods
instance Prelude.NFData PutAlarm where
rnf :: PutAlarm -> ()
rnf PutAlarm' {Double
Int
Maybe Bool
Maybe Int
Maybe [AlarmState]
Maybe [ContactProtocol]
Maybe TreatMissingData
Text
ComparisonOperator
MetricName
evaluationPeriods :: Int
threshold :: Double
comparisonOperator :: ComparisonOperator
monitoredResourceName :: Text
metricName :: MetricName
alarmName :: Text
treatMissingData :: Maybe TreatMissingData
notificationTriggers :: Maybe [AlarmState]
notificationEnabled :: Maybe Bool
datapointsToAlarm :: Maybe Int
contactProtocols :: Maybe [ContactProtocol]
$sel:evaluationPeriods:PutAlarm' :: PutAlarm -> Int
$sel:threshold:PutAlarm' :: PutAlarm -> Double
$sel:comparisonOperator:PutAlarm' :: PutAlarm -> ComparisonOperator
$sel:monitoredResourceName:PutAlarm' :: PutAlarm -> Text
$sel:metricName:PutAlarm' :: PutAlarm -> MetricName
$sel:alarmName:PutAlarm' :: PutAlarm -> Text
$sel:treatMissingData:PutAlarm' :: PutAlarm -> Maybe TreatMissingData
$sel:notificationTriggers:PutAlarm' :: PutAlarm -> Maybe [AlarmState]
$sel:notificationEnabled:PutAlarm' :: PutAlarm -> Maybe Bool
$sel:datapointsToAlarm:PutAlarm' :: PutAlarm -> Maybe Int
$sel:contactProtocols:PutAlarm' :: PutAlarm -> Maybe [ContactProtocol]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [ContactProtocol]
contactProtocols
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
datapointsToAlarm
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
notificationEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [AlarmState]
notificationTriggers
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TreatMissingData
treatMissingData
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
alarmName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MetricName
metricName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
monitoredResourceName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ComparisonOperator
comparisonOperator
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
threshold
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
evaluationPeriods
instance Data.ToHeaders PutAlarm where
toHeaders :: PutAlarm -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Lightsail_20161128.PutAlarm" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON PutAlarm where
toJSON :: PutAlarm -> Value
toJSON PutAlarm' {Double
Int
Maybe Bool
Maybe Int
Maybe [AlarmState]
Maybe [ContactProtocol]
Maybe TreatMissingData
Text
ComparisonOperator
MetricName
evaluationPeriods :: Int
threshold :: Double
comparisonOperator :: ComparisonOperator
monitoredResourceName :: Text
metricName :: MetricName
alarmName :: Text
treatMissingData :: Maybe TreatMissingData
notificationTriggers :: Maybe [AlarmState]
notificationEnabled :: Maybe Bool
datapointsToAlarm :: Maybe Int
contactProtocols :: Maybe [ContactProtocol]
$sel:evaluationPeriods:PutAlarm' :: PutAlarm -> Int
$sel:threshold:PutAlarm' :: PutAlarm -> Double
$sel:comparisonOperator:PutAlarm' :: PutAlarm -> ComparisonOperator
$sel:monitoredResourceName:PutAlarm' :: PutAlarm -> Text
$sel:metricName:PutAlarm' :: PutAlarm -> MetricName
$sel:alarmName:PutAlarm' :: PutAlarm -> Text
$sel:treatMissingData:PutAlarm' :: PutAlarm -> Maybe TreatMissingData
$sel:notificationTriggers:PutAlarm' :: PutAlarm -> Maybe [AlarmState]
$sel:notificationEnabled:PutAlarm' :: PutAlarm -> Maybe Bool
$sel:datapointsToAlarm:PutAlarm' :: PutAlarm -> Maybe Int
$sel:contactProtocols:PutAlarm' :: PutAlarm -> Maybe [ContactProtocol]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"contactProtocols" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ContactProtocol]
contactProtocols,
(Key
"datapointsToAlarm" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
datapointsToAlarm,
(Key
"notificationEnabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
notificationEnabled,
(Key
"notificationTriggers" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AlarmState]
notificationTriggers,
(Key
"treatMissingData" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TreatMissingData
treatMissingData,
forall a. a -> Maybe a
Prelude.Just (Key
"alarmName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
alarmName),
forall a. a -> Maybe a
Prelude.Just (Key
"metricName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= MetricName
metricName),
forall a. a -> Maybe a
Prelude.Just
( Key
"monitoredResourceName"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
monitoredResourceName
),
forall a. a -> Maybe a
Prelude.Just
(Key
"comparisonOperator" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ComparisonOperator
comparisonOperator),
forall a. a -> Maybe a
Prelude.Just (Key
"threshold" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Double
threshold),
forall a. a -> Maybe a
Prelude.Just
(Key
"evaluationPeriods" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
evaluationPeriods)
]
)
instance Data.ToPath PutAlarm where
toPath :: PutAlarm -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutAlarm where
toQuery :: PutAlarm -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutAlarmResponse = PutAlarmResponse'
{
PutAlarmResponse -> Maybe [Operation]
operations :: Prelude.Maybe [Operation],
PutAlarmResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutAlarmResponse -> PutAlarmResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAlarmResponse -> PutAlarmResponse -> Bool
$c/= :: PutAlarmResponse -> PutAlarmResponse -> Bool
== :: PutAlarmResponse -> PutAlarmResponse -> Bool
$c== :: PutAlarmResponse -> PutAlarmResponse -> Bool
Prelude.Eq, ReadPrec [PutAlarmResponse]
ReadPrec PutAlarmResponse
Int -> ReadS PutAlarmResponse
ReadS [PutAlarmResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAlarmResponse]
$creadListPrec :: ReadPrec [PutAlarmResponse]
readPrec :: ReadPrec PutAlarmResponse
$creadPrec :: ReadPrec PutAlarmResponse
readList :: ReadS [PutAlarmResponse]
$creadList :: ReadS [PutAlarmResponse]
readsPrec :: Int -> ReadS PutAlarmResponse
$creadsPrec :: Int -> ReadS PutAlarmResponse
Prelude.Read, Int -> PutAlarmResponse -> ShowS
[PutAlarmResponse] -> ShowS
PutAlarmResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAlarmResponse] -> ShowS
$cshowList :: [PutAlarmResponse] -> ShowS
show :: PutAlarmResponse -> String
$cshow :: PutAlarmResponse -> String
showsPrec :: Int -> PutAlarmResponse -> ShowS
$cshowsPrec :: Int -> PutAlarmResponse -> ShowS
Prelude.Show, forall x. Rep PutAlarmResponse x -> PutAlarmResponse
forall x. PutAlarmResponse -> Rep PutAlarmResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutAlarmResponse x -> PutAlarmResponse
$cfrom :: forall x. PutAlarmResponse -> Rep PutAlarmResponse x
Prelude.Generic)
newPutAlarmResponse ::
Prelude.Int ->
PutAlarmResponse
newPutAlarmResponse :: Int -> PutAlarmResponse
newPutAlarmResponse Int
pHttpStatus_ =
PutAlarmResponse'
{ $sel:operations:PutAlarmResponse' :: Maybe [Operation]
operations = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutAlarmResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putAlarmResponse_operations :: Lens.Lens' PutAlarmResponse (Prelude.Maybe [Operation])
putAlarmResponse_operations :: Lens' PutAlarmResponse (Maybe [Operation])
putAlarmResponse_operations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAlarmResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:PutAlarmResponse' :: PutAlarmResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: PutAlarmResponse
s@PutAlarmResponse' {} Maybe [Operation]
a -> PutAlarmResponse
s {$sel:operations:PutAlarmResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: PutAlarmResponse) 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
putAlarmResponse_httpStatus :: Lens.Lens' PutAlarmResponse Prelude.Int
putAlarmResponse_httpStatus :: Lens' PutAlarmResponse Int
putAlarmResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAlarmResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutAlarmResponse' :: PutAlarmResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutAlarmResponse
s@PutAlarmResponse' {} Int
a -> PutAlarmResponse
s {$sel:httpStatus:PutAlarmResponse' :: Int
httpStatus = Int
a} :: PutAlarmResponse)
instance Prelude.NFData PutAlarmResponse where
rnf :: PutAlarmResponse -> ()
rnf PutAlarmResponse' {Int
Maybe [Operation]
httpStatus :: Int
operations :: Maybe [Operation]
$sel:httpStatus:PutAlarmResponse' :: PutAlarmResponse -> Int
$sel:operations:PutAlarmResponse' :: PutAlarmResponse -> Maybe [Operation]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Operation]
operations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus