{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DevOpsGuru.Types.RecommendationRelatedCloudWatchMetricsSourceDetail 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

-- | 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
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]
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
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.
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'
    { $sel:metricName:RecommendationRelatedCloudWatchMetricsSourceDetail' :: Maybe Text
metricName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:namespace:RecommendationRelatedCloudWatchMetricsSourceDetail' :: Maybe Text
namespace =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the CloudWatch metric.
recommendationRelatedCloudWatchMetricsSourceDetail_metricName :: Lens.Lens' RecommendationRelatedCloudWatchMetricsSourceDetail (Prelude.Maybe Prelude.Text)
recommendationRelatedCloudWatchMetricsSourceDetail_metricName :: Lens'
  RecommendationRelatedCloudWatchMetricsSourceDetail (Maybe Text)
recommendationRelatedCloudWatchMetricsSourceDetail_metricName = 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 :: Lens'
  RecommendationRelatedCloudWatchMetricsSourceDetail (Maybe Text)
recommendationRelatedCloudWatchMetricsSourceDetail_namespace = 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
  Data.FromJSON
    RecommendationRelatedCloudWatchMetricsSourceDetail
  where
  parseJSON :: Value -> Parser RecommendationRelatedCloudWatchMetricsSourceDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RecommendationRelatedCloudWatchMetricsSourceDetail"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> RecommendationRelatedCloudWatchMetricsSourceDetail
RecommendationRelatedCloudWatchMetricsSourceDetail'
            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
"MetricName")
            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
"Namespace")
      )

instance
  Prelude.Hashable
    RecommendationRelatedCloudWatchMetricsSourceDetail
  where
  hashWithSalt :: Int -> RecommendationRelatedCloudWatchMetricsSourceDetail -> Int
hashWithSalt
    Int
_salt
    RecommendationRelatedCloudWatchMetricsSourceDetail' {Maybe Text
namespace :: Maybe Text
metricName :: Maybe Text
$sel:namespace:RecommendationRelatedCloudWatchMetricsSourceDetail' :: RecommendationRelatedCloudWatchMetricsSourceDetail -> Maybe Text
$sel:metricName:RecommendationRelatedCloudWatchMetricsSourceDetail' :: RecommendationRelatedCloudWatchMetricsSourceDetail -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
metricName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
namespace

instance
  Prelude.NFData
    RecommendationRelatedCloudWatchMetricsSourceDetail
  where
  rnf :: RecommendationRelatedCloudWatchMetricsSourceDetail -> ()
rnf
    RecommendationRelatedCloudWatchMetricsSourceDetail' {Maybe Text
namespace :: Maybe Text
metricName :: Maybe Text
$sel:namespace:RecommendationRelatedCloudWatchMetricsSourceDetail' :: RecommendationRelatedCloudWatchMetricsSourceDetail -> Maybe Text
$sel:metricName:RecommendationRelatedCloudWatchMetricsSourceDetail' :: RecommendationRelatedCloudWatchMetricsSourceDetail -> Maybe Text
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricName
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
namespace