{-# 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.ServiceCatalog.Types.CloudWatchDashboard
-- 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.ServiceCatalog.Types.CloudWatchDashboard where

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

-- | Information about a CloudWatch dashboard.
--
-- /See:/ 'newCloudWatchDashboard' smart constructor.
data CloudWatchDashboard = CloudWatchDashboard'
  { -- | The name of the CloudWatch dashboard.
    CloudWatchDashboard -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (CloudWatchDashboard -> CloudWatchDashboard -> Bool
(CloudWatchDashboard -> CloudWatchDashboard -> Bool)
-> (CloudWatchDashboard -> CloudWatchDashboard -> Bool)
-> Eq CloudWatchDashboard
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudWatchDashboard -> CloudWatchDashboard -> Bool
$c/= :: CloudWatchDashboard -> CloudWatchDashboard -> Bool
== :: CloudWatchDashboard -> CloudWatchDashboard -> Bool
$c== :: CloudWatchDashboard -> CloudWatchDashboard -> Bool
Prelude.Eq, ReadPrec [CloudWatchDashboard]
ReadPrec CloudWatchDashboard
Int -> ReadS CloudWatchDashboard
ReadS [CloudWatchDashboard]
(Int -> ReadS CloudWatchDashboard)
-> ReadS [CloudWatchDashboard]
-> ReadPrec CloudWatchDashboard
-> ReadPrec [CloudWatchDashboard]
-> Read CloudWatchDashboard
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudWatchDashboard]
$creadListPrec :: ReadPrec [CloudWatchDashboard]
readPrec :: ReadPrec CloudWatchDashboard
$creadPrec :: ReadPrec CloudWatchDashboard
readList :: ReadS [CloudWatchDashboard]
$creadList :: ReadS [CloudWatchDashboard]
readsPrec :: Int -> ReadS CloudWatchDashboard
$creadsPrec :: Int -> ReadS CloudWatchDashboard
Prelude.Read, Int -> CloudWatchDashboard -> ShowS
[CloudWatchDashboard] -> ShowS
CloudWatchDashboard -> String
(Int -> CloudWatchDashboard -> ShowS)
-> (CloudWatchDashboard -> String)
-> ([CloudWatchDashboard] -> ShowS)
-> Show CloudWatchDashboard
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudWatchDashboard] -> ShowS
$cshowList :: [CloudWatchDashboard] -> ShowS
show :: CloudWatchDashboard -> String
$cshow :: CloudWatchDashboard -> String
showsPrec :: Int -> CloudWatchDashboard -> ShowS
$cshowsPrec :: Int -> CloudWatchDashboard -> ShowS
Prelude.Show, (forall x. CloudWatchDashboard -> Rep CloudWatchDashboard x)
-> (forall x. Rep CloudWatchDashboard x -> CloudWatchDashboard)
-> Generic CloudWatchDashboard
forall x. Rep CloudWatchDashboard x -> CloudWatchDashboard
forall x. CloudWatchDashboard -> Rep CloudWatchDashboard x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CloudWatchDashboard x -> CloudWatchDashboard
$cfrom :: forall x. CloudWatchDashboard -> Rep CloudWatchDashboard x
Prelude.Generic)

-- |
-- Create a value of 'CloudWatchDashboard' 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:
--
-- 'name', 'cloudWatchDashboard_name' - The name of the CloudWatch dashboard.
newCloudWatchDashboard ::
  CloudWatchDashboard
newCloudWatchDashboard :: CloudWatchDashboard
newCloudWatchDashboard =
  CloudWatchDashboard' :: Maybe Text -> CloudWatchDashboard
CloudWatchDashboard' {$sel:name:CloudWatchDashboard' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The name of the CloudWatch dashboard.
cloudWatchDashboard_name :: Lens.Lens' CloudWatchDashboard (Prelude.Maybe Prelude.Text)
cloudWatchDashboard_name :: (Maybe Text -> f (Maybe Text))
-> CloudWatchDashboard -> f CloudWatchDashboard
cloudWatchDashboard_name = (CloudWatchDashboard -> Maybe Text)
-> (CloudWatchDashboard -> Maybe Text -> CloudWatchDashboard)
-> Lens
     CloudWatchDashboard CloudWatchDashboard (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchDashboard' {Maybe Text
name :: Maybe Text
$sel:name:CloudWatchDashboard' :: CloudWatchDashboard -> Maybe Text
name} -> Maybe Text
name) (\s :: CloudWatchDashboard
s@CloudWatchDashboard' {} Maybe Text
a -> CloudWatchDashboard
s {$sel:name:CloudWatchDashboard' :: Maybe Text
name = Maybe Text
a} :: CloudWatchDashboard)

instance Core.FromJSON CloudWatchDashboard where
  parseJSON :: Value -> Parser CloudWatchDashboard
parseJSON =
    String
-> (Object -> Parser CloudWatchDashboard)
-> Value
-> Parser CloudWatchDashboard
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CloudWatchDashboard"
      ( \Object
x ->
          Maybe Text -> CloudWatchDashboard
CloudWatchDashboard' (Maybe Text -> CloudWatchDashboard)
-> Parser (Maybe Text) -> Parser CloudWatchDashboard
forall (f :: * -> *) a b. Functor 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
"Name")
      )

instance Prelude.Hashable CloudWatchDashboard

instance Prelude.NFData CloudWatchDashboard