{-# 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 #-}
module Amazonka.DevOpsGuru.Types.CloudWatchMetricsDetail where
import qualified Amazonka.Core as Core
import Amazonka.DevOpsGuru.Types.CloudWatchMetricsDimension
import Amazonka.DevOpsGuru.Types.CloudWatchMetricsStat
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CloudWatchMetricsDetail = CloudWatchMetricsDetail'
{
CloudWatchMetricsDetail -> Maybe Int
period :: Prelude.Maybe Prelude.Int,
CloudWatchMetricsDetail -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
CloudWatchMetricsDetail -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
CloudWatchMetricsDetail -> Maybe CloudWatchMetricsStat
stat :: Prelude.Maybe CloudWatchMetricsStat,
CloudWatchMetricsDetail -> Maybe [CloudWatchMetricsDimension]
dimensions :: Prelude.Maybe [CloudWatchMetricsDimension],
CloudWatchMetricsDetail -> Maybe Text
unit :: Prelude.Maybe Prelude.Text
}
deriving (CloudWatchMetricsDetail -> CloudWatchMetricsDetail -> Bool
(CloudWatchMetricsDetail -> CloudWatchMetricsDetail -> Bool)
-> (CloudWatchMetricsDetail -> CloudWatchMetricsDetail -> Bool)
-> Eq CloudWatchMetricsDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudWatchMetricsDetail -> CloudWatchMetricsDetail -> Bool
$c/= :: CloudWatchMetricsDetail -> CloudWatchMetricsDetail -> Bool
== :: CloudWatchMetricsDetail -> CloudWatchMetricsDetail -> Bool
$c== :: CloudWatchMetricsDetail -> CloudWatchMetricsDetail -> Bool
Prelude.Eq, ReadPrec [CloudWatchMetricsDetail]
ReadPrec CloudWatchMetricsDetail
Int -> ReadS CloudWatchMetricsDetail
ReadS [CloudWatchMetricsDetail]
(Int -> ReadS CloudWatchMetricsDetail)
-> ReadS [CloudWatchMetricsDetail]
-> ReadPrec CloudWatchMetricsDetail
-> ReadPrec [CloudWatchMetricsDetail]
-> Read CloudWatchMetricsDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudWatchMetricsDetail]
$creadListPrec :: ReadPrec [CloudWatchMetricsDetail]
readPrec :: ReadPrec CloudWatchMetricsDetail
$creadPrec :: ReadPrec CloudWatchMetricsDetail
readList :: ReadS [CloudWatchMetricsDetail]
$creadList :: ReadS [CloudWatchMetricsDetail]
readsPrec :: Int -> ReadS CloudWatchMetricsDetail
$creadsPrec :: Int -> ReadS CloudWatchMetricsDetail
Prelude.Read, Int -> CloudWatchMetricsDetail -> ShowS
[CloudWatchMetricsDetail] -> ShowS
CloudWatchMetricsDetail -> String
(Int -> CloudWatchMetricsDetail -> ShowS)
-> (CloudWatchMetricsDetail -> String)
-> ([CloudWatchMetricsDetail] -> ShowS)
-> Show CloudWatchMetricsDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudWatchMetricsDetail] -> ShowS
$cshowList :: [CloudWatchMetricsDetail] -> ShowS
show :: CloudWatchMetricsDetail -> String
$cshow :: CloudWatchMetricsDetail -> String
showsPrec :: Int -> CloudWatchMetricsDetail -> ShowS
$cshowsPrec :: Int -> CloudWatchMetricsDetail -> ShowS
Prelude.Show, (forall x.
CloudWatchMetricsDetail -> Rep CloudWatchMetricsDetail x)
-> (forall x.
Rep CloudWatchMetricsDetail x -> CloudWatchMetricsDetail)
-> Generic CloudWatchMetricsDetail
forall x. Rep CloudWatchMetricsDetail x -> CloudWatchMetricsDetail
forall x. CloudWatchMetricsDetail -> Rep CloudWatchMetricsDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CloudWatchMetricsDetail x -> CloudWatchMetricsDetail
$cfrom :: forall x. CloudWatchMetricsDetail -> Rep CloudWatchMetricsDetail x
Prelude.Generic)
newCloudWatchMetricsDetail ::
CloudWatchMetricsDetail
newCloudWatchMetricsDetail :: CloudWatchMetricsDetail
newCloudWatchMetricsDetail =
CloudWatchMetricsDetail' :: Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe CloudWatchMetricsStat
-> Maybe [CloudWatchMetricsDimension]
-> Maybe Text
-> CloudWatchMetricsDetail
CloudWatchMetricsDetail'
{ $sel:period:CloudWatchMetricsDetail' :: Maybe Int
period = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:metricName:CloudWatchMetricsDetail' :: Maybe Text
metricName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:namespace:CloudWatchMetricsDetail' :: Maybe Text
namespace = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stat:CloudWatchMetricsDetail' :: Maybe CloudWatchMetricsStat
stat = Maybe CloudWatchMetricsStat
forall a. Maybe a
Prelude.Nothing,
$sel:dimensions:CloudWatchMetricsDetail' :: Maybe [CloudWatchMetricsDimension]
dimensions = Maybe [CloudWatchMetricsDimension]
forall a. Maybe a
Prelude.Nothing,
$sel:unit:CloudWatchMetricsDetail' :: Maybe Text
unit = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
cloudWatchMetricsDetail_period :: Lens.Lens' CloudWatchMetricsDetail (Prelude.Maybe Prelude.Int)
cloudWatchMetricsDetail_period :: (Maybe Int -> f (Maybe Int))
-> CloudWatchMetricsDetail -> f CloudWatchMetricsDetail
cloudWatchMetricsDetail_period = (CloudWatchMetricsDetail -> Maybe Int)
-> (CloudWatchMetricsDetail
-> Maybe Int -> CloudWatchMetricsDetail)
-> Lens
CloudWatchMetricsDetail
CloudWatchMetricsDetail
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchMetricsDetail' {Maybe Int
period :: Maybe Int
$sel:period:CloudWatchMetricsDetail' :: CloudWatchMetricsDetail -> Maybe Int
period} -> Maybe Int
period) (\s :: CloudWatchMetricsDetail
s@CloudWatchMetricsDetail' {} Maybe Int
a -> CloudWatchMetricsDetail
s {$sel:period:CloudWatchMetricsDetail' :: Maybe Int
period = Maybe Int
a} :: CloudWatchMetricsDetail)
cloudWatchMetricsDetail_metricName :: Lens.Lens' CloudWatchMetricsDetail (Prelude.Maybe Prelude.Text)
cloudWatchMetricsDetail_metricName :: (Maybe Text -> f (Maybe Text))
-> CloudWatchMetricsDetail -> f CloudWatchMetricsDetail
cloudWatchMetricsDetail_metricName = (CloudWatchMetricsDetail -> Maybe Text)
-> (CloudWatchMetricsDetail
-> Maybe Text -> CloudWatchMetricsDetail)
-> Lens
CloudWatchMetricsDetail
CloudWatchMetricsDetail
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchMetricsDetail' {Maybe Text
metricName :: Maybe Text
$sel:metricName:CloudWatchMetricsDetail' :: CloudWatchMetricsDetail -> Maybe Text
metricName} -> Maybe Text
metricName) (\s :: CloudWatchMetricsDetail
s@CloudWatchMetricsDetail' {} Maybe Text
a -> CloudWatchMetricsDetail
s {$sel:metricName:CloudWatchMetricsDetail' :: Maybe Text
metricName = Maybe Text
a} :: CloudWatchMetricsDetail)
cloudWatchMetricsDetail_namespace :: Lens.Lens' CloudWatchMetricsDetail (Prelude.Maybe Prelude.Text)
cloudWatchMetricsDetail_namespace :: (Maybe Text -> f (Maybe Text))
-> CloudWatchMetricsDetail -> f CloudWatchMetricsDetail
cloudWatchMetricsDetail_namespace = (CloudWatchMetricsDetail -> Maybe Text)
-> (CloudWatchMetricsDetail
-> Maybe Text -> CloudWatchMetricsDetail)
-> Lens
CloudWatchMetricsDetail
CloudWatchMetricsDetail
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchMetricsDetail' {Maybe Text
namespace :: Maybe Text
$sel:namespace:CloudWatchMetricsDetail' :: CloudWatchMetricsDetail -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: CloudWatchMetricsDetail
s@CloudWatchMetricsDetail' {} Maybe Text
a -> CloudWatchMetricsDetail
s {$sel:namespace:CloudWatchMetricsDetail' :: Maybe Text
namespace = Maybe Text
a} :: CloudWatchMetricsDetail)
cloudWatchMetricsDetail_stat :: Lens.Lens' CloudWatchMetricsDetail (Prelude.Maybe CloudWatchMetricsStat)
cloudWatchMetricsDetail_stat :: (Maybe CloudWatchMetricsStat -> f (Maybe CloudWatchMetricsStat))
-> CloudWatchMetricsDetail -> f CloudWatchMetricsDetail
cloudWatchMetricsDetail_stat = (CloudWatchMetricsDetail -> Maybe CloudWatchMetricsStat)
-> (CloudWatchMetricsDetail
-> Maybe CloudWatchMetricsStat -> CloudWatchMetricsDetail)
-> Lens
CloudWatchMetricsDetail
CloudWatchMetricsDetail
(Maybe CloudWatchMetricsStat)
(Maybe CloudWatchMetricsStat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchMetricsDetail' {Maybe CloudWatchMetricsStat
stat :: Maybe CloudWatchMetricsStat
$sel:stat:CloudWatchMetricsDetail' :: CloudWatchMetricsDetail -> Maybe CloudWatchMetricsStat
stat} -> Maybe CloudWatchMetricsStat
stat) (\s :: CloudWatchMetricsDetail
s@CloudWatchMetricsDetail' {} Maybe CloudWatchMetricsStat
a -> CloudWatchMetricsDetail
s {$sel:stat:CloudWatchMetricsDetail' :: Maybe CloudWatchMetricsStat
stat = Maybe CloudWatchMetricsStat
a} :: CloudWatchMetricsDetail)
cloudWatchMetricsDetail_dimensions :: Lens.Lens' CloudWatchMetricsDetail (Prelude.Maybe [CloudWatchMetricsDimension])
cloudWatchMetricsDetail_dimensions :: (Maybe [CloudWatchMetricsDimension]
-> f (Maybe [CloudWatchMetricsDimension]))
-> CloudWatchMetricsDetail -> f CloudWatchMetricsDetail
cloudWatchMetricsDetail_dimensions = (CloudWatchMetricsDetail -> Maybe [CloudWatchMetricsDimension])
-> (CloudWatchMetricsDetail
-> Maybe [CloudWatchMetricsDimension] -> CloudWatchMetricsDetail)
-> Lens
CloudWatchMetricsDetail
CloudWatchMetricsDetail
(Maybe [CloudWatchMetricsDimension])
(Maybe [CloudWatchMetricsDimension])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchMetricsDetail' {Maybe [CloudWatchMetricsDimension]
dimensions :: Maybe [CloudWatchMetricsDimension]
$sel:dimensions:CloudWatchMetricsDetail' :: CloudWatchMetricsDetail -> Maybe [CloudWatchMetricsDimension]
dimensions} -> Maybe [CloudWatchMetricsDimension]
dimensions) (\s :: CloudWatchMetricsDetail
s@CloudWatchMetricsDetail' {} Maybe [CloudWatchMetricsDimension]
a -> CloudWatchMetricsDetail
s {$sel:dimensions:CloudWatchMetricsDetail' :: Maybe [CloudWatchMetricsDimension]
dimensions = Maybe [CloudWatchMetricsDimension]
a} :: CloudWatchMetricsDetail) ((Maybe [CloudWatchMetricsDimension]
-> f (Maybe [CloudWatchMetricsDimension]))
-> CloudWatchMetricsDetail -> f CloudWatchMetricsDetail)
-> ((Maybe [CloudWatchMetricsDimension]
-> f (Maybe [CloudWatchMetricsDimension]))
-> Maybe [CloudWatchMetricsDimension]
-> f (Maybe [CloudWatchMetricsDimension]))
-> (Maybe [CloudWatchMetricsDimension]
-> f (Maybe [CloudWatchMetricsDimension]))
-> CloudWatchMetricsDetail
-> f CloudWatchMetricsDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[CloudWatchMetricsDimension]
[CloudWatchMetricsDimension]
[CloudWatchMetricsDimension]
[CloudWatchMetricsDimension]
-> Iso
(Maybe [CloudWatchMetricsDimension])
(Maybe [CloudWatchMetricsDimension])
(Maybe [CloudWatchMetricsDimension])
(Maybe [CloudWatchMetricsDimension])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[CloudWatchMetricsDimension]
[CloudWatchMetricsDimension]
[CloudWatchMetricsDimension]
[CloudWatchMetricsDimension]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
cloudWatchMetricsDetail_unit :: Lens.Lens' CloudWatchMetricsDetail (Prelude.Maybe Prelude.Text)
cloudWatchMetricsDetail_unit :: (Maybe Text -> f (Maybe Text))
-> CloudWatchMetricsDetail -> f CloudWatchMetricsDetail
cloudWatchMetricsDetail_unit = (CloudWatchMetricsDetail -> Maybe Text)
-> (CloudWatchMetricsDetail
-> Maybe Text -> CloudWatchMetricsDetail)
-> Lens
CloudWatchMetricsDetail
CloudWatchMetricsDetail
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchMetricsDetail' {Maybe Text
unit :: Maybe Text
$sel:unit:CloudWatchMetricsDetail' :: CloudWatchMetricsDetail -> Maybe Text
unit} -> Maybe Text
unit) (\s :: CloudWatchMetricsDetail
s@CloudWatchMetricsDetail' {} Maybe Text
a -> CloudWatchMetricsDetail
s {$sel:unit:CloudWatchMetricsDetail' :: Maybe Text
unit = Maybe Text
a} :: CloudWatchMetricsDetail)
instance Core.FromJSON CloudWatchMetricsDetail where
parseJSON :: Value -> Parser CloudWatchMetricsDetail
parseJSON =
String
-> (Object -> Parser CloudWatchMetricsDetail)
-> Value
-> Parser CloudWatchMetricsDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CloudWatchMetricsDetail"
( \Object
x ->
Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe CloudWatchMetricsStat
-> Maybe [CloudWatchMetricsDimension]
-> Maybe Text
-> CloudWatchMetricsDetail
CloudWatchMetricsDetail'
(Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe CloudWatchMetricsStat
-> Maybe [CloudWatchMetricsDimension]
-> Maybe Text
-> CloudWatchMetricsDetail)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe CloudWatchMetricsStat
-> Maybe [CloudWatchMetricsDimension]
-> Maybe Text
-> CloudWatchMetricsDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Period")
Parser
(Maybe Text
-> Maybe Text
-> Maybe CloudWatchMetricsStat
-> Maybe [CloudWatchMetricsDimension]
-> Maybe Text
-> CloudWatchMetricsDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe CloudWatchMetricsStat
-> Maybe [CloudWatchMetricsDimension]
-> Maybe Text
-> CloudWatchMetricsDetail)
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
"MetricName")
Parser
(Maybe Text
-> Maybe CloudWatchMetricsStat
-> Maybe [CloudWatchMetricsDimension]
-> Maybe Text
-> CloudWatchMetricsDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe CloudWatchMetricsStat
-> Maybe [CloudWatchMetricsDimension]
-> Maybe Text
-> CloudWatchMetricsDetail)
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")
Parser
(Maybe CloudWatchMetricsStat
-> Maybe [CloudWatchMetricsDimension]
-> Maybe Text
-> CloudWatchMetricsDetail)
-> Parser (Maybe CloudWatchMetricsStat)
-> Parser
(Maybe [CloudWatchMetricsDimension]
-> Maybe Text -> CloudWatchMetricsDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CloudWatchMetricsStat)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Stat")
Parser
(Maybe [CloudWatchMetricsDimension]
-> Maybe Text -> CloudWatchMetricsDetail)
-> Parser (Maybe [CloudWatchMetricsDimension])
-> Parser (Maybe Text -> CloudWatchMetricsDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe [CloudWatchMetricsDimension]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Dimensions" Parser (Maybe (Maybe [CloudWatchMetricsDimension]))
-> Maybe [CloudWatchMetricsDimension]
-> Parser (Maybe [CloudWatchMetricsDimension])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [CloudWatchMetricsDimension]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> CloudWatchMetricsDetail)
-> Parser (Maybe Text) -> Parser CloudWatchMetricsDetail
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
"Unit")
)
instance Prelude.Hashable CloudWatchMetricsDetail
instance Prelude.NFData CloudWatchMetricsDetail