{-# 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.Rum.Types.AppMonitorSummary
-- 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.Rum.Types.AppMonitorSummary 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
import Amazonka.Rum.Types.StateEnum

-- | A structure that includes some data about app monitors and their
-- settings.
--
-- /See:/ 'newAppMonitorSummary' smart constructor.
data AppMonitorSummary = AppMonitorSummary'
  { -- | The date and time that the app monitor was created.
    AppMonitorSummary -> Maybe Text
created :: Prelude.Maybe Prelude.Text,
    -- | The unique ID of this app monitor.
    AppMonitorSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The date and time of the most recent changes to this app monitor\'s
    -- configuration.
    AppMonitorSummary -> Maybe Text
lastModified :: Prelude.Maybe Prelude.Text,
    -- | The name of this app monitor.
    AppMonitorSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The current state of this app monitor.
    AppMonitorSummary -> Maybe StateEnum
state :: Prelude.Maybe StateEnum
  }
  deriving (AppMonitorSummary -> AppMonitorSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppMonitorSummary -> AppMonitorSummary -> Bool
$c/= :: AppMonitorSummary -> AppMonitorSummary -> Bool
== :: AppMonitorSummary -> AppMonitorSummary -> Bool
$c== :: AppMonitorSummary -> AppMonitorSummary -> Bool
Prelude.Eq, ReadPrec [AppMonitorSummary]
ReadPrec AppMonitorSummary
Int -> ReadS AppMonitorSummary
ReadS [AppMonitorSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppMonitorSummary]
$creadListPrec :: ReadPrec [AppMonitorSummary]
readPrec :: ReadPrec AppMonitorSummary
$creadPrec :: ReadPrec AppMonitorSummary
readList :: ReadS [AppMonitorSummary]
$creadList :: ReadS [AppMonitorSummary]
readsPrec :: Int -> ReadS AppMonitorSummary
$creadsPrec :: Int -> ReadS AppMonitorSummary
Prelude.Read, Int -> AppMonitorSummary -> ShowS
[AppMonitorSummary] -> ShowS
AppMonitorSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppMonitorSummary] -> ShowS
$cshowList :: [AppMonitorSummary] -> ShowS
show :: AppMonitorSummary -> String
$cshow :: AppMonitorSummary -> String
showsPrec :: Int -> AppMonitorSummary -> ShowS
$cshowsPrec :: Int -> AppMonitorSummary -> ShowS
Prelude.Show, forall x. Rep AppMonitorSummary x -> AppMonitorSummary
forall x. AppMonitorSummary -> Rep AppMonitorSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AppMonitorSummary x -> AppMonitorSummary
$cfrom :: forall x. AppMonitorSummary -> Rep AppMonitorSummary x
Prelude.Generic)

-- |
-- Create a value of 'AppMonitorSummary' 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:
--
-- 'created', 'appMonitorSummary_created' - The date and time that the app monitor was created.
--
-- 'id', 'appMonitorSummary_id' - The unique ID of this app monitor.
--
-- 'lastModified', 'appMonitorSummary_lastModified' - The date and time of the most recent changes to this app monitor\'s
-- configuration.
--
-- 'name', 'appMonitorSummary_name' - The name of this app monitor.
--
-- 'state', 'appMonitorSummary_state' - The current state of this app monitor.
newAppMonitorSummary ::
  AppMonitorSummary
newAppMonitorSummary :: AppMonitorSummary
newAppMonitorSummary =
  AppMonitorSummary'
    { $sel:created:AppMonitorSummary' :: Maybe Text
created = forall a. Maybe a
Prelude.Nothing,
      $sel:id:AppMonitorSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModified:AppMonitorSummary' :: Maybe Text
lastModified = forall a. Maybe a
Prelude.Nothing,
      $sel:name:AppMonitorSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:state:AppMonitorSummary' :: Maybe StateEnum
state = forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time that the app monitor was created.
appMonitorSummary_created :: Lens.Lens' AppMonitorSummary (Prelude.Maybe Prelude.Text)
appMonitorSummary_created :: Lens' AppMonitorSummary (Maybe Text)
appMonitorSummary_created = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorSummary' {Maybe Text
created :: Maybe Text
$sel:created:AppMonitorSummary' :: AppMonitorSummary -> Maybe Text
created} -> Maybe Text
created) (\s :: AppMonitorSummary
s@AppMonitorSummary' {} Maybe Text
a -> AppMonitorSummary
s {$sel:created:AppMonitorSummary' :: Maybe Text
created = Maybe Text
a} :: AppMonitorSummary)

-- | The unique ID of this app monitor.
appMonitorSummary_id :: Lens.Lens' AppMonitorSummary (Prelude.Maybe Prelude.Text)
appMonitorSummary_id :: Lens' AppMonitorSummary (Maybe Text)
appMonitorSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorSummary' {Maybe Text
id :: Maybe Text
$sel:id:AppMonitorSummary' :: AppMonitorSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: AppMonitorSummary
s@AppMonitorSummary' {} Maybe Text
a -> AppMonitorSummary
s {$sel:id:AppMonitorSummary' :: Maybe Text
id = Maybe Text
a} :: AppMonitorSummary)

-- | The date and time of the most recent changes to this app monitor\'s
-- configuration.
appMonitorSummary_lastModified :: Lens.Lens' AppMonitorSummary (Prelude.Maybe Prelude.Text)
appMonitorSummary_lastModified :: Lens' AppMonitorSummary (Maybe Text)
appMonitorSummary_lastModified = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorSummary' {Maybe Text
lastModified :: Maybe Text
$sel:lastModified:AppMonitorSummary' :: AppMonitorSummary -> Maybe Text
lastModified} -> Maybe Text
lastModified) (\s :: AppMonitorSummary
s@AppMonitorSummary' {} Maybe Text
a -> AppMonitorSummary
s {$sel:lastModified:AppMonitorSummary' :: Maybe Text
lastModified = Maybe Text
a} :: AppMonitorSummary)

-- | The name of this app monitor.
appMonitorSummary_name :: Lens.Lens' AppMonitorSummary (Prelude.Maybe Prelude.Text)
appMonitorSummary_name :: Lens' AppMonitorSummary (Maybe Text)
appMonitorSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorSummary' {Maybe Text
name :: Maybe Text
$sel:name:AppMonitorSummary' :: AppMonitorSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: AppMonitorSummary
s@AppMonitorSummary' {} Maybe Text
a -> AppMonitorSummary
s {$sel:name:AppMonitorSummary' :: Maybe Text
name = Maybe Text
a} :: AppMonitorSummary)

-- | The current state of this app monitor.
appMonitorSummary_state :: Lens.Lens' AppMonitorSummary (Prelude.Maybe StateEnum)
appMonitorSummary_state :: Lens' AppMonitorSummary (Maybe StateEnum)
appMonitorSummary_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorSummary' {Maybe StateEnum
state :: Maybe StateEnum
$sel:state:AppMonitorSummary' :: AppMonitorSummary -> Maybe StateEnum
state} -> Maybe StateEnum
state) (\s :: AppMonitorSummary
s@AppMonitorSummary' {} Maybe StateEnum
a -> AppMonitorSummary
s {$sel:state:AppMonitorSummary' :: Maybe StateEnum
state = Maybe StateEnum
a} :: AppMonitorSummary)

instance Data.FromJSON AppMonitorSummary where
  parseJSON :: Value -> Parser AppMonitorSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AppMonitorSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe StateEnum
-> AppMonitorSummary
AppMonitorSummary'
            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
"Created")
            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
"Id")
            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
"LastModified")
            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
"Name")
            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
"State")
      )

instance Prelude.Hashable AppMonitorSummary where
  hashWithSalt :: Int -> AppMonitorSummary -> Int
hashWithSalt Int
_salt AppMonitorSummary' {Maybe Text
Maybe StateEnum
state :: Maybe StateEnum
name :: Maybe Text
lastModified :: Maybe Text
id :: Maybe Text
created :: Maybe Text
$sel:state:AppMonitorSummary' :: AppMonitorSummary -> Maybe StateEnum
$sel:name:AppMonitorSummary' :: AppMonitorSummary -> Maybe Text
$sel:lastModified:AppMonitorSummary' :: AppMonitorSummary -> Maybe Text
$sel:id:AppMonitorSummary' :: AppMonitorSummary -> Maybe Text
$sel:created:AppMonitorSummary' :: AppMonitorSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
created
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastModified
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StateEnum
state

instance Prelude.NFData AppMonitorSummary where
  rnf :: AppMonitorSummary -> ()
rnf AppMonitorSummary' {Maybe Text
Maybe StateEnum
state :: Maybe StateEnum
name :: Maybe Text
lastModified :: Maybe Text
id :: Maybe Text
created :: Maybe Text
$sel:state:AppMonitorSummary' :: AppMonitorSummary -> Maybe StateEnum
$sel:name:AppMonitorSummary' :: AppMonitorSummary -> Maybe Text
$sel:lastModified:AppMonitorSummary' :: AppMonitorSummary -> Maybe Text
$sel:id:AppMonitorSummary' :: AppMonitorSummary -> Maybe Text
$sel:created:AppMonitorSummary' :: AppMonitorSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
created
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastModified
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StateEnum
state