{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoTEvents.CreateAlarmModel
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an alarm model to monitor an AWS IoT Events input attribute. You
-- can use the alarm to get notified when the value is outside a specified
-- range. For more information, see
-- <https://docs.aws.amazon.com/iotevents/latest/developerguide/create-alarms.html Create an alarm model>
-- in the /AWS IoT Events Developer Guide/.
module Amazonka.IoTEvents.CreateAlarmModel
  ( -- * Creating a Request
    CreateAlarmModel (..),
    newCreateAlarmModel,

    -- * Request Lenses
    createAlarmModel_alarmCapabilities,
    createAlarmModel_alarmEventActions,
    createAlarmModel_alarmModelDescription,
    createAlarmModel_alarmNotification,
    createAlarmModel_key,
    createAlarmModel_severity,
    createAlarmModel_tags,
    createAlarmModel_alarmModelName,
    createAlarmModel_roleArn,
    createAlarmModel_alarmRule,

    -- * Destructuring the Response
    CreateAlarmModelResponse (..),
    newCreateAlarmModelResponse,

    -- * Response Lenses
    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

-- | /See:/ 'newCreateAlarmModel' smart constructor.
data CreateAlarmModel = CreateAlarmModel'
  { -- | Contains the configuration information of alarm state changes.
    CreateAlarmModel -> Maybe AlarmCapabilities
alarmCapabilities :: Prelude.Maybe AlarmCapabilities,
    -- | Contains information about one or more alarm actions.
    CreateAlarmModel -> Maybe AlarmEventActions
alarmEventActions :: Prelude.Maybe AlarmEventActions,
    -- | A description that tells you what the alarm model detects.
    CreateAlarmModel -> Maybe Text
alarmModelDescription :: Prelude.Maybe Prelude.Text,
    -- | Contains information about one or more notification actions.
    CreateAlarmModel -> Maybe AlarmNotification
alarmNotification :: Prelude.Maybe AlarmNotification,
    -- | An input attribute used as a key to create an alarm. AWS IoT Events
    -- routes
    -- <https://docs.aws.amazon.com/iotevents/latest/apireference/API_Input.html inputs>
    -- associated with this key to the alarm.
    CreateAlarmModel -> Maybe Text
key :: Prelude.Maybe Prelude.Text,
    -- | A non-negative integer that reflects the severity level of the alarm.
    CreateAlarmModel -> Maybe Natural
severity :: Prelude.Maybe Prelude.Natural,
    -- | A list of key-value pairs that contain metadata for the alarm model. The
    -- tags help you manage the alarm model. For more information, see
    -- <https://docs.aws.amazon.com/iotevents/latest/developerguide/tagging-iotevents.html Tagging your AWS IoT Events resources>
    -- in the /AWS IoT Events Developer Guide/.
    --
    -- You can create up to 50 tags for one alarm model.
    CreateAlarmModel -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | A unique name that helps you identify the alarm model. You can\'t change
    -- this name after you create the alarm model.
    CreateAlarmModel -> Text
alarmModelName :: Prelude.Text,
    -- | The ARN of the IAM role that allows the alarm to perform actions and
    -- access AWS resources. For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
    -- in the /AWS General Reference/.
    CreateAlarmModel -> Text
roleArn :: Prelude.Text,
    -- | Defines when your alarm is invoked.
    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)

-- |
-- Create a value of 'CreateAlarmModel' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'alarmCapabilities', 'createAlarmModel_alarmCapabilities' - Contains the configuration information of alarm state changes.
--
-- 'alarmEventActions', 'createAlarmModel_alarmEventActions' - Contains information about one or more alarm actions.
--
-- 'alarmModelDescription', 'createAlarmModel_alarmModelDescription' - A description that tells you what the alarm model detects.
--
-- 'alarmNotification', 'createAlarmModel_alarmNotification' - Contains information about one or more notification actions.
--
-- 'key', 'createAlarmModel_key' - An input attribute used as a key to create an alarm. AWS IoT Events
-- routes
-- <https://docs.aws.amazon.com/iotevents/latest/apireference/API_Input.html inputs>
-- associated with this key to the alarm.
--
-- 'severity', 'createAlarmModel_severity' - A non-negative integer that reflects the severity level of the alarm.
--
-- 'tags', 'createAlarmModel_tags' - A list of key-value pairs that contain metadata for the alarm model. The
-- tags help you manage the alarm model. For more information, see
-- <https://docs.aws.amazon.com/iotevents/latest/developerguide/tagging-iotevents.html Tagging your AWS IoT Events resources>
-- in the /AWS IoT Events Developer Guide/.
--
-- You can create up to 50 tags for one alarm model.
--
-- 'alarmModelName', 'createAlarmModel_alarmModelName' - A unique name that helps you identify the alarm model. You can\'t change
-- this name after you create the alarm model.
--
-- 'roleArn', 'createAlarmModel_roleArn' - The ARN of the IAM role that allows the alarm to perform actions and
-- access AWS resources. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /AWS General Reference/.
--
-- 'alarmRule', 'createAlarmModel_alarmRule' - Defines when your alarm is invoked.
newCreateAlarmModel ::
  -- | 'alarmModelName'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  -- | 'alarmRule'
  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_
      }

-- | Contains the configuration information of alarm state changes.
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)

-- | Contains information about one or more alarm actions.
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)

-- | A description that tells you what the alarm model detects.
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)

-- | Contains information about one or more notification actions.
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)

-- | An input attribute used as a key to create an alarm. AWS IoT Events
-- routes
-- <https://docs.aws.amazon.com/iotevents/latest/apireference/API_Input.html inputs>
-- associated with this key to the alarm.
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)

-- | A non-negative integer that reflects the severity level of the alarm.
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)

-- | A list of key-value pairs that contain metadata for the alarm model. The
-- tags help you manage the alarm model. For more information, see
-- <https://docs.aws.amazon.com/iotevents/latest/developerguide/tagging-iotevents.html Tagging your AWS IoT Events resources>
-- in the /AWS IoT Events Developer Guide/.
--
-- You can create up to 50 tags for one alarm model.
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

-- | A unique name that helps you identify the alarm model. You can\'t change
-- this name after you create the alarm model.
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)

-- | The ARN of the IAM role that allows the alarm to perform actions and
-- access AWS resources. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /AWS General Reference/.
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)

-- | Defines when your alarm is invoked.
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

-- | /See:/ 'newCreateAlarmModelResponse' smart constructor.
data CreateAlarmModelResponse = CreateAlarmModelResponse'
  { -- | The ARN of the alarm model. For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
    -- in the /AWS General Reference/.
    CreateAlarmModelResponse -> Maybe Text
alarmModelArn :: Prelude.Maybe Prelude.Text,
    -- | The version of the alarm model.
    CreateAlarmModelResponse -> Maybe Text
alarmModelVersion :: Prelude.Maybe Prelude.Text,
    -- | The time the alarm model was created, in the Unix epoch format.
    CreateAlarmModelResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | The time the alarm model was last updated, in the Unix epoch format.
    CreateAlarmModelResponse -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Data.POSIX,
    -- | The status of the alarm model. The status can be one of the following
    -- values:
    --
    -- -   @ACTIVE@ - The alarm model is active and it\'s ready to evaluate
    --     data.
    --
    -- -   @ACTIVATING@ - AWS IoT Events is activating your alarm model.
    --     Activating an alarm model can take up to a few minutes.
    --
    -- -   @INACTIVE@ - The alarm model is inactive, so it isn\'t ready to
    --     evaluate data. Check your alarm model information and update the
    --     alarm model.
    --
    -- -   @FAILED@ - You couldn\'t create or update the alarm model. Check
    --     your alarm model information and try again.
    CreateAlarmModelResponse -> Maybe AlarmModelVersionStatus
status :: Prelude.Maybe AlarmModelVersionStatus,
    -- | The response's http status code.
    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)

-- |
-- Create a value of 'CreateAlarmModelResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'alarmModelArn', 'createAlarmModelResponse_alarmModelArn' - The ARN of the alarm model. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /AWS General Reference/.
--
-- 'alarmModelVersion', 'createAlarmModelResponse_alarmModelVersion' - The version of the alarm model.
--
-- 'creationTime', 'createAlarmModelResponse_creationTime' - The time the alarm model was created, in the Unix epoch format.
--
-- 'lastUpdateTime', 'createAlarmModelResponse_lastUpdateTime' - The time the alarm model was last updated, in the Unix epoch format.
--
-- 'status', 'createAlarmModelResponse_status' - The status of the alarm model. The status can be one of the following
-- values:
--
-- -   @ACTIVE@ - The alarm model is active and it\'s ready to evaluate
--     data.
--
-- -   @ACTIVATING@ - AWS IoT Events is activating your alarm model.
--     Activating an alarm model can take up to a few minutes.
--
-- -   @INACTIVE@ - The alarm model is inactive, so it isn\'t ready to
--     evaluate data. Check your alarm model information and update the
--     alarm model.
--
-- -   @FAILED@ - You couldn\'t create or update the alarm model. Check
--     your alarm model information and try again.
--
-- 'httpStatus', 'createAlarmModelResponse_httpStatus' - The response's http status code.
newCreateAlarmModelResponse ::
  -- | 'httpStatus'
  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_
    }

-- | The ARN of the alarm model. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /AWS General Reference/.
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)

-- | The version of the alarm model.
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)

-- | The time the alarm model was created, in the Unix epoch format.
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

-- | The time the alarm model was last updated, in the Unix epoch format.
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

-- | The status of the alarm model. The status can be one of the following
-- values:
--
-- -   @ACTIVE@ - The alarm model is active and it\'s ready to evaluate
--     data.
--
-- -   @ACTIVATING@ - AWS IoT Events is activating your alarm model.
--     Activating an alarm model can take up to a few minutes.
--
-- -   @INACTIVE@ - The alarm model is inactive, so it isn\'t ready to
--     evaluate data. Check your alarm model information and update the
--     alarm model.
--
-- -   @FAILED@ - You couldn\'t create or update the alarm model. Check
--     your alarm model information and try again.
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)

-- | The response's http status code.
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