{-# 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.AppMonitorDetails
-- 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.AppMonitorDetails 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

-- | A structure that contains information about the RUM app monitor.
--
-- /See:/ 'newAppMonitorDetails' smart constructor.
data AppMonitorDetails = AppMonitorDetails'
  { -- | The unique ID of the app monitor.
    AppMonitorDetails -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the app monitor.
    AppMonitorDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The version of the app monitor.
    AppMonitorDetails -> Maybe Text
version :: Prelude.Maybe Prelude.Text
  }
  deriving (AppMonitorDetails -> AppMonitorDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppMonitorDetails -> AppMonitorDetails -> Bool
$c/= :: AppMonitorDetails -> AppMonitorDetails -> Bool
== :: AppMonitorDetails -> AppMonitorDetails -> Bool
$c== :: AppMonitorDetails -> AppMonitorDetails -> Bool
Prelude.Eq, ReadPrec [AppMonitorDetails]
ReadPrec AppMonitorDetails
Int -> ReadS AppMonitorDetails
ReadS [AppMonitorDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppMonitorDetails]
$creadListPrec :: ReadPrec [AppMonitorDetails]
readPrec :: ReadPrec AppMonitorDetails
$creadPrec :: ReadPrec AppMonitorDetails
readList :: ReadS [AppMonitorDetails]
$creadList :: ReadS [AppMonitorDetails]
readsPrec :: Int -> ReadS AppMonitorDetails
$creadsPrec :: Int -> ReadS AppMonitorDetails
Prelude.Read, Int -> AppMonitorDetails -> ShowS
[AppMonitorDetails] -> ShowS
AppMonitorDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppMonitorDetails] -> ShowS
$cshowList :: [AppMonitorDetails] -> ShowS
show :: AppMonitorDetails -> String
$cshow :: AppMonitorDetails -> String
showsPrec :: Int -> AppMonitorDetails -> ShowS
$cshowsPrec :: Int -> AppMonitorDetails -> ShowS
Prelude.Show, forall x. Rep AppMonitorDetails x -> AppMonitorDetails
forall x. AppMonitorDetails -> Rep AppMonitorDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AppMonitorDetails x -> AppMonitorDetails
$cfrom :: forall x. AppMonitorDetails -> Rep AppMonitorDetails x
Prelude.Generic)

-- |
-- Create a value of 'AppMonitorDetails' 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:
--
-- 'id', 'appMonitorDetails_id' - The unique ID of the app monitor.
--
-- 'name', 'appMonitorDetails_name' - The name of the app monitor.
--
-- 'version', 'appMonitorDetails_version' - The version of the app monitor.
newAppMonitorDetails ::
  AppMonitorDetails
newAppMonitorDetails :: AppMonitorDetails
newAppMonitorDetails =
  AppMonitorDetails'
    { $sel:id:AppMonitorDetails' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:AppMonitorDetails' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:version:AppMonitorDetails' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | The version of the app monitor.
appMonitorDetails_version :: Lens.Lens' AppMonitorDetails (Prelude.Maybe Prelude.Text)
appMonitorDetails_version :: Lens' AppMonitorDetails (Maybe Text)
appMonitorDetails_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppMonitorDetails' {Maybe Text
version :: Maybe Text
$sel:version:AppMonitorDetails' :: AppMonitorDetails -> Maybe Text
version} -> Maybe Text
version) (\s :: AppMonitorDetails
s@AppMonitorDetails' {} Maybe Text
a -> AppMonitorDetails
s {$sel:version:AppMonitorDetails' :: Maybe Text
version = Maybe Text
a} :: AppMonitorDetails)

instance Prelude.Hashable AppMonitorDetails where
  hashWithSalt :: Int -> AppMonitorDetails -> Int
hashWithSalt Int
_salt AppMonitorDetails' {Maybe Text
version :: Maybe Text
name :: Maybe Text
id :: Maybe Text
$sel:version:AppMonitorDetails' :: AppMonitorDetails -> Maybe Text
$sel:name:AppMonitorDetails' :: AppMonitorDetails -> Maybe Text
$sel:id:AppMonitorDetails' :: AppMonitorDetails -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version

instance Prelude.NFData AppMonitorDetails where
  rnf :: AppMonitorDetails -> ()
rnf AppMonitorDetails' {Maybe Text
version :: Maybe Text
name :: Maybe Text
id :: Maybe Text
$sel:version:AppMonitorDetails' :: AppMonitorDetails -> Maybe Text
$sel:name:AppMonitorDetails' :: AppMonitorDetails -> Maybe Text
$sel:id:AppMonitorDetails' :: AppMonitorDetails -> Maybe Text
..} =
    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
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version

instance Data.ToJSON AppMonitorDetails where
  toJSON :: AppMonitorDetails -> Value
toJSON AppMonitorDetails' {Maybe Text
version :: Maybe Text
name :: Maybe Text
id :: Maybe Text
$sel:version:AppMonitorDetails' :: AppMonitorDetails -> Maybe Text
$sel:name:AppMonitorDetails' :: AppMonitorDetails -> Maybe Text
$sel:id:AppMonitorDetails' :: AppMonitorDetails -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
id,
            (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Key
"version" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
version
          ]
      )