{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.AlarmModelVersionSummary
-- 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)
module Amazonka.IoTEvents.Types.AlarmModelVersionSummary where

import qualified Amazonka.Core as Core
import Amazonka.IoTEvents.Types.AlarmModelVersionStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'AlarmModelVersionSummary' 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', 'alarmModelVersionSummary_creationTime' - The time the alarm model was created, in the Unix epoch format.
--
-- 'status', 'alarmModelVersionSummary_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.
--
-- 'alarmModelName', 'alarmModelVersionSummary_alarmModelName' - The name of the alarm model.
--
-- 'statusMessage', 'alarmModelVersionSummary_statusMessage' - Contains information about the status of the alarm model version.
--
-- 'lastUpdateTime', 'alarmModelVersionSummary_lastUpdateTime' - The time the alarm model was last updated, in the Unix epoch format.
--
-- 'alarmModelVersion', 'alarmModelVersionSummary_alarmModelVersion' - The version of the alarm model.
--
-- 'alarmModelArn', 'alarmModelVersionSummary_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', 'alarmModelVersionSummary_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/.
newAlarmModelVersionSummary ::
  AlarmModelVersionSummary
newAlarmModelVersionSummary :: AlarmModelVersionSummary
newAlarmModelVersionSummary =
  AlarmModelVersionSummary' :: Maybe POSIX
-> Maybe AlarmModelVersionStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AlarmModelVersionSummary
AlarmModelVersionSummary'
    { $sel:creationTime:AlarmModelVersionSummary' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:AlarmModelVersionSummary' :: Maybe AlarmModelVersionStatus
status = Maybe AlarmModelVersionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmModelName:AlarmModelVersionSummary' :: Maybe Text
alarmModelName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:AlarmModelVersionSummary' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateTime:AlarmModelVersionSummary' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmModelVersion:AlarmModelVersionSummary' :: Maybe Text
alarmModelVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmModelArn:AlarmModelVersionSummary' :: Maybe Text
alarmModelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:AlarmModelVersionSummary' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

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

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

instance Core.FromJSON AlarmModelVersionSummary where
  parseJSON :: Value -> Parser AlarmModelVersionSummary
parseJSON =
    String
-> (Object -> Parser AlarmModelVersionSummary)
-> Value
-> Parser AlarmModelVersionSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AlarmModelVersionSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe AlarmModelVersionStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AlarmModelVersionSummary
AlarmModelVersionSummary'
            (Maybe POSIX
 -> Maybe AlarmModelVersionStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> AlarmModelVersionSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe AlarmModelVersionStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AlarmModelVersionSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationTime")
            Parser
  (Maybe AlarmModelVersionStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AlarmModelVersionSummary)
-> Parser (Maybe AlarmModelVersionStatus)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AlarmModelVersionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AlarmModelVersionStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AlarmModelVersionSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AlarmModelVersionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"alarmModelName")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AlarmModelVersionSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AlarmModelVersionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"statusMessage")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AlarmModelVersionSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> AlarmModelVersionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdateTime")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> AlarmModelVersionSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AlarmModelVersionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"alarmModelVersion")
            Parser (Maybe Text -> Maybe Text -> AlarmModelVersionSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AlarmModelVersionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"alarmModelArn")
            Parser (Maybe Text -> AlarmModelVersionSummary)
-> Parser (Maybe Text) -> Parser AlarmModelVersionSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"roleArn")
      )

instance Prelude.Hashable AlarmModelVersionSummary

instance Prelude.NFData AlarmModelVersionSummary