{-# 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.IoTEvents.CreateAlarmModel
(
CreateAlarmModel (..),
newCreateAlarmModel,
createAlarmModel_alarmCapabilities,
createAlarmModel_alarmEventActions,
createAlarmModel_alarmModelDescription,
createAlarmModel_alarmNotification,
createAlarmModel_key,
createAlarmModel_severity,
createAlarmModel_tags,
createAlarmModel_alarmModelName,
createAlarmModel_roleArn,
createAlarmModel_alarmRule,
CreateAlarmModelResponse (..),
newCreateAlarmModelResponse,
createAlarmModelResponse_alarmModelArn,
createAlarmModelResponse_alarmModelVersion,
createAlarmModelResponse_creationTime,
createAlarmModelResponse_lastUpdateTime,
createAlarmModelResponse_status,
createAlarmModelResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTEvents.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateAlarmModel = CreateAlarmModel'
{
CreateAlarmModel -> Maybe AlarmCapabilities
alarmCapabilities :: Prelude.Maybe AlarmCapabilities,
CreateAlarmModel -> Maybe AlarmEventActions
alarmEventActions :: Prelude.Maybe AlarmEventActions,
CreateAlarmModel -> Maybe Text
alarmModelDescription :: Prelude.Maybe Prelude.Text,
CreateAlarmModel -> Maybe AlarmNotification
alarmNotification :: Prelude.Maybe AlarmNotification,
CreateAlarmModel -> Maybe Text
key :: Prelude.Maybe Prelude.Text,
CreateAlarmModel -> Maybe Natural
severity :: Prelude.Maybe Prelude.Natural,
CreateAlarmModel -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateAlarmModel -> Text
alarmModelName :: Prelude.Text,
CreateAlarmModel -> Text
roleArn :: Prelude.Text,
CreateAlarmModel -> AlarmRule
alarmRule :: AlarmRule
}
deriving (CreateAlarmModel -> CreateAlarmModel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAlarmModel -> CreateAlarmModel -> Bool
$c/= :: CreateAlarmModel -> CreateAlarmModel -> Bool
== :: CreateAlarmModel -> CreateAlarmModel -> Bool
$c== :: CreateAlarmModel -> CreateAlarmModel -> Bool
Prelude.Eq, ReadPrec [CreateAlarmModel]
ReadPrec CreateAlarmModel
Int -> ReadS CreateAlarmModel
ReadS [CreateAlarmModel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAlarmModel]
$creadListPrec :: ReadPrec [CreateAlarmModel]
readPrec :: ReadPrec CreateAlarmModel
$creadPrec :: ReadPrec CreateAlarmModel
readList :: ReadS [CreateAlarmModel]
$creadList :: ReadS [CreateAlarmModel]
readsPrec :: Int -> ReadS CreateAlarmModel
$creadsPrec :: Int -> ReadS CreateAlarmModel
Prelude.Read, Int -> CreateAlarmModel -> ShowS
[CreateAlarmModel] -> ShowS
CreateAlarmModel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAlarmModel] -> ShowS
$cshowList :: [CreateAlarmModel] -> ShowS
show :: CreateAlarmModel -> String
$cshow :: CreateAlarmModel -> String
showsPrec :: Int -> CreateAlarmModel -> ShowS
$cshowsPrec :: Int -> CreateAlarmModel -> ShowS
Prelude.Show, forall x. Rep CreateAlarmModel x -> CreateAlarmModel
forall x. CreateAlarmModel -> Rep CreateAlarmModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAlarmModel x -> CreateAlarmModel
$cfrom :: forall x. CreateAlarmModel -> Rep CreateAlarmModel x
Prelude.Generic)
newCreateAlarmModel ::
Prelude.Text ->
Prelude.Text ->
AlarmRule ->
CreateAlarmModel
newCreateAlarmModel :: Text -> Text -> AlarmRule -> CreateAlarmModel
newCreateAlarmModel
Text
pAlarmModelName_
Text
pRoleArn_
AlarmRule
pAlarmRule_ =
CreateAlarmModel'
{ $sel:alarmCapabilities:CreateAlarmModel' :: Maybe AlarmCapabilities
alarmCapabilities =
forall a. Maybe a
Prelude.Nothing,
$sel:alarmEventActions:CreateAlarmModel' :: Maybe AlarmEventActions
alarmEventActions = forall a. Maybe a
Prelude.Nothing,
$sel:alarmModelDescription:CreateAlarmModel' :: Maybe Text
alarmModelDescription = forall a. Maybe a
Prelude.Nothing,
$sel:alarmNotification:CreateAlarmModel' :: Maybe AlarmNotification
alarmNotification = forall a. Maybe a
Prelude.Nothing,
$sel:key:CreateAlarmModel' :: Maybe Text
key = forall a. Maybe a
Prelude.Nothing,
$sel:severity:CreateAlarmModel' :: Maybe Natural
severity = forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateAlarmModel' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:alarmModelName:CreateAlarmModel' :: Text
alarmModelName = Text
pAlarmModelName_,
$sel:roleArn:CreateAlarmModel' :: Text
roleArn = Text
pRoleArn_,
$sel:alarmRule:CreateAlarmModel' :: AlarmRule
alarmRule = AlarmRule
pAlarmRule_
}
createAlarmModel_alarmCapabilities :: Lens.Lens' CreateAlarmModel (Prelude.Maybe AlarmCapabilities)
createAlarmModel_alarmCapabilities :: Lens' CreateAlarmModel (Maybe AlarmCapabilities)
createAlarmModel_alarmCapabilities = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Maybe AlarmCapabilities
alarmCapabilities :: Maybe AlarmCapabilities
$sel:alarmCapabilities:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmCapabilities
alarmCapabilities} -> Maybe AlarmCapabilities
alarmCapabilities) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Maybe AlarmCapabilities
a -> CreateAlarmModel
s {$sel:alarmCapabilities:CreateAlarmModel' :: Maybe AlarmCapabilities
alarmCapabilities = Maybe AlarmCapabilities
a} :: CreateAlarmModel)
createAlarmModel_alarmEventActions :: Lens.Lens' CreateAlarmModel (Prelude.Maybe AlarmEventActions)
createAlarmModel_alarmEventActions :: Lens' CreateAlarmModel (Maybe AlarmEventActions)
createAlarmModel_alarmEventActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Maybe AlarmEventActions
alarmEventActions :: Maybe AlarmEventActions
$sel:alarmEventActions:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmEventActions
alarmEventActions} -> Maybe AlarmEventActions
alarmEventActions) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Maybe AlarmEventActions
a -> CreateAlarmModel
s {$sel:alarmEventActions:CreateAlarmModel' :: Maybe AlarmEventActions
alarmEventActions = Maybe AlarmEventActions
a} :: CreateAlarmModel)
createAlarmModel_alarmModelDescription :: Lens.Lens' CreateAlarmModel (Prelude.Maybe Prelude.Text)
createAlarmModel_alarmModelDescription :: Lens' CreateAlarmModel (Maybe Text)
createAlarmModel_alarmModelDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Maybe Text
alarmModelDescription :: Maybe Text
$sel:alarmModelDescription:CreateAlarmModel' :: CreateAlarmModel -> Maybe Text
alarmModelDescription} -> Maybe Text
alarmModelDescription) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Maybe Text
a -> CreateAlarmModel
s {$sel:alarmModelDescription:CreateAlarmModel' :: Maybe Text
alarmModelDescription = Maybe Text
a} :: CreateAlarmModel)
createAlarmModel_alarmNotification :: Lens.Lens' CreateAlarmModel (Prelude.Maybe AlarmNotification)
createAlarmModel_alarmNotification :: Lens' CreateAlarmModel (Maybe AlarmNotification)
createAlarmModel_alarmNotification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Maybe AlarmNotification
alarmNotification :: Maybe AlarmNotification
$sel:alarmNotification:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmNotification
alarmNotification} -> Maybe AlarmNotification
alarmNotification) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Maybe AlarmNotification
a -> CreateAlarmModel
s {$sel:alarmNotification:CreateAlarmModel' :: Maybe AlarmNotification
alarmNotification = Maybe AlarmNotification
a} :: CreateAlarmModel)
createAlarmModel_key :: Lens.Lens' CreateAlarmModel (Prelude.Maybe Prelude.Text)
createAlarmModel_key :: Lens' CreateAlarmModel (Maybe Text)
createAlarmModel_key = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Maybe Text
key :: Maybe Text
$sel:key:CreateAlarmModel' :: CreateAlarmModel -> Maybe Text
key} -> Maybe Text
key) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Maybe Text
a -> CreateAlarmModel
s {$sel:key:CreateAlarmModel' :: Maybe Text
key = Maybe Text
a} :: CreateAlarmModel)
createAlarmModel_severity :: Lens.Lens' CreateAlarmModel (Prelude.Maybe Prelude.Natural)
createAlarmModel_severity :: Lens' CreateAlarmModel (Maybe Natural)
createAlarmModel_severity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Maybe Natural
severity :: Maybe Natural
$sel:severity:CreateAlarmModel' :: CreateAlarmModel -> Maybe Natural
severity} -> Maybe Natural
severity) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Maybe Natural
a -> CreateAlarmModel
s {$sel:severity:CreateAlarmModel' :: Maybe Natural
severity = Maybe Natural
a} :: CreateAlarmModel)
createAlarmModel_tags :: Lens.Lens' CreateAlarmModel (Prelude.Maybe [Tag])
createAlarmModel_tags :: Lens' CreateAlarmModel (Maybe [Tag])
createAlarmModel_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateAlarmModel' :: CreateAlarmModel -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Maybe [Tag]
a -> CreateAlarmModel
s {$sel:tags:CreateAlarmModel' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateAlarmModel) 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
createAlarmModel_alarmModelName :: Lens.Lens' CreateAlarmModel Prelude.Text
createAlarmModel_alarmModelName :: Lens' CreateAlarmModel Text
createAlarmModel_alarmModelName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Text
alarmModelName :: Text
$sel:alarmModelName:CreateAlarmModel' :: CreateAlarmModel -> Text
alarmModelName} -> Text
alarmModelName) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Text
a -> CreateAlarmModel
s {$sel:alarmModelName:CreateAlarmModel' :: Text
alarmModelName = Text
a} :: CreateAlarmModel)
createAlarmModel_roleArn :: Lens.Lens' CreateAlarmModel Prelude.Text
createAlarmModel_roleArn :: Lens' CreateAlarmModel Text
createAlarmModel_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Text
roleArn :: Text
$sel:roleArn:CreateAlarmModel' :: CreateAlarmModel -> Text
roleArn} -> Text
roleArn) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Text
a -> CreateAlarmModel
s {$sel:roleArn:CreateAlarmModel' :: Text
roleArn = Text
a} :: CreateAlarmModel)
createAlarmModel_alarmRule :: Lens.Lens' CreateAlarmModel AlarmRule
createAlarmModel_alarmRule :: Lens' CreateAlarmModel AlarmRule
createAlarmModel_alarmRule = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {AlarmRule
alarmRule :: AlarmRule
$sel:alarmRule:CreateAlarmModel' :: CreateAlarmModel -> AlarmRule
alarmRule} -> AlarmRule
alarmRule) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} AlarmRule
a -> CreateAlarmModel
s {$sel:alarmRule:CreateAlarmModel' :: AlarmRule
alarmRule = AlarmRule
a} :: CreateAlarmModel)
instance Core.AWSRequest CreateAlarmModel where
type
AWSResponse CreateAlarmModel =
CreateAlarmModelResponse
request :: (Service -> Service)
-> CreateAlarmModel -> Request CreateAlarmModel
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 CreateAlarmModel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateAlarmModel)))
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 Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe AlarmModelVersionStatus
-> Int
-> CreateAlarmModelResponse
CreateAlarmModelResponse'
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
"alarmModelArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"alarmModelVersion")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (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 -> Either String (Maybe a)
Data..?> Key
"lastUpdateTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"status")
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 CreateAlarmModel where
hashWithSalt :: Int -> CreateAlarmModel -> Int
hashWithSalt Int
_salt CreateAlarmModel' {Maybe Natural
Maybe [Tag]
Maybe Text
Maybe AlarmCapabilities
Maybe AlarmNotification
Maybe AlarmEventActions
Text
AlarmRule
alarmRule :: AlarmRule
roleArn :: Text
alarmModelName :: Text
tags :: Maybe [Tag]
severity :: Maybe Natural
key :: Maybe Text
alarmNotification :: Maybe AlarmNotification
alarmModelDescription :: Maybe Text
alarmEventActions :: Maybe AlarmEventActions
alarmCapabilities :: Maybe AlarmCapabilities
$sel:alarmRule:CreateAlarmModel' :: CreateAlarmModel -> AlarmRule
$sel:roleArn:CreateAlarmModel' :: CreateAlarmModel -> Text
$sel:alarmModelName:CreateAlarmModel' :: CreateAlarmModel -> Text
$sel:tags:CreateAlarmModel' :: CreateAlarmModel -> Maybe [Tag]
$sel:severity:CreateAlarmModel' :: CreateAlarmModel -> Maybe Natural
$sel:key:CreateAlarmModel' :: CreateAlarmModel -> Maybe Text
$sel:alarmNotification:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmNotification
$sel:alarmModelDescription:CreateAlarmModel' :: CreateAlarmModel -> Maybe Text
$sel:alarmEventActions:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmEventActions
$sel:alarmCapabilities:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmCapabilities
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AlarmCapabilities
alarmCapabilities
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AlarmEventActions
alarmEventActions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
alarmModelDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AlarmNotification
alarmNotification
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
key
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
severity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
alarmModelName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AlarmRule
alarmRule
instance Prelude.NFData CreateAlarmModel where
rnf :: CreateAlarmModel -> ()
rnf CreateAlarmModel' {Maybe Natural
Maybe [Tag]
Maybe Text
Maybe AlarmCapabilities
Maybe AlarmNotification
Maybe AlarmEventActions
Text
AlarmRule
alarmRule :: AlarmRule
roleArn :: Text
alarmModelName :: Text
tags :: Maybe [Tag]
severity :: Maybe Natural
key :: Maybe Text
alarmNotification :: Maybe AlarmNotification
alarmModelDescription :: Maybe Text
alarmEventActions :: Maybe AlarmEventActions
alarmCapabilities :: Maybe AlarmCapabilities
$sel:alarmRule:CreateAlarmModel' :: CreateAlarmModel -> AlarmRule
$sel:roleArn:CreateAlarmModel' :: CreateAlarmModel -> Text
$sel:alarmModelName:CreateAlarmModel' :: CreateAlarmModel -> Text
$sel:tags:CreateAlarmModel' :: CreateAlarmModel -> Maybe [Tag]
$sel:severity:CreateAlarmModel' :: CreateAlarmModel -> Maybe Natural
$sel:key:CreateAlarmModel' :: CreateAlarmModel -> Maybe Text
$sel:alarmNotification:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmNotification
$sel:alarmModelDescription:CreateAlarmModel' :: CreateAlarmModel -> Maybe Text
$sel:alarmEventActions:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmEventActions
$sel:alarmCapabilities:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmCapabilities
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AlarmCapabilities
alarmCapabilities
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AlarmEventActions
alarmEventActions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
alarmModelDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AlarmNotification
alarmNotification
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
key
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
severity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
alarmModelName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AlarmRule
alarmRule
instance Data.ToHeaders CreateAlarmModel where
toHeaders :: CreateAlarmModel -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON CreateAlarmModel where
toJSON :: CreateAlarmModel -> Value
toJSON CreateAlarmModel' {Maybe Natural
Maybe [Tag]
Maybe Text
Maybe AlarmCapabilities
Maybe AlarmNotification
Maybe AlarmEventActions
Text
AlarmRule
alarmRule :: AlarmRule
roleArn :: Text
alarmModelName :: Text
tags :: Maybe [Tag]
severity :: Maybe Natural
key :: Maybe Text
alarmNotification :: Maybe AlarmNotification
alarmModelDescription :: Maybe Text
alarmEventActions :: Maybe AlarmEventActions
alarmCapabilities :: Maybe AlarmCapabilities
$sel:alarmRule:CreateAlarmModel' :: CreateAlarmModel -> AlarmRule
$sel:roleArn:CreateAlarmModel' :: CreateAlarmModel -> Text
$sel:alarmModelName:CreateAlarmModel' :: CreateAlarmModel -> Text
$sel:tags:CreateAlarmModel' :: CreateAlarmModel -> Maybe [Tag]
$sel:severity:CreateAlarmModel' :: CreateAlarmModel -> Maybe Natural
$sel:key:CreateAlarmModel' :: CreateAlarmModel -> Maybe Text
$sel:alarmNotification:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmNotification
$sel:alarmModelDescription:CreateAlarmModel' :: CreateAlarmModel -> Maybe Text
$sel:alarmEventActions:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmEventActions
$sel:alarmCapabilities:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmCapabilities
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"alarmCapabilities" 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 AlarmCapabilities
alarmCapabilities,
(Key
"alarmEventActions" 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 AlarmEventActions
alarmEventActions,
(Key
"alarmModelDescription" 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 Text
alarmModelDescription,
(Key
"alarmNotification" 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 AlarmNotification
alarmNotification,
(Key
"key" 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 Text
key,
(Key
"severity" 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 Natural
severity,
(Key
"tags" 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 [Tag]
tags,
forall a. a -> Maybe a
Prelude.Just
(Key
"alarmModelName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
alarmModelName),
forall a. a -> Maybe a
Prelude.Just (Key
"roleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn),
forall a. a -> Maybe a
Prelude.Just (Key
"alarmRule" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AlarmRule
alarmRule)
]
)
instance Data.ToPath CreateAlarmModel where
toPath :: CreateAlarmModel -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/alarm-models"
instance Data.ToQuery CreateAlarmModel where
toQuery :: CreateAlarmModel -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateAlarmModelResponse = CreateAlarmModelResponse'
{
CreateAlarmModelResponse -> Maybe Text
alarmModelArn :: Prelude.Maybe Prelude.Text,
CreateAlarmModelResponse -> Maybe Text
alarmModelVersion :: Prelude.Maybe Prelude.Text,
CreateAlarmModelResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
CreateAlarmModelResponse -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Data.POSIX,
CreateAlarmModelResponse -> Maybe AlarmModelVersionStatus
status :: Prelude.Maybe AlarmModelVersionStatus,
CreateAlarmModelResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateAlarmModelResponse -> CreateAlarmModelResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAlarmModelResponse -> CreateAlarmModelResponse -> Bool
$c/= :: CreateAlarmModelResponse -> CreateAlarmModelResponse -> Bool
== :: CreateAlarmModelResponse -> CreateAlarmModelResponse -> Bool
$c== :: CreateAlarmModelResponse -> CreateAlarmModelResponse -> Bool
Prelude.Eq, ReadPrec [CreateAlarmModelResponse]
ReadPrec CreateAlarmModelResponse
Int -> ReadS CreateAlarmModelResponse
ReadS [CreateAlarmModelResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAlarmModelResponse]
$creadListPrec :: ReadPrec [CreateAlarmModelResponse]
readPrec :: ReadPrec CreateAlarmModelResponse
$creadPrec :: ReadPrec CreateAlarmModelResponse
readList :: ReadS [CreateAlarmModelResponse]
$creadList :: ReadS [CreateAlarmModelResponse]
readsPrec :: Int -> ReadS CreateAlarmModelResponse
$creadsPrec :: Int -> ReadS CreateAlarmModelResponse
Prelude.Read, Int -> CreateAlarmModelResponse -> ShowS
[CreateAlarmModelResponse] -> ShowS
CreateAlarmModelResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAlarmModelResponse] -> ShowS
$cshowList :: [CreateAlarmModelResponse] -> ShowS
show :: CreateAlarmModelResponse -> String
$cshow :: CreateAlarmModelResponse -> String
showsPrec :: Int -> CreateAlarmModelResponse -> ShowS
$cshowsPrec :: Int -> CreateAlarmModelResponse -> ShowS
Prelude.Show, forall x.
Rep CreateAlarmModelResponse x -> CreateAlarmModelResponse
forall x.
CreateAlarmModelResponse -> Rep CreateAlarmModelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAlarmModelResponse x -> CreateAlarmModelResponse
$cfrom :: forall x.
CreateAlarmModelResponse -> Rep CreateAlarmModelResponse x
Prelude.Generic)
newCreateAlarmModelResponse ::
Prelude.Int ->
CreateAlarmModelResponse
newCreateAlarmModelResponse :: Int -> CreateAlarmModelResponse
newCreateAlarmModelResponse Int
pHttpStatus_ =
CreateAlarmModelResponse'
{ $sel:alarmModelArn:CreateAlarmModelResponse' :: Maybe Text
alarmModelArn =
forall a. Maybe a
Prelude.Nothing,
$sel:alarmModelVersion:CreateAlarmModelResponse' :: Maybe Text
alarmModelVersion = forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:CreateAlarmModelResponse' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdateTime:CreateAlarmModelResponse' :: Maybe POSIX
lastUpdateTime = forall a. Maybe a
Prelude.Nothing,
$sel:status:CreateAlarmModelResponse' :: Maybe AlarmModelVersionStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateAlarmModelResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createAlarmModelResponse_alarmModelArn :: Lens.Lens' CreateAlarmModelResponse (Prelude.Maybe Prelude.Text)
createAlarmModelResponse_alarmModelArn :: Lens' CreateAlarmModelResponse (Maybe Text)
createAlarmModelResponse_alarmModelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModelResponse' {Maybe Text
alarmModelArn :: Maybe Text
$sel:alarmModelArn:CreateAlarmModelResponse' :: CreateAlarmModelResponse -> Maybe Text
alarmModelArn} -> Maybe Text
alarmModelArn) (\s :: CreateAlarmModelResponse
s@CreateAlarmModelResponse' {} Maybe Text
a -> CreateAlarmModelResponse
s {$sel:alarmModelArn:CreateAlarmModelResponse' :: Maybe Text
alarmModelArn = Maybe Text
a} :: CreateAlarmModelResponse)
createAlarmModelResponse_alarmModelVersion :: Lens.Lens' CreateAlarmModelResponse (Prelude.Maybe Prelude.Text)
createAlarmModelResponse_alarmModelVersion :: Lens' CreateAlarmModelResponse (Maybe Text)
createAlarmModelResponse_alarmModelVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModelResponse' {Maybe Text
alarmModelVersion :: Maybe Text
$sel:alarmModelVersion:CreateAlarmModelResponse' :: CreateAlarmModelResponse -> Maybe Text
alarmModelVersion} -> Maybe Text
alarmModelVersion) (\s :: CreateAlarmModelResponse
s@CreateAlarmModelResponse' {} Maybe Text
a -> CreateAlarmModelResponse
s {$sel:alarmModelVersion:CreateAlarmModelResponse' :: Maybe Text
alarmModelVersion = Maybe Text
a} :: CreateAlarmModelResponse)
createAlarmModelResponse_creationTime :: Lens.Lens' CreateAlarmModelResponse (Prelude.Maybe Prelude.UTCTime)
createAlarmModelResponse_creationTime :: Lens' CreateAlarmModelResponse (Maybe UTCTime)
createAlarmModelResponse_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModelResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:CreateAlarmModelResponse' :: CreateAlarmModelResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: CreateAlarmModelResponse
s@CreateAlarmModelResponse' {} Maybe POSIX
a -> CreateAlarmModelResponse
s {$sel:creationTime:CreateAlarmModelResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: CreateAlarmModelResponse) 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
createAlarmModelResponse_lastUpdateTime :: Lens.Lens' CreateAlarmModelResponse (Prelude.Maybe Prelude.UTCTime)
createAlarmModelResponse_lastUpdateTime :: Lens' CreateAlarmModelResponse (Maybe UTCTime)
createAlarmModelResponse_lastUpdateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModelResponse' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:CreateAlarmModelResponse' :: CreateAlarmModelResponse -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: CreateAlarmModelResponse
s@CreateAlarmModelResponse' {} Maybe POSIX
a -> CreateAlarmModelResponse
s {$sel:lastUpdateTime:CreateAlarmModelResponse' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: CreateAlarmModelResponse) 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
createAlarmModelResponse_status :: Lens.Lens' CreateAlarmModelResponse (Prelude.Maybe AlarmModelVersionStatus)
createAlarmModelResponse_status :: Lens' CreateAlarmModelResponse (Maybe AlarmModelVersionStatus)
createAlarmModelResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModelResponse' {Maybe AlarmModelVersionStatus
status :: Maybe AlarmModelVersionStatus
$sel:status:CreateAlarmModelResponse' :: CreateAlarmModelResponse -> Maybe AlarmModelVersionStatus
status} -> Maybe AlarmModelVersionStatus
status) (\s :: CreateAlarmModelResponse
s@CreateAlarmModelResponse' {} Maybe AlarmModelVersionStatus
a -> CreateAlarmModelResponse
s {$sel:status:CreateAlarmModelResponse' :: Maybe AlarmModelVersionStatus
status = Maybe AlarmModelVersionStatus
a} :: CreateAlarmModelResponse)
createAlarmModelResponse_httpStatus :: Lens.Lens' CreateAlarmModelResponse Prelude.Int
createAlarmModelResponse_httpStatus :: Lens' CreateAlarmModelResponse Int
createAlarmModelResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModelResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateAlarmModelResponse' :: CreateAlarmModelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateAlarmModelResponse
s@CreateAlarmModelResponse' {} Int
a -> CreateAlarmModelResponse
s {$sel:httpStatus:CreateAlarmModelResponse' :: Int
httpStatus = Int
a} :: CreateAlarmModelResponse)
instance Prelude.NFData CreateAlarmModelResponse where
rnf :: CreateAlarmModelResponse -> ()
rnf CreateAlarmModelResponse' {Int
Maybe Text
Maybe POSIX
Maybe AlarmModelVersionStatus
httpStatus :: Int
status :: Maybe AlarmModelVersionStatus
lastUpdateTime :: Maybe POSIX
creationTime :: Maybe POSIX
alarmModelVersion :: Maybe Text
alarmModelArn :: Maybe Text
$sel:httpStatus:CreateAlarmModelResponse' :: CreateAlarmModelResponse -> Int
$sel:status:CreateAlarmModelResponse' :: CreateAlarmModelResponse -> Maybe AlarmModelVersionStatus
$sel:lastUpdateTime:CreateAlarmModelResponse' :: CreateAlarmModelResponse -> Maybe POSIX
$sel:creationTime:CreateAlarmModelResponse' :: CreateAlarmModelResponse -> Maybe POSIX
$sel:alarmModelVersion:CreateAlarmModelResponse' :: CreateAlarmModelResponse -> Maybe Text
$sel:alarmModelArn:CreateAlarmModelResponse' :: CreateAlarmModelResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
alarmModelArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
alarmModelVersion
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
lastUpdateTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AlarmModelVersionStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus