{-# 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.DevOpsGuru.Types.RecommendationRelatedCloudWatchMetricsSourceDetail
-- 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.DevOpsGuru.Types.RecommendationRelatedCloudWatchMetricsSourceDetail where

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

-- | Information about an Amazon CloudWatch metric that is analyzed by DevOps
-- Guru. It is one of many analyzed metrics that are used to generate
-- insights.
--
-- /See:/ 'newRecommendationRelatedCloudWatchMetricsSourceDetail' smart constructor.
data RecommendationRelatedCloudWatchMetricsSourceDetail = RecommendationRelatedCloudWatchMetricsSourceDetail'
  { -- | The name of the CloudWatch metric.
    RecommendationRelatedCloudWatchMetricsSourceDetail -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
    -- | The namespace of the CloudWatch metric. A namespace is a container for
    -- CloudWatch metrics.
    RecommendationRelatedCloudWatchMetricsSourceDetail -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text
  }
  deriving (RecommendationRelatedCloudWatchMetricsSourceDetail
-> RecommendationRelatedCloudWatchMetricsSourceDetail -> Bool
(RecommendationRelatedCloudWatchMetricsSourceDetail
 -> RecommendationRelatedCloudWatchMetricsSourceDetail -> Bool)
-> (RecommendationRelatedCloudWatchMetricsSourceDetail
    -> RecommendationRelatedCloudWatchMetricsSourceDetail -> Bool)
-> Eq RecommendationRelatedCloudWatchMetricsSourceDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecommendationRelatedCloudWatchMetricsSourceDetail
-> RecommendationRelatedCloudWatchMetricsSourceDetail -> Bool
$c/= :: RecommendationRelatedCloudWatchMetricsSourceDetail
-> RecommendationRelatedCloudWatchMetricsSourceDetail -> Bool
== :: RecommendationRelatedCloudWatchMetricsSourceDetail
-> RecommendationRelatedCloudWatchMetricsSourceDetail -> Bool
$c== :: RecommendationRelatedCloudWatchMetricsSourceDetail
-> RecommendationRelatedCloudWatchMetricsSourceDetail -> Bool
Prelude.Eq, ReadPrec [RecommendationRelatedCloudWatchMetricsSourceDetail]
ReadPrec RecommendationRelatedCloudWatchMetricsSourceDetail
Int -> ReadS RecommendationRelatedCloudWatchMetricsSourceDetail
ReadS [RecommendationRelatedCloudWatchMetricsSourceDetail]
(Int -> ReadS RecommendationRelatedCloudWatchMetricsSourceDetail)
-> ReadS [RecommendationRelatedCloudWatchMetricsSourceDetail]
-> ReadPrec RecommendationRelatedCloudWatchMetricsSourceDetail
-> ReadPrec [RecommendationRelatedCloudWatchMetricsSourceDetail]
-> Read RecommendationRelatedCloudWatchMetricsSourceDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecommendationRelatedCloudWatchMetricsSourceDetail]
$creadListPrec :: ReadPrec [RecommendationRelatedCloudWatchMetricsSourceDetail]
readPrec :: ReadPrec RecommendationRelatedCloudWatchMetricsSourceDetail
$creadPrec :: ReadPrec RecommendationRelatedCloudWatchMetricsSourceDetail
readList :: ReadS [RecommendationRelatedCloudWatchMetricsSourceDetail]
$creadList :: ReadS [RecommendationRelatedCloudWatchMetricsSourceDetail]
readsPrec :: Int -> ReadS RecommendationRelatedCloudWatchMetricsSourceDetail
$creadsPrec :: Int -> ReadS RecommendationRelatedCloudWatchMetricsSourceDetail
Prelude.Read, Int -> RecommendationRelatedCloudWatchMetricsSourceDetail -> ShowS
[RecommendationRelatedCloudWatchMetricsSourceDetail] -> ShowS
RecommendationRelatedCloudWatchMetricsSourceDetail -> String
(Int
 -> RecommendationRelatedCloudWatchMetricsSourceDetail -> ShowS)
-> (RecommendationRelatedCloudWatchMetricsSourceDetail -> String)
-> ([RecommendationRelatedCloudWatchMetricsSourceDetail] -> ShowS)
-> Show RecommendationRelatedCloudWatchMetricsSourceDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecommendationRelatedCloudWatchMetricsSourceDetail] -> ShowS
$cshowList :: [RecommendationRelatedCloudWatchMetricsSourceDetail] -> ShowS
show :: RecommendationRelatedCloudWatchMetricsSourceDetail -> String
$cshow :: RecommendationRelatedCloudWatchMetricsSourceDetail -> String
showsPrec :: Int -> RecommendationRelatedCloudWatchMetricsSourceDetail -> ShowS
$cshowsPrec :: Int -> RecommendationRelatedCloudWatchMetricsSourceDetail -> ShowS
Prelude.Show, (forall x.
 RecommendationRelatedCloudWatchMetricsSourceDetail
 -> Rep RecommendationRelatedCloudWatchMetricsSourceDetail x)
-> (forall x.
    Rep RecommendationRelatedCloudWatchMetricsSourceDetail x
    -> RecommendationRelatedCloudWatchMetricsSourceDetail)
-> Generic RecommendationRelatedCloudWatchMetricsSourceDetail
forall x.
Rep RecommendationRelatedCloudWatchMetricsSourceDetail x
-> RecommendationRelatedCloudWatchMetricsSourceDetail
forall x.
RecommendationRelatedCloudWatchMetricsSourceDetail
-> Rep RecommendationRelatedCloudWatchMetricsSourceDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RecommendationRelatedCloudWatchMetricsSourceDetail x
-> RecommendationRelatedCloudWatchMetricsSourceDetail
$cfrom :: forall x.
RecommendationRelatedCloudWatchMetricsSourceDetail
-> Rep RecommendationRelatedCloudWatchMetricsSourceDetail x
Prelude.Generic)

-- |
-- Create a value of 'RecommendationRelatedCloudWatchMetricsSourceDetail' 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:
--
-- 'metricName', 'recommendationRelatedCloudWatchMetricsSourceDetail_metricName' - The name of the CloudWatch metric.
--
-- 'namespace', 'recommendationRelatedCloudWatchMetricsSourceDetail_namespace' - The namespace of the CloudWatch metric. A namespace is a container for
-- CloudWatch metrics.
newRecommendationRelatedCloudWatchMetricsSourceDetail ::
  RecommendationRelatedCloudWatchMetricsSourceDetail
newRecommendationRelatedCloudWatchMetricsSourceDetail :: RecommendationRelatedCloudWatchMetricsSourceDetail
newRecommendationRelatedCloudWatchMetricsSourceDetail =
  RecommendationRelatedCloudWatchMetricsSourceDetail' :: Maybe Text
-> Maybe Text -> RecommendationRelatedCloudWatchMetricsSourceDetail
RecommendationRelatedCloudWatchMetricsSourceDetail'
    { $sel:metricName:RecommendationRelatedCloudWatchMetricsSourceDetail' :: Maybe Text
metricName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:namespace:RecommendationRelatedCloudWatchMetricsSourceDetail' :: Maybe Text
namespace =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The namespace of the CloudWatch metric. A namespace is a container for
-- CloudWatch metrics.
recommendationRelatedCloudWatchMetricsSourceDetail_namespace :: Lens.Lens' RecommendationRelatedCloudWatchMetricsSourceDetail (Prelude.Maybe Prelude.Text)
recommendationRelatedCloudWatchMetricsSourceDetail_namespace :: (Maybe Text -> f (Maybe Text))
-> RecommendationRelatedCloudWatchMetricsSourceDetail
-> f RecommendationRelatedCloudWatchMetricsSourceDetail
recommendationRelatedCloudWatchMetricsSourceDetail_namespace = (RecommendationRelatedCloudWatchMetricsSourceDetail -> Maybe Text)
-> (RecommendationRelatedCloudWatchMetricsSourceDetail
    -> Maybe Text
    -> RecommendationRelatedCloudWatchMetricsSourceDetail)
-> Lens
     RecommendationRelatedCloudWatchMetricsSourceDetail
     RecommendationRelatedCloudWatchMetricsSourceDetail
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationRelatedCloudWatchMetricsSourceDetail' {Maybe Text
namespace :: Maybe Text
$sel:namespace:RecommendationRelatedCloudWatchMetricsSourceDetail' :: RecommendationRelatedCloudWatchMetricsSourceDetail -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: RecommendationRelatedCloudWatchMetricsSourceDetail
s@RecommendationRelatedCloudWatchMetricsSourceDetail' {} Maybe Text
a -> RecommendationRelatedCloudWatchMetricsSourceDetail
s {$sel:namespace:RecommendationRelatedCloudWatchMetricsSourceDetail' :: Maybe Text
namespace = Maybe Text
a} :: RecommendationRelatedCloudWatchMetricsSourceDetail)

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

instance
  Prelude.Hashable
    RecommendationRelatedCloudWatchMetricsSourceDetail

instance
  Prelude.NFData
    RecommendationRelatedCloudWatchMetricsSourceDetail