{-# 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.MonitorInfo
-- 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.MonitorInfo 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 information about the monitor resource.
--
-- /See:/ 'newMonitorInfo' smart constructor.
data MonitorInfo = MonitorInfo'
  { -- | The Amazon Resource Name (ARN) of the monitor resource.
    MonitorInfo -> Maybe Text
monitorArn :: 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@
    MonitorInfo -> Maybe Text
status :: Prelude.Maybe Prelude.Text
  }
  deriving (MonitorInfo -> MonitorInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MonitorInfo -> MonitorInfo -> Bool
$c/= :: MonitorInfo -> MonitorInfo -> Bool
== :: MonitorInfo -> MonitorInfo -> Bool
$c== :: MonitorInfo -> MonitorInfo -> Bool
Prelude.Eq, ReadPrec [MonitorInfo]
ReadPrec MonitorInfo
Int -> ReadS MonitorInfo
ReadS [MonitorInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MonitorInfo]
$creadListPrec :: ReadPrec [MonitorInfo]
readPrec :: ReadPrec MonitorInfo
$creadPrec :: ReadPrec MonitorInfo
readList :: ReadS [MonitorInfo]
$creadList :: ReadS [MonitorInfo]
readsPrec :: Int -> ReadS MonitorInfo
$creadsPrec :: Int -> ReadS MonitorInfo
Prelude.Read, Int -> MonitorInfo -> ShowS
[MonitorInfo] -> ShowS
MonitorInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MonitorInfo] -> ShowS
$cshowList :: [MonitorInfo] -> ShowS
show :: MonitorInfo -> String
$cshow :: MonitorInfo -> String
showsPrec :: Int -> MonitorInfo -> ShowS
$cshowsPrec :: Int -> MonitorInfo -> ShowS
Prelude.Show, forall x. Rep MonitorInfo x -> MonitorInfo
forall x. MonitorInfo -> Rep MonitorInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MonitorInfo x -> MonitorInfo
$cfrom :: forall x. MonitorInfo -> Rep MonitorInfo x
Prelude.Generic)

-- |
-- Create a value of 'MonitorInfo' 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:
--
-- 'monitorArn', 'monitorInfo_monitorArn' - The Amazon Resource Name (ARN) of the monitor resource.
--
-- 'status', 'monitorInfo_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@
newMonitorInfo ::
  MonitorInfo
newMonitorInfo :: MonitorInfo
newMonitorInfo =
  MonitorInfo'
    { $sel:monitorArn:MonitorInfo' :: Maybe Text
monitorArn = forall a. Maybe a
Prelude.Nothing,
      $sel:status:MonitorInfo' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Data.FromJSON MonitorInfo where
  parseJSON :: Value -> Parser MonitorInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MonitorInfo"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> MonitorInfo
MonitorInfo'
            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
"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
"Status")
      )

instance Prelude.Hashable MonitorInfo where
  hashWithSalt :: Int -> MonitorInfo -> Int
hashWithSalt Int
_salt MonitorInfo' {Maybe Text
status :: Maybe Text
monitorArn :: Maybe Text
$sel:status:MonitorInfo' :: MonitorInfo -> Maybe Text
$sel:monitorArn:MonitorInfo' :: MonitorInfo -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
monitorArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status

instance Prelude.NFData MonitorInfo where
  rnf :: MonitorInfo -> ()
rnf MonitorInfo' {Maybe Text
status :: Maybe Text
monitorArn :: Maybe Text
$sel:status:MonitorInfo' :: MonitorInfo -> Maybe Text
$sel:monitorArn:MonitorInfo' :: MonitorInfo -> Maybe Text
..} =
    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
status