{-# 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.DescribeAlarmModel
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves information about an alarm model. If you don\'t specify a
-- value for the @alarmModelVersion@ parameter, the latest version is
-- returned.
module Amazonka.IoTEvents.DescribeAlarmModel
  ( -- * Creating a Request
    DescribeAlarmModel (..),
    newDescribeAlarmModel,

    -- * Request Lenses
    describeAlarmModel_alarmModelVersion,
    describeAlarmModel_alarmModelName,

    -- * Destructuring the Response
    DescribeAlarmModelResponse (..),
    newDescribeAlarmModelResponse,

    -- * Response Lenses
    describeAlarmModelResponse_creationTime,
    describeAlarmModelResponse_status,
    describeAlarmModelResponse_alarmRule,
    describeAlarmModelResponse_alarmModelName,
    describeAlarmModelResponse_severity,
    describeAlarmModelResponse_alarmNotification,
    describeAlarmModelResponse_key,
    describeAlarmModelResponse_statusMessage,
    describeAlarmModelResponse_alarmModelDescription,
    describeAlarmModelResponse_alarmEventActions,
    describeAlarmModelResponse_alarmCapabilities,
    describeAlarmModelResponse_lastUpdateTime,
    describeAlarmModelResponse_alarmModelVersion,
    describeAlarmModelResponse_alarmModelArn,
    describeAlarmModelResponse_roleArn,
    describeAlarmModelResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTEvents.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeAlarmModel' smart constructor.
data DescribeAlarmModel = DescribeAlarmModel'
  { -- | The version of the alarm model.
    DescribeAlarmModel -> Maybe Text
alarmModelVersion :: Prelude.Maybe Prelude.Text,
    -- | The name of the alarm model.
    DescribeAlarmModel -> Text
alarmModelName :: Prelude.Text
  }
  deriving (DescribeAlarmModel -> DescribeAlarmModel -> Bool
(DescribeAlarmModel -> DescribeAlarmModel -> Bool)
-> (DescribeAlarmModel -> DescribeAlarmModel -> Bool)
-> Eq DescribeAlarmModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAlarmModel -> DescribeAlarmModel -> Bool
$c/= :: DescribeAlarmModel -> DescribeAlarmModel -> Bool
== :: DescribeAlarmModel -> DescribeAlarmModel -> Bool
$c== :: DescribeAlarmModel -> DescribeAlarmModel -> Bool
Prelude.Eq, ReadPrec [DescribeAlarmModel]
ReadPrec DescribeAlarmModel
Int -> ReadS DescribeAlarmModel
ReadS [DescribeAlarmModel]
(Int -> ReadS DescribeAlarmModel)
-> ReadS [DescribeAlarmModel]
-> ReadPrec DescribeAlarmModel
-> ReadPrec [DescribeAlarmModel]
-> Read DescribeAlarmModel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAlarmModel]
$creadListPrec :: ReadPrec [DescribeAlarmModel]
readPrec :: ReadPrec DescribeAlarmModel
$creadPrec :: ReadPrec DescribeAlarmModel
readList :: ReadS [DescribeAlarmModel]
$creadList :: ReadS [DescribeAlarmModel]
readsPrec :: Int -> ReadS DescribeAlarmModel
$creadsPrec :: Int -> ReadS DescribeAlarmModel
Prelude.Read, Int -> DescribeAlarmModel -> ShowS
[DescribeAlarmModel] -> ShowS
DescribeAlarmModel -> String
(Int -> DescribeAlarmModel -> ShowS)
-> (DescribeAlarmModel -> String)
-> ([DescribeAlarmModel] -> ShowS)
-> Show DescribeAlarmModel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAlarmModel] -> ShowS
$cshowList :: [DescribeAlarmModel] -> ShowS
show :: DescribeAlarmModel -> String
$cshow :: DescribeAlarmModel -> String
showsPrec :: Int -> DescribeAlarmModel -> ShowS
$cshowsPrec :: Int -> DescribeAlarmModel -> ShowS
Prelude.Show, (forall x. DescribeAlarmModel -> Rep DescribeAlarmModel x)
-> (forall x. Rep DescribeAlarmModel x -> DescribeAlarmModel)
-> Generic DescribeAlarmModel
forall x. Rep DescribeAlarmModel x -> DescribeAlarmModel
forall x. DescribeAlarmModel -> Rep DescribeAlarmModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAlarmModel x -> DescribeAlarmModel
$cfrom :: forall x. DescribeAlarmModel -> Rep DescribeAlarmModel x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAlarmModel' 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:
--
-- 'alarmModelVersion', 'describeAlarmModel_alarmModelVersion' - The version of the alarm model.
--
-- 'alarmModelName', 'describeAlarmModel_alarmModelName' - The name of the alarm model.
newDescribeAlarmModel ::
  -- | 'alarmModelName'
  Prelude.Text ->
  DescribeAlarmModel
newDescribeAlarmModel :: Text -> DescribeAlarmModel
newDescribeAlarmModel Text
pAlarmModelName_ =
  DescribeAlarmModel' :: Maybe Text -> Text -> DescribeAlarmModel
DescribeAlarmModel'
    { $sel:alarmModelVersion:DescribeAlarmModel' :: Maybe Text
alarmModelVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmModelName:DescribeAlarmModel' :: Text
alarmModelName = Text
pAlarmModelName_
    }

-- | The version of the alarm model.
describeAlarmModel_alarmModelVersion :: Lens.Lens' DescribeAlarmModel (Prelude.Maybe Prelude.Text)
describeAlarmModel_alarmModelVersion :: (Maybe Text -> f (Maybe Text))
-> DescribeAlarmModel -> f DescribeAlarmModel
describeAlarmModel_alarmModelVersion = (DescribeAlarmModel -> Maybe Text)
-> (DescribeAlarmModel -> Maybe Text -> DescribeAlarmModel)
-> Lens
     DescribeAlarmModel DescribeAlarmModel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModel' {Maybe Text
alarmModelVersion :: Maybe Text
$sel:alarmModelVersion:DescribeAlarmModel' :: DescribeAlarmModel -> Maybe Text
alarmModelVersion} -> Maybe Text
alarmModelVersion) (\s :: DescribeAlarmModel
s@DescribeAlarmModel' {} Maybe Text
a -> DescribeAlarmModel
s {$sel:alarmModelVersion:DescribeAlarmModel' :: Maybe Text
alarmModelVersion = Maybe Text
a} :: DescribeAlarmModel)

-- | The name of the alarm model.
describeAlarmModel_alarmModelName :: Lens.Lens' DescribeAlarmModel Prelude.Text
describeAlarmModel_alarmModelName :: (Text -> f Text) -> DescribeAlarmModel -> f DescribeAlarmModel
describeAlarmModel_alarmModelName = (DescribeAlarmModel -> Text)
-> (DescribeAlarmModel -> Text -> DescribeAlarmModel)
-> Lens DescribeAlarmModel DescribeAlarmModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModel' {Text
alarmModelName :: Text
$sel:alarmModelName:DescribeAlarmModel' :: DescribeAlarmModel -> Text
alarmModelName} -> Text
alarmModelName) (\s :: DescribeAlarmModel
s@DescribeAlarmModel' {} Text
a -> DescribeAlarmModel
s {$sel:alarmModelName:DescribeAlarmModel' :: Text
alarmModelName = Text
a} :: DescribeAlarmModel)

instance Core.AWSRequest DescribeAlarmModel where
  type
    AWSResponse DescribeAlarmModel =
      DescribeAlarmModelResponse
  request :: DescribeAlarmModel -> Request DescribeAlarmModel
request = Service -> DescribeAlarmModel -> Request DescribeAlarmModel
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeAlarmModel
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAlarmModel)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeAlarmModel))
-> Logger
-> Service
-> Proxy DescribeAlarmModel
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAlarmModel)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe POSIX
-> Maybe AlarmModelVersionStatus
-> Maybe AlarmRule
-> Maybe Text
-> Maybe Natural
-> Maybe AlarmNotification
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AlarmEventActions
-> Maybe AlarmCapabilities
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeAlarmModelResponse
DescribeAlarmModelResponse'
            (Maybe POSIX
 -> Maybe AlarmModelVersionStatus
 -> Maybe AlarmRule
 -> Maybe Text
 -> Maybe Natural
 -> Maybe AlarmNotification
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AlarmEventActions
 -> Maybe AlarmCapabilities
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> DescribeAlarmModelResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe AlarmModelVersionStatus
      -> Maybe AlarmRule
      -> Maybe Text
      -> Maybe Natural
      -> Maybe AlarmNotification
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AlarmEventActions
      -> Maybe AlarmCapabilities
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"creationTime")
            Either
  String
  (Maybe AlarmModelVersionStatus
   -> Maybe AlarmRule
   -> Maybe Text
   -> Maybe Natural
   -> Maybe AlarmNotification
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AlarmEventActions
   -> Maybe AlarmCapabilities
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAlarmModelResponse)
-> Either String (Maybe AlarmModelVersionStatus)
-> Either
     String
     (Maybe AlarmRule
      -> Maybe Text
      -> Maybe Natural
      -> Maybe AlarmNotification
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AlarmEventActions
      -> Maybe AlarmCapabilities
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AlarmModelVersionStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"status")
            Either
  String
  (Maybe AlarmRule
   -> Maybe Text
   -> Maybe Natural
   -> Maybe AlarmNotification
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AlarmEventActions
   -> Maybe AlarmCapabilities
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAlarmModelResponse)
-> Either String (Maybe AlarmRule)
-> Either
     String
     (Maybe Text
      -> Maybe Natural
      -> Maybe AlarmNotification
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AlarmEventActions
      -> Maybe AlarmCapabilities
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AlarmRule)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"alarmRule")
            Either
  String
  (Maybe Text
   -> Maybe Natural
   -> Maybe AlarmNotification
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AlarmEventActions
   -> Maybe AlarmCapabilities
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAlarmModelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe AlarmNotification
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AlarmEventActions
      -> Maybe AlarmCapabilities
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"alarmModelName")
            Either
  String
  (Maybe Natural
   -> Maybe AlarmNotification
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AlarmEventActions
   -> Maybe AlarmCapabilities
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAlarmModelResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe AlarmNotification
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AlarmEventActions
      -> Maybe AlarmCapabilities
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"severity")
            Either
  String
  (Maybe AlarmNotification
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AlarmEventActions
   -> Maybe AlarmCapabilities
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAlarmModelResponse)
-> Either String (Maybe AlarmNotification)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AlarmEventActions
      -> Maybe AlarmCapabilities
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AlarmNotification)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"alarmNotification")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AlarmEventActions
   -> Maybe AlarmCapabilities
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAlarmModelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe AlarmEventActions
      -> Maybe AlarmCapabilities
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"key")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe AlarmEventActions
   -> Maybe AlarmCapabilities
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAlarmModelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe AlarmEventActions
      -> Maybe AlarmCapabilities
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"statusMessage")
            Either
  String
  (Maybe Text
   -> Maybe AlarmEventActions
   -> Maybe AlarmCapabilities
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAlarmModelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe AlarmEventActions
      -> Maybe AlarmCapabilities
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"alarmModelDescription")
            Either
  String
  (Maybe AlarmEventActions
   -> Maybe AlarmCapabilities
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAlarmModelResponse)
-> Either String (Maybe AlarmEventActions)
-> Either
     String
     (Maybe AlarmCapabilities
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AlarmEventActions)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"alarmEventActions")
            Either
  String
  (Maybe AlarmCapabilities
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAlarmModelResponse)
-> Either String (Maybe AlarmCapabilities)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AlarmCapabilities)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"alarmCapabilities")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeAlarmModelResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Int -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"lastUpdateTime")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Int -> DescribeAlarmModelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"alarmModelVersion")
            Either
  String
  (Maybe Text -> Maybe Text -> Int -> DescribeAlarmModelResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"alarmModelArn")
            Either String (Maybe Text -> Int -> DescribeAlarmModelResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeAlarmModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"roleArn")
            Either String (Int -> DescribeAlarmModelResponse)
-> Either String Int -> Either String DescribeAlarmModelResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeAlarmModel

instance Prelude.NFData DescribeAlarmModel

instance Core.ToHeaders DescribeAlarmModel where
  toHeaders :: DescribeAlarmModel -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeAlarmModel -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DescribeAlarmModel where
  toPath :: DescribeAlarmModel -> ByteString
toPath DescribeAlarmModel' {Maybe Text
Text
alarmModelName :: Text
alarmModelVersion :: Maybe Text
$sel:alarmModelName:DescribeAlarmModel' :: DescribeAlarmModel -> Text
$sel:alarmModelVersion:DescribeAlarmModel' :: DescribeAlarmModel -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/alarm-models/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
alarmModelName]

instance Core.ToQuery DescribeAlarmModel where
  toQuery :: DescribeAlarmModel -> QueryString
toQuery DescribeAlarmModel' {Maybe Text
Text
alarmModelName :: Text
alarmModelVersion :: Maybe Text
$sel:alarmModelName:DescribeAlarmModel' :: DescribeAlarmModel -> Text
$sel:alarmModelVersion:DescribeAlarmModel' :: DescribeAlarmModel -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"version" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
alarmModelVersion]

-- | /See:/ 'newDescribeAlarmModelResponse' smart constructor.
data DescribeAlarmModelResponse = DescribeAlarmModelResponse'
  { -- | The time the alarm model was created, in the Unix epoch format.
    DescribeAlarmModelResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.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.
    DescribeAlarmModelResponse -> Maybe AlarmModelVersionStatus
status :: Prelude.Maybe AlarmModelVersionStatus,
    -- | Defines when your alarm is invoked.
    DescribeAlarmModelResponse -> Maybe AlarmRule
alarmRule :: Prelude.Maybe AlarmRule,
    -- | The name of the alarm model.
    DescribeAlarmModelResponse -> Maybe Text
alarmModelName :: Prelude.Maybe Prelude.Text,
    -- | A non-negative integer that reflects the severity level of the alarm.
    DescribeAlarmModelResponse -> Maybe Natural
severity :: Prelude.Maybe Prelude.Natural,
    -- | Contains information about one or more notification actions.
    DescribeAlarmModelResponse -> 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.
    DescribeAlarmModelResponse -> Maybe Text
key :: Prelude.Maybe Prelude.Text,
    -- | Contains information about the status of the alarm model.
    DescribeAlarmModelResponse -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | The description of the alarm model.
    DescribeAlarmModelResponse -> Maybe Text
alarmModelDescription :: Prelude.Maybe Prelude.Text,
    -- | Contains information about one or more alarm actions.
    DescribeAlarmModelResponse -> Maybe AlarmEventActions
alarmEventActions :: Prelude.Maybe AlarmEventActions,
    -- | Contains the configuration information of alarm state changes.
    DescribeAlarmModelResponse -> Maybe AlarmCapabilities
alarmCapabilities :: Prelude.Maybe AlarmCapabilities,
    -- | The time the alarm model was last updated, in the Unix epoch format.
    DescribeAlarmModelResponse -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX,
    -- | The version of the alarm model.
    DescribeAlarmModelResponse -> Maybe Text
alarmModelVersion :: Prelude.Maybe Prelude.Text,
    -- | 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/.
    DescribeAlarmModelResponse -> Maybe Text
alarmModelArn :: Prelude.Maybe 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/.
    DescribeAlarmModelResponse -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeAlarmModelResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAlarmModelResponse -> DescribeAlarmModelResponse -> Bool
(DescribeAlarmModelResponse -> DescribeAlarmModelResponse -> Bool)
-> (DescribeAlarmModelResponse
    -> DescribeAlarmModelResponse -> Bool)
-> Eq DescribeAlarmModelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAlarmModelResponse -> DescribeAlarmModelResponse -> Bool
$c/= :: DescribeAlarmModelResponse -> DescribeAlarmModelResponse -> Bool
== :: DescribeAlarmModelResponse -> DescribeAlarmModelResponse -> Bool
$c== :: DescribeAlarmModelResponse -> DescribeAlarmModelResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAlarmModelResponse]
ReadPrec DescribeAlarmModelResponse
Int -> ReadS DescribeAlarmModelResponse
ReadS [DescribeAlarmModelResponse]
(Int -> ReadS DescribeAlarmModelResponse)
-> ReadS [DescribeAlarmModelResponse]
-> ReadPrec DescribeAlarmModelResponse
-> ReadPrec [DescribeAlarmModelResponse]
-> Read DescribeAlarmModelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAlarmModelResponse]
$creadListPrec :: ReadPrec [DescribeAlarmModelResponse]
readPrec :: ReadPrec DescribeAlarmModelResponse
$creadPrec :: ReadPrec DescribeAlarmModelResponse
readList :: ReadS [DescribeAlarmModelResponse]
$creadList :: ReadS [DescribeAlarmModelResponse]
readsPrec :: Int -> ReadS DescribeAlarmModelResponse
$creadsPrec :: Int -> ReadS DescribeAlarmModelResponse
Prelude.Read, Int -> DescribeAlarmModelResponse -> ShowS
[DescribeAlarmModelResponse] -> ShowS
DescribeAlarmModelResponse -> String
(Int -> DescribeAlarmModelResponse -> ShowS)
-> (DescribeAlarmModelResponse -> String)
-> ([DescribeAlarmModelResponse] -> ShowS)
-> Show DescribeAlarmModelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAlarmModelResponse] -> ShowS
$cshowList :: [DescribeAlarmModelResponse] -> ShowS
show :: DescribeAlarmModelResponse -> String
$cshow :: DescribeAlarmModelResponse -> String
showsPrec :: Int -> DescribeAlarmModelResponse -> ShowS
$cshowsPrec :: Int -> DescribeAlarmModelResponse -> ShowS
Prelude.Show, (forall x.
 DescribeAlarmModelResponse -> Rep DescribeAlarmModelResponse x)
-> (forall x.
    Rep DescribeAlarmModelResponse x -> DescribeAlarmModelResponse)
-> Generic DescribeAlarmModelResponse
forall x.
Rep DescribeAlarmModelResponse x -> DescribeAlarmModelResponse
forall x.
DescribeAlarmModelResponse -> Rep DescribeAlarmModelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAlarmModelResponse x -> DescribeAlarmModelResponse
$cfrom :: forall x.
DescribeAlarmModelResponse -> Rep DescribeAlarmModelResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAlarmModelResponse' 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:
--
-- 'creationTime', 'describeAlarmModelResponse_creationTime' - The time the alarm model was created, in the Unix epoch format.
--
-- 'status', 'describeAlarmModelResponse_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.
--
-- 'alarmRule', 'describeAlarmModelResponse_alarmRule' - Defines when your alarm is invoked.
--
-- 'alarmModelName', 'describeAlarmModelResponse_alarmModelName' - The name of the alarm model.
--
-- 'severity', 'describeAlarmModelResponse_severity' - A non-negative integer that reflects the severity level of the alarm.
--
-- 'alarmNotification', 'describeAlarmModelResponse_alarmNotification' - Contains information about one or more notification actions.
--
-- 'key', 'describeAlarmModelResponse_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.
--
-- 'statusMessage', 'describeAlarmModelResponse_statusMessage' - Contains information about the status of the alarm model.
--
-- 'alarmModelDescription', 'describeAlarmModelResponse_alarmModelDescription' - The description of the alarm model.
--
-- 'alarmEventActions', 'describeAlarmModelResponse_alarmEventActions' - Contains information about one or more alarm actions.
--
-- 'alarmCapabilities', 'describeAlarmModelResponse_alarmCapabilities' - Contains the configuration information of alarm state changes.
--
-- 'lastUpdateTime', 'describeAlarmModelResponse_lastUpdateTime' - The time the alarm model was last updated, in the Unix epoch format.
--
-- 'alarmModelVersion', 'describeAlarmModelResponse_alarmModelVersion' - The version of the alarm model.
--
-- 'alarmModelArn', 'describeAlarmModelResponse_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/.
--
-- 'roleArn', 'describeAlarmModelResponse_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/.
--
-- 'httpStatus', 'describeAlarmModelResponse_httpStatus' - The response's http status code.
newDescribeAlarmModelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAlarmModelResponse
newDescribeAlarmModelResponse :: Int -> DescribeAlarmModelResponse
newDescribeAlarmModelResponse Int
pHttpStatus_ =
  DescribeAlarmModelResponse' :: Maybe POSIX
-> Maybe AlarmModelVersionStatus
-> Maybe AlarmRule
-> Maybe Text
-> Maybe Natural
-> Maybe AlarmNotification
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AlarmEventActions
-> Maybe AlarmCapabilities
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeAlarmModelResponse
DescribeAlarmModelResponse'
    { $sel:creationTime:DescribeAlarmModelResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:DescribeAlarmModelResponse' :: Maybe AlarmModelVersionStatus
status = Maybe AlarmModelVersionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmRule:DescribeAlarmModelResponse' :: Maybe AlarmRule
alarmRule = Maybe AlarmRule
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmModelName:DescribeAlarmModelResponse' :: Maybe Text
alarmModelName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:severity:DescribeAlarmModelResponse' :: Maybe Natural
severity = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmNotification:DescribeAlarmModelResponse' :: Maybe AlarmNotification
alarmNotification = Maybe AlarmNotification
forall a. Maybe a
Prelude.Nothing,
      $sel:key:DescribeAlarmModelResponse' :: Maybe Text
key = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:DescribeAlarmModelResponse' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmModelDescription:DescribeAlarmModelResponse' :: Maybe Text
alarmModelDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmEventActions:DescribeAlarmModelResponse' :: Maybe AlarmEventActions
alarmEventActions = Maybe AlarmEventActions
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmCapabilities:DescribeAlarmModelResponse' :: Maybe AlarmCapabilities
alarmCapabilities = Maybe AlarmCapabilities
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateTime:DescribeAlarmModelResponse' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmModelVersion:DescribeAlarmModelResponse' :: Maybe Text
alarmModelVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmModelArn:DescribeAlarmModelResponse' :: Maybe Text
alarmModelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:DescribeAlarmModelResponse' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeAlarmModelResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The time the alarm model was created, in the Unix epoch format.
describeAlarmModelResponse_creationTime :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe Prelude.UTCTime)
describeAlarmModelResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_creationTime = (DescribeAlarmModelResponse -> Maybe POSIX)
-> (DescribeAlarmModelResponse
    -> Maybe POSIX -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe POSIX
a -> DescribeAlarmModelResponse
s {$sel:creationTime:DescribeAlarmModelResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DescribeAlarmModelResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAlarmModelResponse
-> f DescribeAlarmModelResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._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.
describeAlarmModelResponse_status :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe AlarmModelVersionStatus)
describeAlarmModelResponse_status :: (Maybe AlarmModelVersionStatus
 -> f (Maybe AlarmModelVersionStatus))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_status = (DescribeAlarmModelResponse -> Maybe AlarmModelVersionStatus)
-> (DescribeAlarmModelResponse
    -> Maybe AlarmModelVersionStatus -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe AlarmModelVersionStatus)
     (Maybe AlarmModelVersionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe AlarmModelVersionStatus
status :: Maybe AlarmModelVersionStatus
$sel:status:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe AlarmModelVersionStatus
status} -> Maybe AlarmModelVersionStatus
status) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe AlarmModelVersionStatus
a -> DescribeAlarmModelResponse
s {$sel:status:DescribeAlarmModelResponse' :: Maybe AlarmModelVersionStatus
status = Maybe AlarmModelVersionStatus
a} :: DescribeAlarmModelResponse)

-- | Defines when your alarm is invoked.
describeAlarmModelResponse_alarmRule :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe AlarmRule)
describeAlarmModelResponse_alarmRule :: (Maybe AlarmRule -> f (Maybe AlarmRule))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_alarmRule = (DescribeAlarmModelResponse -> Maybe AlarmRule)
-> (DescribeAlarmModelResponse
    -> Maybe AlarmRule -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe AlarmRule)
     (Maybe AlarmRule)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe AlarmRule
alarmRule :: Maybe AlarmRule
$sel:alarmRule:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe AlarmRule
alarmRule} -> Maybe AlarmRule
alarmRule) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe AlarmRule
a -> DescribeAlarmModelResponse
s {$sel:alarmRule:DescribeAlarmModelResponse' :: Maybe AlarmRule
alarmRule = Maybe AlarmRule
a} :: DescribeAlarmModelResponse)

-- | The name of the alarm model.
describeAlarmModelResponse_alarmModelName :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe Prelude.Text)
describeAlarmModelResponse_alarmModelName :: (Maybe Text -> f (Maybe Text))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_alarmModelName = (DescribeAlarmModelResponse -> Maybe Text)
-> (DescribeAlarmModelResponse
    -> Maybe Text -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe Text
alarmModelName :: Maybe Text
$sel:alarmModelName:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe Text
alarmModelName} -> Maybe Text
alarmModelName) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe Text
a -> DescribeAlarmModelResponse
s {$sel:alarmModelName:DescribeAlarmModelResponse' :: Maybe Text
alarmModelName = Maybe Text
a} :: DescribeAlarmModelResponse)

-- | A non-negative integer that reflects the severity level of the alarm.
describeAlarmModelResponse_severity :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe Prelude.Natural)
describeAlarmModelResponse_severity :: (Maybe Natural -> f (Maybe Natural))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_severity = (DescribeAlarmModelResponse -> Maybe Natural)
-> (DescribeAlarmModelResponse
    -> Maybe Natural -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe Natural
severity :: Maybe Natural
$sel:severity:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe Natural
severity} -> Maybe Natural
severity) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe Natural
a -> DescribeAlarmModelResponse
s {$sel:severity:DescribeAlarmModelResponse' :: Maybe Natural
severity = Maybe Natural
a} :: DescribeAlarmModelResponse)

-- | Contains information about one or more notification actions.
describeAlarmModelResponse_alarmNotification :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe AlarmNotification)
describeAlarmModelResponse_alarmNotification :: (Maybe AlarmNotification -> f (Maybe AlarmNotification))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_alarmNotification = (DescribeAlarmModelResponse -> Maybe AlarmNotification)
-> (DescribeAlarmModelResponse
    -> Maybe AlarmNotification -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe AlarmNotification)
     (Maybe AlarmNotification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe AlarmNotification
alarmNotification :: Maybe AlarmNotification
$sel:alarmNotification:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe AlarmNotification
alarmNotification} -> Maybe AlarmNotification
alarmNotification) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe AlarmNotification
a -> DescribeAlarmModelResponse
s {$sel:alarmNotification:DescribeAlarmModelResponse' :: Maybe AlarmNotification
alarmNotification = Maybe AlarmNotification
a} :: DescribeAlarmModelResponse)

-- | 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.
describeAlarmModelResponse_key :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe Prelude.Text)
describeAlarmModelResponse_key :: (Maybe Text -> f (Maybe Text))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_key = (DescribeAlarmModelResponse -> Maybe Text)
-> (DescribeAlarmModelResponse
    -> Maybe Text -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe Text
key :: Maybe Text
$sel:key:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe Text
key} -> Maybe Text
key) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe Text
a -> DescribeAlarmModelResponse
s {$sel:key:DescribeAlarmModelResponse' :: Maybe Text
key = Maybe Text
a} :: DescribeAlarmModelResponse)

-- | Contains information about the status of the alarm model.
describeAlarmModelResponse_statusMessage :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe Prelude.Text)
describeAlarmModelResponse_statusMessage :: (Maybe Text -> f (Maybe Text))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_statusMessage = (DescribeAlarmModelResponse -> Maybe Text)
-> (DescribeAlarmModelResponse
    -> Maybe Text -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe Text
a -> DescribeAlarmModelResponse
s {$sel:statusMessage:DescribeAlarmModelResponse' :: Maybe Text
statusMessage = Maybe Text
a} :: DescribeAlarmModelResponse)

-- | The description of the alarm model.
describeAlarmModelResponse_alarmModelDescription :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe Prelude.Text)
describeAlarmModelResponse_alarmModelDescription :: (Maybe Text -> f (Maybe Text))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_alarmModelDescription = (DescribeAlarmModelResponse -> Maybe Text)
-> (DescribeAlarmModelResponse
    -> Maybe Text -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe Text
alarmModelDescription :: Maybe Text
$sel:alarmModelDescription:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe Text
alarmModelDescription} -> Maybe Text
alarmModelDescription) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe Text
a -> DescribeAlarmModelResponse
s {$sel:alarmModelDescription:DescribeAlarmModelResponse' :: Maybe Text
alarmModelDescription = Maybe Text
a} :: DescribeAlarmModelResponse)

-- | Contains information about one or more alarm actions.
describeAlarmModelResponse_alarmEventActions :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe AlarmEventActions)
describeAlarmModelResponse_alarmEventActions :: (Maybe AlarmEventActions -> f (Maybe AlarmEventActions))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_alarmEventActions = (DescribeAlarmModelResponse -> Maybe AlarmEventActions)
-> (DescribeAlarmModelResponse
    -> Maybe AlarmEventActions -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe AlarmEventActions)
     (Maybe AlarmEventActions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe AlarmEventActions
alarmEventActions :: Maybe AlarmEventActions
$sel:alarmEventActions:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe AlarmEventActions
alarmEventActions} -> Maybe AlarmEventActions
alarmEventActions) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe AlarmEventActions
a -> DescribeAlarmModelResponse
s {$sel:alarmEventActions:DescribeAlarmModelResponse' :: Maybe AlarmEventActions
alarmEventActions = Maybe AlarmEventActions
a} :: DescribeAlarmModelResponse)

-- | Contains the configuration information of alarm state changes.
describeAlarmModelResponse_alarmCapabilities :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe AlarmCapabilities)
describeAlarmModelResponse_alarmCapabilities :: (Maybe AlarmCapabilities -> f (Maybe AlarmCapabilities))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_alarmCapabilities = (DescribeAlarmModelResponse -> Maybe AlarmCapabilities)
-> (DescribeAlarmModelResponse
    -> Maybe AlarmCapabilities -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe AlarmCapabilities)
     (Maybe AlarmCapabilities)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe AlarmCapabilities
alarmCapabilities :: Maybe AlarmCapabilities
$sel:alarmCapabilities:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe AlarmCapabilities
alarmCapabilities} -> Maybe AlarmCapabilities
alarmCapabilities) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe AlarmCapabilities
a -> DescribeAlarmModelResponse
s {$sel:alarmCapabilities:DescribeAlarmModelResponse' :: Maybe AlarmCapabilities
alarmCapabilities = Maybe AlarmCapabilities
a} :: DescribeAlarmModelResponse)

-- | The time the alarm model was last updated, in the Unix epoch format.
describeAlarmModelResponse_lastUpdateTime :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe Prelude.UTCTime)
describeAlarmModelResponse_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_lastUpdateTime = (DescribeAlarmModelResponse -> Maybe POSIX)
-> (DescribeAlarmModelResponse
    -> Maybe POSIX -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe POSIX
a -> DescribeAlarmModelResponse
s {$sel:lastUpdateTime:DescribeAlarmModelResponse' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: DescribeAlarmModelResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAlarmModelResponse
-> f DescribeAlarmModelResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The version of the alarm model.
describeAlarmModelResponse_alarmModelVersion :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe Prelude.Text)
describeAlarmModelResponse_alarmModelVersion :: (Maybe Text -> f (Maybe Text))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_alarmModelVersion = (DescribeAlarmModelResponse -> Maybe Text)
-> (DescribeAlarmModelResponse
    -> Maybe Text -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe Text
alarmModelVersion :: Maybe Text
$sel:alarmModelVersion:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe Text
alarmModelVersion} -> Maybe Text
alarmModelVersion) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe Text
a -> DescribeAlarmModelResponse
s {$sel:alarmModelVersion:DescribeAlarmModelResponse' :: Maybe Text
alarmModelVersion = Maybe Text
a} :: DescribeAlarmModelResponse)

-- | 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/.
describeAlarmModelResponse_alarmModelArn :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe Prelude.Text)
describeAlarmModelResponse_alarmModelArn :: (Maybe Text -> f (Maybe Text))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_alarmModelArn = (DescribeAlarmModelResponse -> Maybe Text)
-> (DescribeAlarmModelResponse
    -> Maybe Text -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe Text
alarmModelArn :: Maybe Text
$sel:alarmModelArn:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe Text
alarmModelArn} -> Maybe Text
alarmModelArn) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe Text
a -> DescribeAlarmModelResponse
s {$sel:alarmModelArn:DescribeAlarmModelResponse' :: Maybe Text
alarmModelArn = Maybe Text
a} :: DescribeAlarmModelResponse)

-- | 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/.
describeAlarmModelResponse_roleArn :: Lens.Lens' DescribeAlarmModelResponse (Prelude.Maybe Prelude.Text)
describeAlarmModelResponse_roleArn :: (Maybe Text -> f (Maybe Text))
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_roleArn = (DescribeAlarmModelResponse -> Maybe Text)
-> (DescribeAlarmModelResponse
    -> Maybe Text -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse
     DescribeAlarmModelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Maybe Text
a -> DescribeAlarmModelResponse
s {$sel:roleArn:DescribeAlarmModelResponse' :: Maybe Text
roleArn = Maybe Text
a} :: DescribeAlarmModelResponse)

-- | The response's http status code.
describeAlarmModelResponse_httpStatus :: Lens.Lens' DescribeAlarmModelResponse Prelude.Int
describeAlarmModelResponse_httpStatus :: (Int -> f Int)
-> DescribeAlarmModelResponse -> f DescribeAlarmModelResponse
describeAlarmModelResponse_httpStatus = (DescribeAlarmModelResponse -> Int)
-> (DescribeAlarmModelResponse
    -> Int -> DescribeAlarmModelResponse)
-> Lens
     DescribeAlarmModelResponse DescribeAlarmModelResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAlarmModelResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeAlarmModelResponse' :: DescribeAlarmModelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeAlarmModelResponse
s@DescribeAlarmModelResponse' {} Int
a -> DescribeAlarmModelResponse
s {$sel:httpStatus:DescribeAlarmModelResponse' :: Int
httpStatus = Int
a} :: DescribeAlarmModelResponse)

instance Prelude.NFData DescribeAlarmModelResponse