{-# 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.UpdateAlarmModel
-- 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)
--
-- Updates an alarm model. Any alarms that were created based on the
-- previous version are deleted and then created again as new data arrives.
module Amazonka.IoTEvents.UpdateAlarmModel
  ( -- * Creating a Request
    UpdateAlarmModel (..),
    newUpdateAlarmModel,

    -- * Request Lenses
    updateAlarmModel_severity,
    updateAlarmModel_alarmNotification,
    updateAlarmModel_alarmModelDescription,
    updateAlarmModel_alarmEventActions,
    updateAlarmModel_alarmCapabilities,
    updateAlarmModel_alarmModelName,
    updateAlarmModel_roleArn,
    updateAlarmModel_alarmRule,

    -- * Destructuring the Response
    UpdateAlarmModelResponse (..),
    newUpdateAlarmModelResponse,

    -- * Response Lenses
    updateAlarmModelResponse_creationTime,
    updateAlarmModelResponse_status,
    updateAlarmModelResponse_lastUpdateTime,
    updateAlarmModelResponse_alarmModelVersion,
    updateAlarmModelResponse_alarmModelArn,
    updateAlarmModelResponse_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:/ 'newUpdateAlarmModel' smart constructor.
data UpdateAlarmModel = UpdateAlarmModel'
  { -- | A non-negative integer that reflects the severity level of the alarm.
    UpdateAlarmModel -> Maybe Natural
severity :: Prelude.Maybe Prelude.Natural,
    -- | Contains information about one or more notification actions.
    UpdateAlarmModel -> Maybe AlarmNotification
alarmNotification :: Prelude.Maybe AlarmNotification,
    -- | The description of the alarm model.
    UpdateAlarmModel -> Maybe Text
alarmModelDescription :: Prelude.Maybe Prelude.Text,
    -- | Contains information about one or more alarm actions.
    UpdateAlarmModel -> Maybe AlarmEventActions
alarmEventActions :: Prelude.Maybe AlarmEventActions,
    -- | Contains the configuration information of alarm state changes.
    UpdateAlarmModel -> Maybe AlarmCapabilities
alarmCapabilities :: Prelude.Maybe AlarmCapabilities,
    -- | The name of the alarm model.
    UpdateAlarmModel -> 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/.
    UpdateAlarmModel -> Text
roleArn :: Prelude.Text,
    -- | Defines when your alarm is invoked.
    UpdateAlarmModel -> AlarmRule
alarmRule :: AlarmRule
  }
  deriving (UpdateAlarmModel -> UpdateAlarmModel -> Bool
(UpdateAlarmModel -> UpdateAlarmModel -> Bool)
-> (UpdateAlarmModel -> UpdateAlarmModel -> Bool)
-> Eq UpdateAlarmModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAlarmModel -> UpdateAlarmModel -> Bool
$c/= :: UpdateAlarmModel -> UpdateAlarmModel -> Bool
== :: UpdateAlarmModel -> UpdateAlarmModel -> Bool
$c== :: UpdateAlarmModel -> UpdateAlarmModel -> Bool
Prelude.Eq, ReadPrec [UpdateAlarmModel]
ReadPrec UpdateAlarmModel
Int -> ReadS UpdateAlarmModel
ReadS [UpdateAlarmModel]
(Int -> ReadS UpdateAlarmModel)
-> ReadS [UpdateAlarmModel]
-> ReadPrec UpdateAlarmModel
-> ReadPrec [UpdateAlarmModel]
-> Read UpdateAlarmModel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAlarmModel]
$creadListPrec :: ReadPrec [UpdateAlarmModel]
readPrec :: ReadPrec UpdateAlarmModel
$creadPrec :: ReadPrec UpdateAlarmModel
readList :: ReadS [UpdateAlarmModel]
$creadList :: ReadS [UpdateAlarmModel]
readsPrec :: Int -> ReadS UpdateAlarmModel
$creadsPrec :: Int -> ReadS UpdateAlarmModel
Prelude.Read, Int -> UpdateAlarmModel -> ShowS
[UpdateAlarmModel] -> ShowS
UpdateAlarmModel -> String
(Int -> UpdateAlarmModel -> ShowS)
-> (UpdateAlarmModel -> String)
-> ([UpdateAlarmModel] -> ShowS)
-> Show UpdateAlarmModel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAlarmModel] -> ShowS
$cshowList :: [UpdateAlarmModel] -> ShowS
show :: UpdateAlarmModel -> String
$cshow :: UpdateAlarmModel -> String
showsPrec :: Int -> UpdateAlarmModel -> ShowS
$cshowsPrec :: Int -> UpdateAlarmModel -> ShowS
Prelude.Show, (forall x. UpdateAlarmModel -> Rep UpdateAlarmModel x)
-> (forall x. Rep UpdateAlarmModel x -> UpdateAlarmModel)
-> Generic UpdateAlarmModel
forall x. Rep UpdateAlarmModel x -> UpdateAlarmModel
forall x. UpdateAlarmModel -> Rep UpdateAlarmModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAlarmModel x -> UpdateAlarmModel
$cfrom :: forall x. UpdateAlarmModel -> Rep UpdateAlarmModel x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAlarmModel' 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:
--
-- 'severity', 'updateAlarmModel_severity' - A non-negative integer that reflects the severity level of the alarm.
--
-- 'alarmNotification', 'updateAlarmModel_alarmNotification' - Contains information about one or more notification actions.
--
-- 'alarmModelDescription', 'updateAlarmModel_alarmModelDescription' - The description of the alarm model.
--
-- 'alarmEventActions', 'updateAlarmModel_alarmEventActions' - Contains information about one or more alarm actions.
--
-- 'alarmCapabilities', 'updateAlarmModel_alarmCapabilities' - Contains the configuration information of alarm state changes.
--
-- 'alarmModelName', 'updateAlarmModel_alarmModelName' - The name of the alarm model.
--
-- 'roleArn', 'updateAlarmModel_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', 'updateAlarmModel_alarmRule' - Defines when your alarm is invoked.
newUpdateAlarmModel ::
  -- | 'alarmModelName'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  -- | 'alarmRule'
  AlarmRule ->
  UpdateAlarmModel
newUpdateAlarmModel :: Text -> Text -> AlarmRule -> UpdateAlarmModel
newUpdateAlarmModel
  Text
pAlarmModelName_
  Text
pRoleArn_
  AlarmRule
pAlarmRule_ =
    UpdateAlarmModel' :: Maybe Natural
-> Maybe AlarmNotification
-> Maybe Text
-> Maybe AlarmEventActions
-> Maybe AlarmCapabilities
-> Text
-> Text
-> AlarmRule
-> UpdateAlarmModel
UpdateAlarmModel'
      { $sel:severity:UpdateAlarmModel' :: Maybe Natural
severity = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:alarmNotification:UpdateAlarmModel' :: Maybe AlarmNotification
alarmNotification = Maybe AlarmNotification
forall a. Maybe a
Prelude.Nothing,
        $sel:alarmModelDescription:UpdateAlarmModel' :: Maybe Text
alarmModelDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:alarmEventActions:UpdateAlarmModel' :: Maybe AlarmEventActions
alarmEventActions = Maybe AlarmEventActions
forall a. Maybe a
Prelude.Nothing,
        $sel:alarmCapabilities:UpdateAlarmModel' :: Maybe AlarmCapabilities
alarmCapabilities = Maybe AlarmCapabilities
forall a. Maybe a
Prelude.Nothing,
        $sel:alarmModelName:UpdateAlarmModel' :: Text
alarmModelName = Text
pAlarmModelName_,
        $sel:roleArn:UpdateAlarmModel' :: Text
roleArn = Text
pRoleArn_,
        $sel:alarmRule:UpdateAlarmModel' :: AlarmRule
alarmRule = AlarmRule
pAlarmRule_
      }

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

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

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

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

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

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

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

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

instance Core.AWSRequest UpdateAlarmModel where
  type
    AWSResponse UpdateAlarmModel =
      UpdateAlarmModelResponse
  request :: UpdateAlarmModel -> Request UpdateAlarmModel
request = Service -> UpdateAlarmModel -> Request UpdateAlarmModel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateAlarmModel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateAlarmModel)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateAlarmModel))
-> Logger
-> Service
-> Proxy UpdateAlarmModel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateAlarmModel)))
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 POSIX
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateAlarmModelResponse
UpdateAlarmModelResponse'
            (Maybe POSIX
 -> Maybe AlarmModelVersionStatus
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> UpdateAlarmModelResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe AlarmModelVersionStatus
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateAlarmModelResponse)
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 POSIX
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateAlarmModelResponse)
-> Either String (Maybe AlarmModelVersionStatus)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text -> Maybe Text -> Int -> UpdateAlarmModelResponse)
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 POSIX
   -> Maybe Text -> Maybe Text -> Int -> UpdateAlarmModelResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> UpdateAlarmModelResponse)
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 -> Int -> UpdateAlarmModelResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> UpdateAlarmModelResponse)
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 -> Int -> UpdateAlarmModelResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateAlarmModelResponse)
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 (Int -> UpdateAlarmModelResponse)
-> Either String Int -> Either String UpdateAlarmModelResponse
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 UpdateAlarmModel

instance Prelude.NFData UpdateAlarmModel

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

instance Core.ToJSON UpdateAlarmModel where
  toJSON :: UpdateAlarmModel -> Value
toJSON UpdateAlarmModel' {Maybe Natural
Maybe Text
Maybe AlarmCapabilities
Maybe AlarmNotification
Maybe AlarmEventActions
Text
AlarmRule
alarmRule :: AlarmRule
roleArn :: Text
alarmModelName :: Text
alarmCapabilities :: Maybe AlarmCapabilities
alarmEventActions :: Maybe AlarmEventActions
alarmModelDescription :: Maybe Text
alarmNotification :: Maybe AlarmNotification
severity :: Maybe Natural
$sel:alarmRule:UpdateAlarmModel' :: UpdateAlarmModel -> AlarmRule
$sel:roleArn:UpdateAlarmModel' :: UpdateAlarmModel -> Text
$sel:alarmModelName:UpdateAlarmModel' :: UpdateAlarmModel -> Text
$sel:alarmCapabilities:UpdateAlarmModel' :: UpdateAlarmModel -> Maybe AlarmCapabilities
$sel:alarmEventActions:UpdateAlarmModel' :: UpdateAlarmModel -> Maybe AlarmEventActions
$sel:alarmModelDescription:UpdateAlarmModel' :: UpdateAlarmModel -> Maybe Text
$sel:alarmNotification:UpdateAlarmModel' :: UpdateAlarmModel -> Maybe AlarmNotification
$sel:severity:UpdateAlarmModel' :: UpdateAlarmModel -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"severity" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
severity,
            (Text
"alarmNotification" Text -> AlarmNotification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AlarmNotification -> Pair)
-> Maybe AlarmNotification -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AlarmNotification
alarmNotification,
            (Text
"alarmModelDescription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
alarmModelDescription,
            (Text
"alarmEventActions" Text -> AlarmEventActions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AlarmEventActions -> Pair)
-> Maybe AlarmEventActions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AlarmEventActions
alarmEventActions,
            (Text
"alarmCapabilities" Text -> AlarmCapabilities -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AlarmCapabilities -> Pair)
-> Maybe AlarmCapabilities -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AlarmCapabilities
alarmCapabilities,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"roleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"alarmRule" Text -> AlarmRule -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AlarmRule
alarmRule)
          ]
      )

instance Core.ToPath UpdateAlarmModel where
  toPath :: UpdateAlarmModel -> ByteString
toPath UpdateAlarmModel' {Maybe Natural
Maybe Text
Maybe AlarmCapabilities
Maybe AlarmNotification
Maybe AlarmEventActions
Text
AlarmRule
alarmRule :: AlarmRule
roleArn :: Text
alarmModelName :: Text
alarmCapabilities :: Maybe AlarmCapabilities
alarmEventActions :: Maybe AlarmEventActions
alarmModelDescription :: Maybe Text
alarmNotification :: Maybe AlarmNotification
severity :: Maybe Natural
$sel:alarmRule:UpdateAlarmModel' :: UpdateAlarmModel -> AlarmRule
$sel:roleArn:UpdateAlarmModel' :: UpdateAlarmModel -> Text
$sel:alarmModelName:UpdateAlarmModel' :: UpdateAlarmModel -> Text
$sel:alarmCapabilities:UpdateAlarmModel' :: UpdateAlarmModel -> Maybe AlarmCapabilities
$sel:alarmEventActions:UpdateAlarmModel' :: UpdateAlarmModel -> Maybe AlarmEventActions
$sel:alarmModelDescription:UpdateAlarmModel' :: UpdateAlarmModel -> Maybe Text
$sel:alarmNotification:UpdateAlarmModel' :: UpdateAlarmModel -> Maybe AlarmNotification
$sel:severity:UpdateAlarmModel' :: UpdateAlarmModel -> Maybe Natural
..} =
    [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 UpdateAlarmModel where
  toQuery :: UpdateAlarmModel -> QueryString
toQuery = QueryString -> UpdateAlarmModel -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateAlarmModelResponse' smart constructor.
data UpdateAlarmModelResponse = UpdateAlarmModelResponse'
  { -- | The time the alarm model was created, in the Unix epoch format.
    UpdateAlarmModelResponse -> 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.
    UpdateAlarmModelResponse -> Maybe AlarmModelVersionStatus
status :: Prelude.Maybe AlarmModelVersionStatus,
    -- | The time the alarm model was last updated, in the Unix epoch format.
    UpdateAlarmModelResponse -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX,
    -- | The version of the alarm model.
    UpdateAlarmModelResponse -> 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/.
    UpdateAlarmModelResponse -> Maybe Text
alarmModelArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateAlarmModelResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateAlarmModelResponse -> UpdateAlarmModelResponse -> Bool
(UpdateAlarmModelResponse -> UpdateAlarmModelResponse -> Bool)
-> (UpdateAlarmModelResponse -> UpdateAlarmModelResponse -> Bool)
-> Eq UpdateAlarmModelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAlarmModelResponse -> UpdateAlarmModelResponse -> Bool
$c/= :: UpdateAlarmModelResponse -> UpdateAlarmModelResponse -> Bool
== :: UpdateAlarmModelResponse -> UpdateAlarmModelResponse -> Bool
$c== :: UpdateAlarmModelResponse -> UpdateAlarmModelResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAlarmModelResponse]
ReadPrec UpdateAlarmModelResponse
Int -> ReadS UpdateAlarmModelResponse
ReadS [UpdateAlarmModelResponse]
(Int -> ReadS UpdateAlarmModelResponse)
-> ReadS [UpdateAlarmModelResponse]
-> ReadPrec UpdateAlarmModelResponse
-> ReadPrec [UpdateAlarmModelResponse]
-> Read UpdateAlarmModelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAlarmModelResponse]
$creadListPrec :: ReadPrec [UpdateAlarmModelResponse]
readPrec :: ReadPrec UpdateAlarmModelResponse
$creadPrec :: ReadPrec UpdateAlarmModelResponse
readList :: ReadS [UpdateAlarmModelResponse]
$creadList :: ReadS [UpdateAlarmModelResponse]
readsPrec :: Int -> ReadS UpdateAlarmModelResponse
$creadsPrec :: Int -> ReadS UpdateAlarmModelResponse
Prelude.Read, Int -> UpdateAlarmModelResponse -> ShowS
[UpdateAlarmModelResponse] -> ShowS
UpdateAlarmModelResponse -> String
(Int -> UpdateAlarmModelResponse -> ShowS)
-> (UpdateAlarmModelResponse -> String)
-> ([UpdateAlarmModelResponse] -> ShowS)
-> Show UpdateAlarmModelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAlarmModelResponse] -> ShowS
$cshowList :: [UpdateAlarmModelResponse] -> ShowS
show :: UpdateAlarmModelResponse -> String
$cshow :: UpdateAlarmModelResponse -> String
showsPrec :: Int -> UpdateAlarmModelResponse -> ShowS
$cshowsPrec :: Int -> UpdateAlarmModelResponse -> ShowS
Prelude.Show, (forall x.
 UpdateAlarmModelResponse -> Rep UpdateAlarmModelResponse x)
-> (forall x.
    Rep UpdateAlarmModelResponse x -> UpdateAlarmModelResponse)
-> Generic UpdateAlarmModelResponse
forall x.
Rep UpdateAlarmModelResponse x -> UpdateAlarmModelResponse
forall x.
UpdateAlarmModelResponse -> Rep UpdateAlarmModelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAlarmModelResponse x -> UpdateAlarmModelResponse
$cfrom :: forall x.
UpdateAlarmModelResponse -> Rep UpdateAlarmModelResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAlarmModelResponse' 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', 'updateAlarmModelResponse_creationTime' - The time the alarm model was created, in the Unix epoch format.
--
-- 'status', 'updateAlarmModelResponse_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.
--
-- 'lastUpdateTime', 'updateAlarmModelResponse_lastUpdateTime' - The time the alarm model was last updated, in the Unix epoch format.
--
-- 'alarmModelVersion', 'updateAlarmModelResponse_alarmModelVersion' - The version of the alarm model.
--
-- 'alarmModelArn', 'updateAlarmModelResponse_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/.
--
-- 'httpStatus', 'updateAlarmModelResponse_httpStatus' - The response's http status code.
newUpdateAlarmModelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateAlarmModelResponse
newUpdateAlarmModelResponse :: Int -> UpdateAlarmModelResponse
newUpdateAlarmModelResponse Int
pHttpStatus_ =
  UpdateAlarmModelResponse' :: Maybe POSIX
-> Maybe AlarmModelVersionStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateAlarmModelResponse
UpdateAlarmModelResponse'
    { $sel:creationTime:UpdateAlarmModelResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateAlarmModelResponse' :: Maybe AlarmModelVersionStatus
status = Maybe AlarmModelVersionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateTime:UpdateAlarmModelResponse' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmModelVersion:UpdateAlarmModelResponse' :: Maybe Text
alarmModelVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmModelArn:UpdateAlarmModelResponse' :: Maybe Text
alarmModelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateAlarmModelResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The time the alarm model was created, in the Unix epoch format.
updateAlarmModelResponse_creationTime :: Lens.Lens' UpdateAlarmModelResponse (Prelude.Maybe Prelude.UTCTime)
updateAlarmModelResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateAlarmModelResponse -> f UpdateAlarmModelResponse
updateAlarmModelResponse_creationTime = (UpdateAlarmModelResponse -> Maybe POSIX)
-> (UpdateAlarmModelResponse
    -> Maybe POSIX -> UpdateAlarmModelResponse)
-> Lens
     UpdateAlarmModelResponse
     UpdateAlarmModelResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAlarmModelResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:UpdateAlarmModelResponse' :: UpdateAlarmModelResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: UpdateAlarmModelResponse
s@UpdateAlarmModelResponse' {} Maybe POSIX
a -> UpdateAlarmModelResponse
s {$sel:creationTime:UpdateAlarmModelResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: UpdateAlarmModelResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateAlarmModelResponse -> f UpdateAlarmModelResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateAlarmModelResponse
-> f UpdateAlarmModelResponse
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.
updateAlarmModelResponse_status :: Lens.Lens' UpdateAlarmModelResponse (Prelude.Maybe AlarmModelVersionStatus)
updateAlarmModelResponse_status :: (Maybe AlarmModelVersionStatus
 -> f (Maybe AlarmModelVersionStatus))
-> UpdateAlarmModelResponse -> f UpdateAlarmModelResponse
updateAlarmModelResponse_status = (UpdateAlarmModelResponse -> Maybe AlarmModelVersionStatus)
-> (UpdateAlarmModelResponse
    -> Maybe AlarmModelVersionStatus -> UpdateAlarmModelResponse)
-> Lens
     UpdateAlarmModelResponse
     UpdateAlarmModelResponse
     (Maybe AlarmModelVersionStatus)
     (Maybe AlarmModelVersionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAlarmModelResponse' {Maybe AlarmModelVersionStatus
status :: Maybe AlarmModelVersionStatus
$sel:status:UpdateAlarmModelResponse' :: UpdateAlarmModelResponse -> Maybe AlarmModelVersionStatus
status} -> Maybe AlarmModelVersionStatus
status) (\s :: UpdateAlarmModelResponse
s@UpdateAlarmModelResponse' {} Maybe AlarmModelVersionStatus
a -> UpdateAlarmModelResponse
s {$sel:status:UpdateAlarmModelResponse' :: Maybe AlarmModelVersionStatus
status = Maybe AlarmModelVersionStatus
a} :: UpdateAlarmModelResponse)

-- | The time the alarm model was last updated, in the Unix epoch format.
updateAlarmModelResponse_lastUpdateTime :: Lens.Lens' UpdateAlarmModelResponse (Prelude.Maybe Prelude.UTCTime)
updateAlarmModelResponse_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateAlarmModelResponse -> f UpdateAlarmModelResponse
updateAlarmModelResponse_lastUpdateTime = (UpdateAlarmModelResponse -> Maybe POSIX)
-> (UpdateAlarmModelResponse
    -> Maybe POSIX -> UpdateAlarmModelResponse)
-> Lens
     UpdateAlarmModelResponse
     UpdateAlarmModelResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAlarmModelResponse' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:UpdateAlarmModelResponse' :: UpdateAlarmModelResponse -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: UpdateAlarmModelResponse
s@UpdateAlarmModelResponse' {} Maybe POSIX
a -> UpdateAlarmModelResponse
s {$sel:lastUpdateTime:UpdateAlarmModelResponse' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: UpdateAlarmModelResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateAlarmModelResponse -> f UpdateAlarmModelResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateAlarmModelResponse
-> f UpdateAlarmModelResponse
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.
updateAlarmModelResponse_alarmModelVersion :: Lens.Lens' UpdateAlarmModelResponse (Prelude.Maybe Prelude.Text)
updateAlarmModelResponse_alarmModelVersion :: (Maybe Text -> f (Maybe Text))
-> UpdateAlarmModelResponse -> f UpdateAlarmModelResponse
updateAlarmModelResponse_alarmModelVersion = (UpdateAlarmModelResponse -> Maybe Text)
-> (UpdateAlarmModelResponse
    -> Maybe Text -> UpdateAlarmModelResponse)
-> Lens
     UpdateAlarmModelResponse
     UpdateAlarmModelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAlarmModelResponse' {Maybe Text
alarmModelVersion :: Maybe Text
$sel:alarmModelVersion:UpdateAlarmModelResponse' :: UpdateAlarmModelResponse -> Maybe Text
alarmModelVersion} -> Maybe Text
alarmModelVersion) (\s :: UpdateAlarmModelResponse
s@UpdateAlarmModelResponse' {} Maybe Text
a -> UpdateAlarmModelResponse
s {$sel:alarmModelVersion:UpdateAlarmModelResponse' :: Maybe Text
alarmModelVersion = Maybe Text
a} :: UpdateAlarmModelResponse)

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

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

instance Prelude.NFData UpdateAlarmModelResponse