{-# 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.Forecast.Types.MonitorSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Forecast.Types.MonitorSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Provides a summary of the monitor properties used in the ListMonitors
-- operation. To get a complete set of properties, call the DescribeMonitor
-- operation, and provide the listed @MonitorArn@.
--
-- /See:/ 'newMonitorSummary' smart constructor.
data MonitorSummary = MonitorSummary'
  { -- | When the monitor resource was created.
    MonitorSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | The last time the monitor resource was modified. The timestamp depends
    -- on the status of the job:
    --
    -- -   @CREATE_PENDING@ - The @CreationTime@.
    --
    -- -   @CREATE_IN_PROGRESS@ - The current timestamp.
    --
    -- -   @STOPPED@ - When the resource stopped.
    --
    -- -   @ACTIVE@ or @CREATE_FAILED@ - When the monitor creation finished or
    --     failed.
    MonitorSummary -> Maybe POSIX
lastModificationTime :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name (ARN) of the monitor resource.
    MonitorSummary -> Maybe Text
monitorArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the monitor resource.
    MonitorSummary -> Maybe Text
monitorName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the predictor being monitored.
    MonitorSummary -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
    -- | The status of the monitor. States include:
    --
    -- -   @ACTIVE@
    --
    -- -   @ACTIVE_STOPPING@, @ACTIVE_STOPPED@
    --
    -- -   @UPDATE_IN_PROGRESS@
    --
    -- -   @CREATE_PENDING@, @CREATE_IN_PROGRESS@, @CREATE_FAILED@
    --
    -- -   @DELETE_PENDING@, @DELETE_IN_PROGRESS@, @DELETE_FAILED@
    MonitorSummary -> Maybe Text
status :: Prelude.Maybe Prelude.Text
  }
  deriving (MonitorSummary -> MonitorSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MonitorSummary -> MonitorSummary -> Bool
$c/= :: MonitorSummary -> MonitorSummary -> Bool
== :: MonitorSummary -> MonitorSummary -> Bool
$c== :: MonitorSummary -> MonitorSummary -> Bool
Prelude.Eq, ReadPrec [MonitorSummary]
ReadPrec MonitorSummary
Int -> ReadS MonitorSummary
ReadS [MonitorSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MonitorSummary]
$creadListPrec :: ReadPrec [MonitorSummary]
readPrec :: ReadPrec MonitorSummary
$creadPrec :: ReadPrec MonitorSummary
readList :: ReadS [MonitorSummary]
$creadList :: ReadS [MonitorSummary]
readsPrec :: Int -> ReadS MonitorSummary
$creadsPrec :: Int -> ReadS MonitorSummary
Prelude.Read, Int -> MonitorSummary -> ShowS
[MonitorSummary] -> ShowS
MonitorSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MonitorSummary] -> ShowS
$cshowList :: [MonitorSummary] -> ShowS
show :: MonitorSummary -> String
$cshow :: MonitorSummary -> String
showsPrec :: Int -> MonitorSummary -> ShowS
$cshowsPrec :: Int -> MonitorSummary -> ShowS
Prelude.Show, forall x. Rep MonitorSummary x -> MonitorSummary
forall x. MonitorSummary -> Rep MonitorSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MonitorSummary x -> MonitorSummary
$cfrom :: forall x. MonitorSummary -> Rep MonitorSummary x
Prelude.Generic)

-- |
-- Create a value of 'MonitorSummary' 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', 'monitorSummary_creationTime' - When the monitor resource was created.
--
-- 'lastModificationTime', 'monitorSummary_lastModificationTime' - The last time the monitor resource was modified. The timestamp depends
-- on the status of the job:
--
-- -   @CREATE_PENDING@ - The @CreationTime@.
--
-- -   @CREATE_IN_PROGRESS@ - The current timestamp.
--
-- -   @STOPPED@ - When the resource stopped.
--
-- -   @ACTIVE@ or @CREATE_FAILED@ - When the monitor creation finished or
--     failed.
--
-- 'monitorArn', 'monitorSummary_monitorArn' - The Amazon Resource Name (ARN) of the monitor resource.
--
-- 'monitorName', 'monitorSummary_monitorName' - The name of the monitor resource.
--
-- 'resourceArn', 'monitorSummary_resourceArn' - The Amazon Resource Name (ARN) of the predictor being monitored.
--
-- 'status', 'monitorSummary_status' - The status of the monitor. States include:
--
-- -   @ACTIVE@
--
-- -   @ACTIVE_STOPPING@, @ACTIVE_STOPPED@
--
-- -   @UPDATE_IN_PROGRESS@
--
-- -   @CREATE_PENDING@, @CREATE_IN_PROGRESS@, @CREATE_FAILED@
--
-- -   @DELETE_PENDING@, @DELETE_IN_PROGRESS@, @DELETE_FAILED@
newMonitorSummary ::
  MonitorSummary
newMonitorSummary :: MonitorSummary
newMonitorSummary =
  MonitorSummary'
    { $sel:creationTime:MonitorSummary' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModificationTime:MonitorSummary' :: Maybe POSIX
lastModificationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:monitorArn:MonitorSummary' :: Maybe Text
monitorArn = forall a. Maybe a
Prelude.Nothing,
      $sel:monitorName:MonitorSummary' :: Maybe Text
monitorName = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceArn:MonitorSummary' :: Maybe Text
resourceArn = forall a. Maybe a
Prelude.Nothing,
      $sel:status:MonitorSummary' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing
    }

-- | When the monitor resource was created.
monitorSummary_creationTime :: Lens.Lens' MonitorSummary (Prelude.Maybe Prelude.UTCTime)
monitorSummary_creationTime :: Lens' MonitorSummary (Maybe UTCTime)
monitorSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitorSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:MonitorSummary' :: MonitorSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: MonitorSummary
s@MonitorSummary' {} Maybe POSIX
a -> MonitorSummary
s {$sel:creationTime:MonitorSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: MonitorSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The last time the monitor resource was modified. The timestamp depends
-- on the status of the job:
--
-- -   @CREATE_PENDING@ - The @CreationTime@.
--
-- -   @CREATE_IN_PROGRESS@ - The current timestamp.
--
-- -   @STOPPED@ - When the resource stopped.
--
-- -   @ACTIVE@ or @CREATE_FAILED@ - When the monitor creation finished or
--     failed.
monitorSummary_lastModificationTime :: Lens.Lens' MonitorSummary (Prelude.Maybe Prelude.UTCTime)
monitorSummary_lastModificationTime :: Lens' MonitorSummary (Maybe UTCTime)
monitorSummary_lastModificationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitorSummary' {Maybe POSIX
lastModificationTime :: Maybe POSIX
$sel:lastModificationTime:MonitorSummary' :: MonitorSummary -> Maybe POSIX
lastModificationTime} -> Maybe POSIX
lastModificationTime) (\s :: MonitorSummary
s@MonitorSummary' {} Maybe POSIX
a -> MonitorSummary
s {$sel:lastModificationTime:MonitorSummary' :: Maybe POSIX
lastModificationTime = Maybe POSIX
a} :: MonitorSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The Amazon Resource Name (ARN) of the monitor resource.
monitorSummary_monitorArn :: Lens.Lens' MonitorSummary (Prelude.Maybe Prelude.Text)
monitorSummary_monitorArn :: Lens' MonitorSummary (Maybe Text)
monitorSummary_monitorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitorSummary' {Maybe Text
monitorArn :: Maybe Text
$sel:monitorArn:MonitorSummary' :: MonitorSummary -> Maybe Text
monitorArn} -> Maybe Text
monitorArn) (\s :: MonitorSummary
s@MonitorSummary' {} Maybe Text
a -> MonitorSummary
s {$sel:monitorArn:MonitorSummary' :: Maybe Text
monitorArn = Maybe Text
a} :: MonitorSummary)

-- | The name of the monitor resource.
monitorSummary_monitorName :: Lens.Lens' MonitorSummary (Prelude.Maybe Prelude.Text)
monitorSummary_monitorName :: Lens' MonitorSummary (Maybe Text)
monitorSummary_monitorName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitorSummary' {Maybe Text
monitorName :: Maybe Text
$sel:monitorName:MonitorSummary' :: MonitorSummary -> Maybe Text
monitorName} -> Maybe Text
monitorName) (\s :: MonitorSummary
s@MonitorSummary' {} Maybe Text
a -> MonitorSummary
s {$sel:monitorName:MonitorSummary' :: Maybe Text
monitorName = Maybe Text
a} :: MonitorSummary)

-- | The Amazon Resource Name (ARN) of the predictor being monitored.
monitorSummary_resourceArn :: Lens.Lens' MonitorSummary (Prelude.Maybe Prelude.Text)
monitorSummary_resourceArn :: Lens' MonitorSummary (Maybe Text)
monitorSummary_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitorSummary' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:MonitorSummary' :: MonitorSummary -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: MonitorSummary
s@MonitorSummary' {} Maybe Text
a -> MonitorSummary
s {$sel:resourceArn:MonitorSummary' :: Maybe Text
resourceArn = Maybe Text
a} :: MonitorSummary)

-- | The status of the monitor. States include:
--
-- -   @ACTIVE@
--
-- -   @ACTIVE_STOPPING@, @ACTIVE_STOPPED@
--
-- -   @UPDATE_IN_PROGRESS@
--
-- -   @CREATE_PENDING@, @CREATE_IN_PROGRESS@, @CREATE_FAILED@
--
-- -   @DELETE_PENDING@, @DELETE_IN_PROGRESS@, @DELETE_FAILED@
monitorSummary_status :: Lens.Lens' MonitorSummary (Prelude.Maybe Prelude.Text)
monitorSummary_status :: Lens' MonitorSummary (Maybe Text)
monitorSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitorSummary' {Maybe Text
status :: Maybe Text
$sel:status:MonitorSummary' :: MonitorSummary -> Maybe Text
status} -> Maybe Text
status) (\s :: MonitorSummary
s@MonitorSummary' {} Maybe Text
a -> MonitorSummary
s {$sel:status:MonitorSummary' :: Maybe Text
status = Maybe Text
a} :: MonitorSummary)

instance Data.FromJSON MonitorSummary where
  parseJSON :: Value -> Parser MonitorSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MonitorSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MonitorSummary
MonitorSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastModificationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MonitorArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MonitorName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ResourceArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
      )

instance Prelude.Hashable MonitorSummary where
  hashWithSalt :: Int -> MonitorSummary -> Int
hashWithSalt Int
_salt MonitorSummary' {Maybe Text
Maybe POSIX
status :: Maybe Text
resourceArn :: Maybe Text
monitorName :: Maybe Text
monitorArn :: Maybe Text
lastModificationTime :: Maybe POSIX
creationTime :: Maybe POSIX
$sel:status:MonitorSummary' :: MonitorSummary -> Maybe Text
$sel:resourceArn:MonitorSummary' :: MonitorSummary -> Maybe Text
$sel:monitorName:MonitorSummary' :: MonitorSummary -> Maybe Text
$sel:monitorArn:MonitorSummary' :: MonitorSummary -> Maybe Text
$sel:lastModificationTime:MonitorSummary' :: MonitorSummary -> Maybe POSIX
$sel:creationTime:MonitorSummary' :: MonitorSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModificationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
monitorArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
monitorName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status

instance Prelude.NFData MonitorSummary where
  rnf :: MonitorSummary -> ()
rnf MonitorSummary' {Maybe Text
Maybe POSIX
status :: Maybe Text
resourceArn :: Maybe Text
monitorName :: Maybe Text
monitorArn :: Maybe Text
lastModificationTime :: Maybe POSIX
creationTime :: Maybe POSIX
$sel:status:MonitorSummary' :: MonitorSummary -> Maybe Text
$sel:resourceArn:MonitorSummary' :: MonitorSummary -> Maybe Text
$sel:monitorName:MonitorSummary' :: MonitorSummary -> Maybe Text
$sel:monitorArn:MonitorSummary' :: MonitorSummary -> Maybe Text
$sel:lastModificationTime:MonitorSummary' :: MonitorSummary -> Maybe POSIX
$sel:creationTime:MonitorSummary' :: MonitorSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModificationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
monitorArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
monitorName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
status