{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.IoTEvents.CreateAlarmModel
-- Copyright   : (c) 2013-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)
--
-- Creates an alarm model to monitor an AWS IoT Events input attribute. You
-- can use the alarm to get notified when the value is outside a specified
-- range. For more information, see
-- <https://docs.aws.amazon.com/iotevents/latest/developerguide/create-alarms.html Create an alarm model>
-- in the /AWS IoT Events Developer Guide/.
module Amazonka.IoTEvents.CreateAlarmModel
  ( -- * Creating a Request
    CreateAlarmModel (..),
    newCreateAlarmModel,

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

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

    -- * Response Lenses
    createAlarmModelResponse_creationTime,
    createAlarmModelResponse_status,
    createAlarmModelResponse_lastUpdateTime,
    createAlarmModelResponse_alarmModelVersion,
    createAlarmModelResponse_alarmModelArn,
    createAlarmModelResponse_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:/ 'newCreateAlarmModel' smart constructor.
data CreateAlarmModel = CreateAlarmModel'
  { -- | A non-negative integer that reflects the severity level of the alarm.
    CreateAlarmModel -> Maybe Natural
severity :: Prelude.Maybe Prelude.Natural,
    -- | Contains information about one or more notification actions.
    CreateAlarmModel -> Maybe AlarmNotification
alarmNotification :: Prelude.Maybe AlarmNotification,
    -- | An input attribute used as a key to create an alarm. AWS IoT Events
    -- routes
    -- <https://docs.aws.amazon.com/iotevents/latest/apireference/API_Input.html inputs>
    -- associated with this key to the alarm.
    CreateAlarmModel -> Maybe Text
key :: Prelude.Maybe Prelude.Text,
    -- | A description that tells you what the alarm model detects.
    CreateAlarmModel -> Maybe Text
alarmModelDescription :: Prelude.Maybe Prelude.Text,
    -- | Contains information about one or more alarm actions.
    CreateAlarmModel -> Maybe AlarmEventActions
alarmEventActions :: Prelude.Maybe AlarmEventActions,
    -- | Contains the configuration information of alarm state changes.
    CreateAlarmModel -> Maybe AlarmCapabilities
alarmCapabilities :: Prelude.Maybe AlarmCapabilities,
    -- | A list of key-value pairs that contain metadata for the alarm model. The
    -- tags help you manage the alarm model. For more information, see
    -- <https://docs.aws.amazon.com/iotevents/latest/developerguide/tagging-iotevents.html Tagging your AWS IoT Events resources>
    -- in the /AWS IoT Events Developer Guide/.
    --
    -- You can create up to 50 tags for one alarm model.
    CreateAlarmModel -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | A unique name that helps you identify the alarm model. You can\'t change
    -- this name after you create the alarm model.
    CreateAlarmModel -> Text
alarmModelName :: Prelude.Text,
    -- | The ARN of the IAM role that allows the alarm to perform actions and
    -- access AWS resources. For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
    -- in the /AWS General Reference/.
    CreateAlarmModel -> Text
roleArn :: Prelude.Text,
    -- | Defines when your alarm is invoked.
    CreateAlarmModel -> AlarmRule
alarmRule :: AlarmRule
  }
  deriving (CreateAlarmModel -> CreateAlarmModel -> Bool
(CreateAlarmModel -> CreateAlarmModel -> Bool)
-> (CreateAlarmModel -> CreateAlarmModel -> Bool)
-> Eq CreateAlarmModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAlarmModel -> CreateAlarmModel -> Bool
$c/= :: CreateAlarmModel -> CreateAlarmModel -> Bool
== :: CreateAlarmModel -> CreateAlarmModel -> Bool
$c== :: CreateAlarmModel -> CreateAlarmModel -> Bool
Prelude.Eq, ReadPrec [CreateAlarmModel]
ReadPrec CreateAlarmModel
Int -> ReadS CreateAlarmModel
ReadS [CreateAlarmModel]
(Int -> ReadS CreateAlarmModel)
-> ReadS [CreateAlarmModel]
-> ReadPrec CreateAlarmModel
-> ReadPrec [CreateAlarmModel]
-> Read CreateAlarmModel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAlarmModel]
$creadListPrec :: ReadPrec [CreateAlarmModel]
readPrec :: ReadPrec CreateAlarmModel
$creadPrec :: ReadPrec CreateAlarmModel
readList :: ReadS [CreateAlarmModel]
$creadList :: ReadS [CreateAlarmModel]
readsPrec :: Int -> ReadS CreateAlarmModel
$creadsPrec :: Int -> ReadS CreateAlarmModel
Prelude.Read, Int -> CreateAlarmModel -> ShowS
[CreateAlarmModel] -> ShowS
CreateAlarmModel -> String
(Int -> CreateAlarmModel -> ShowS)
-> (CreateAlarmModel -> String)
-> ([CreateAlarmModel] -> ShowS)
-> Show CreateAlarmModel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAlarmModel] -> ShowS
$cshowList :: [CreateAlarmModel] -> ShowS
show :: CreateAlarmModel -> String
$cshow :: CreateAlarmModel -> String
showsPrec :: Int -> CreateAlarmModel -> ShowS
$cshowsPrec :: Int -> CreateAlarmModel -> ShowS
Prelude.Show, (forall x. CreateAlarmModel -> Rep CreateAlarmModel x)
-> (forall x. Rep CreateAlarmModel x -> CreateAlarmModel)
-> Generic CreateAlarmModel
forall x. Rep CreateAlarmModel x -> CreateAlarmModel
forall x. CreateAlarmModel -> Rep CreateAlarmModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAlarmModel x -> CreateAlarmModel
$cfrom :: forall x. CreateAlarmModel -> Rep CreateAlarmModel x
Prelude.Generic)

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

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

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

-- | An input attribute used as a key to create an alarm. AWS IoT Events
-- routes
-- <https://docs.aws.amazon.com/iotevents/latest/apireference/API_Input.html inputs>
-- associated with this key to the alarm.
createAlarmModel_key :: Lens.Lens' CreateAlarmModel (Prelude.Maybe Prelude.Text)
createAlarmModel_key :: (Maybe Text -> f (Maybe Text))
-> CreateAlarmModel -> f CreateAlarmModel
createAlarmModel_key = (CreateAlarmModel -> Maybe Text)
-> (CreateAlarmModel -> Maybe Text -> CreateAlarmModel)
-> Lens CreateAlarmModel CreateAlarmModel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Maybe Text
key :: Maybe Text
$sel:key:CreateAlarmModel' :: CreateAlarmModel -> Maybe Text
key} -> Maybe Text
key) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Maybe Text
a -> CreateAlarmModel
s {$sel:key:CreateAlarmModel' :: Maybe Text
key = Maybe Text
a} :: CreateAlarmModel)

-- | A description that tells you what the alarm model detects.
createAlarmModel_alarmModelDescription :: Lens.Lens' CreateAlarmModel (Prelude.Maybe Prelude.Text)
createAlarmModel_alarmModelDescription :: (Maybe Text -> f (Maybe Text))
-> CreateAlarmModel -> f CreateAlarmModel
createAlarmModel_alarmModelDescription = (CreateAlarmModel -> Maybe Text)
-> (CreateAlarmModel -> Maybe Text -> CreateAlarmModel)
-> Lens CreateAlarmModel CreateAlarmModel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Maybe Text
alarmModelDescription :: Maybe Text
$sel:alarmModelDescription:CreateAlarmModel' :: CreateAlarmModel -> Maybe Text
alarmModelDescription} -> Maybe Text
alarmModelDescription) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Maybe Text
a -> CreateAlarmModel
s {$sel:alarmModelDescription:CreateAlarmModel' :: Maybe Text
alarmModelDescription = Maybe Text
a} :: CreateAlarmModel)

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

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

-- | A list of key-value pairs that contain metadata for the alarm model. The
-- tags help you manage the alarm model. For more information, see
-- <https://docs.aws.amazon.com/iotevents/latest/developerguide/tagging-iotevents.html Tagging your AWS IoT Events resources>
-- in the /AWS IoT Events Developer Guide/.
--
-- You can create up to 50 tags for one alarm model.
createAlarmModel_tags :: Lens.Lens' CreateAlarmModel (Prelude.Maybe [Tag])
createAlarmModel_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateAlarmModel -> f CreateAlarmModel
createAlarmModel_tags = (CreateAlarmModel -> Maybe [Tag])
-> (CreateAlarmModel -> Maybe [Tag] -> CreateAlarmModel)
-> Lens
     CreateAlarmModel CreateAlarmModel (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateAlarmModel' :: CreateAlarmModel -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Maybe [Tag]
a -> CreateAlarmModel
s {$sel:tags:CreateAlarmModel' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateAlarmModel) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateAlarmModel -> f CreateAlarmModel)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateAlarmModel
-> f CreateAlarmModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A unique name that helps you identify the alarm model. You can\'t change
-- this name after you create the alarm model.
createAlarmModel_alarmModelName :: Lens.Lens' CreateAlarmModel Prelude.Text
createAlarmModel_alarmModelName :: (Text -> f Text) -> CreateAlarmModel -> f CreateAlarmModel
createAlarmModel_alarmModelName = (CreateAlarmModel -> Text)
-> (CreateAlarmModel -> Text -> CreateAlarmModel)
-> Lens CreateAlarmModel CreateAlarmModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Text
alarmModelName :: Text
$sel:alarmModelName:CreateAlarmModel' :: CreateAlarmModel -> Text
alarmModelName} -> Text
alarmModelName) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Text
a -> CreateAlarmModel
s {$sel:alarmModelName:CreateAlarmModel' :: Text
alarmModelName = Text
a} :: CreateAlarmModel)

-- | The ARN of the IAM role that allows the alarm to perform actions and
-- access AWS resources. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /AWS General Reference/.
createAlarmModel_roleArn :: Lens.Lens' CreateAlarmModel Prelude.Text
createAlarmModel_roleArn :: (Text -> f Text) -> CreateAlarmModel -> f CreateAlarmModel
createAlarmModel_roleArn = (CreateAlarmModel -> Text)
-> (CreateAlarmModel -> Text -> CreateAlarmModel)
-> Lens CreateAlarmModel CreateAlarmModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModel' {Text
roleArn :: Text
$sel:roleArn:CreateAlarmModel' :: CreateAlarmModel -> Text
roleArn} -> Text
roleArn) (\s :: CreateAlarmModel
s@CreateAlarmModel' {} Text
a -> CreateAlarmModel
s {$sel:roleArn:CreateAlarmModel' :: Text
roleArn = Text
a} :: CreateAlarmModel)

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

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

instance Prelude.NFData CreateAlarmModel

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

instance Core.ToJSON CreateAlarmModel where
  toJSON :: CreateAlarmModel -> Value
toJSON CreateAlarmModel' {Maybe Natural
Maybe [Tag]
Maybe Text
Maybe AlarmCapabilities
Maybe AlarmNotification
Maybe AlarmEventActions
Text
AlarmRule
alarmRule :: AlarmRule
roleArn :: Text
alarmModelName :: Text
tags :: Maybe [Tag]
alarmCapabilities :: Maybe AlarmCapabilities
alarmEventActions :: Maybe AlarmEventActions
alarmModelDescription :: Maybe Text
key :: Maybe Text
alarmNotification :: Maybe AlarmNotification
severity :: Maybe Natural
$sel:alarmRule:CreateAlarmModel' :: CreateAlarmModel -> AlarmRule
$sel:roleArn:CreateAlarmModel' :: CreateAlarmModel -> Text
$sel:alarmModelName:CreateAlarmModel' :: CreateAlarmModel -> Text
$sel:tags:CreateAlarmModel' :: CreateAlarmModel -> Maybe [Tag]
$sel:alarmCapabilities:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmCapabilities
$sel:alarmEventActions:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmEventActions
$sel:alarmModelDescription:CreateAlarmModel' :: CreateAlarmModel -> Maybe Text
$sel:key:CreateAlarmModel' :: CreateAlarmModel -> Maybe Text
$sel:alarmNotification:CreateAlarmModel' :: CreateAlarmModel -> Maybe AlarmNotification
$sel:severity:CreateAlarmModel' :: CreateAlarmModel -> 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
"key" 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
key,
            (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,
            (Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"alarmModelName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
alarmModelName),
            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 CreateAlarmModel where
  toPath :: CreateAlarmModel -> ByteString
toPath = ByteString -> CreateAlarmModel -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/alarm-models"

instance Core.ToQuery CreateAlarmModel where
  toQuery :: CreateAlarmModel -> QueryString
toQuery = QueryString -> CreateAlarmModel -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

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

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

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

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

-- | The ARN of the alarm model. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /AWS General Reference/.
createAlarmModelResponse_alarmModelArn :: Lens.Lens' CreateAlarmModelResponse (Prelude.Maybe Prelude.Text)
createAlarmModelResponse_alarmModelArn :: (Maybe Text -> f (Maybe Text))
-> CreateAlarmModelResponse -> f CreateAlarmModelResponse
createAlarmModelResponse_alarmModelArn = (CreateAlarmModelResponse -> Maybe Text)
-> (CreateAlarmModelResponse
    -> Maybe Text -> CreateAlarmModelResponse)
-> Lens
     CreateAlarmModelResponse
     CreateAlarmModelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlarmModelResponse' {Maybe Text
alarmModelArn :: Maybe Text
$sel:alarmModelArn:CreateAlarmModelResponse' :: CreateAlarmModelResponse -> Maybe Text
alarmModelArn} -> Maybe Text
alarmModelArn) (\s :: CreateAlarmModelResponse
s@CreateAlarmModelResponse' {} Maybe Text
a -> CreateAlarmModelResponse
s {$sel:alarmModelArn:CreateAlarmModelResponse' :: Maybe Text
alarmModelArn = Maybe Text
a} :: CreateAlarmModelResponse)

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

instance Prelude.NFData CreateAlarmModelResponse