{-# 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.ServiceQuotas.Types.MetricInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MetricInfo = MetricInfo'
{
MetricInfo -> Maybe (HashMap Text Text)
metricDimensions :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
MetricInfo -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
MetricInfo -> Maybe Text
metricStatisticRecommendation :: Prelude.Maybe Prelude.Text,
MetricInfo -> Maybe Text
metricNamespace :: Prelude.Maybe Prelude.Text
}
deriving (MetricInfo -> MetricInfo -> Bool
(MetricInfo -> MetricInfo -> Bool)
-> (MetricInfo -> MetricInfo -> Bool) -> Eq MetricInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetricInfo -> MetricInfo -> Bool
$c/= :: MetricInfo -> MetricInfo -> Bool
== :: MetricInfo -> MetricInfo -> Bool
$c== :: MetricInfo -> MetricInfo -> Bool
Prelude.Eq, ReadPrec [MetricInfo]
ReadPrec MetricInfo
Int -> ReadS MetricInfo
ReadS [MetricInfo]
(Int -> ReadS MetricInfo)
-> ReadS [MetricInfo]
-> ReadPrec MetricInfo
-> ReadPrec [MetricInfo]
-> Read MetricInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetricInfo]
$creadListPrec :: ReadPrec [MetricInfo]
readPrec :: ReadPrec MetricInfo
$creadPrec :: ReadPrec MetricInfo
readList :: ReadS [MetricInfo]
$creadList :: ReadS [MetricInfo]
readsPrec :: Int -> ReadS MetricInfo
$creadsPrec :: Int -> ReadS MetricInfo
Prelude.Read, Int -> MetricInfo -> ShowS
[MetricInfo] -> ShowS
MetricInfo -> String
(Int -> MetricInfo -> ShowS)
-> (MetricInfo -> String)
-> ([MetricInfo] -> ShowS)
-> Show MetricInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetricInfo] -> ShowS
$cshowList :: [MetricInfo] -> ShowS
show :: MetricInfo -> String
$cshow :: MetricInfo -> String
showsPrec :: Int -> MetricInfo -> ShowS
$cshowsPrec :: Int -> MetricInfo -> ShowS
Prelude.Show, (forall x. MetricInfo -> Rep MetricInfo x)
-> (forall x. Rep MetricInfo x -> MetricInfo) -> Generic MetricInfo
forall x. Rep MetricInfo x -> MetricInfo
forall x. MetricInfo -> Rep MetricInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetricInfo x -> MetricInfo
$cfrom :: forall x. MetricInfo -> Rep MetricInfo x
Prelude.Generic)
newMetricInfo ::
MetricInfo
newMetricInfo :: MetricInfo
newMetricInfo =
MetricInfo' :: Maybe (HashMap Text Text)
-> Maybe Text -> Maybe Text -> Maybe Text -> MetricInfo
MetricInfo'
{ $sel:metricDimensions:MetricInfo' :: Maybe (HashMap Text Text)
metricDimensions = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:metricName:MetricInfo' :: Maybe Text
metricName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:metricStatisticRecommendation:MetricInfo' :: Maybe Text
metricStatisticRecommendation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:metricNamespace:MetricInfo' :: Maybe Text
metricNamespace = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
metricInfo_metricDimensions :: Lens.Lens' MetricInfo (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
metricInfo_metricDimensions :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> MetricInfo -> f MetricInfo
metricInfo_metricDimensions = (MetricInfo -> Maybe (HashMap Text Text))
-> (MetricInfo -> Maybe (HashMap Text Text) -> MetricInfo)
-> Lens
MetricInfo
MetricInfo
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricInfo' {Maybe (HashMap Text Text)
metricDimensions :: Maybe (HashMap Text Text)
$sel:metricDimensions:MetricInfo' :: MetricInfo -> Maybe (HashMap Text Text)
metricDimensions} -> Maybe (HashMap Text Text)
metricDimensions) (\s :: MetricInfo
s@MetricInfo' {} Maybe (HashMap Text Text)
a -> MetricInfo
s {$sel:metricDimensions:MetricInfo' :: Maybe (HashMap Text Text)
metricDimensions = Maybe (HashMap Text Text)
a} :: MetricInfo) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> MetricInfo -> f MetricInfo)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> MetricInfo
-> f MetricInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
metricInfo_metricName :: Lens.Lens' MetricInfo (Prelude.Maybe Prelude.Text)
metricInfo_metricName :: (Maybe Text -> f (Maybe Text)) -> MetricInfo -> f MetricInfo
metricInfo_metricName = (MetricInfo -> Maybe Text)
-> (MetricInfo -> Maybe Text -> MetricInfo)
-> Lens MetricInfo MetricInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricInfo' {Maybe Text
metricName :: Maybe Text
$sel:metricName:MetricInfo' :: MetricInfo -> Maybe Text
metricName} -> Maybe Text
metricName) (\s :: MetricInfo
s@MetricInfo' {} Maybe Text
a -> MetricInfo
s {$sel:metricName:MetricInfo' :: Maybe Text
metricName = Maybe Text
a} :: MetricInfo)
metricInfo_metricStatisticRecommendation :: Lens.Lens' MetricInfo (Prelude.Maybe Prelude.Text)
metricInfo_metricStatisticRecommendation :: (Maybe Text -> f (Maybe Text)) -> MetricInfo -> f MetricInfo
metricInfo_metricStatisticRecommendation = (MetricInfo -> Maybe Text)
-> (MetricInfo -> Maybe Text -> MetricInfo)
-> Lens MetricInfo MetricInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricInfo' {Maybe Text
metricStatisticRecommendation :: Maybe Text
$sel:metricStatisticRecommendation:MetricInfo' :: MetricInfo -> Maybe Text
metricStatisticRecommendation} -> Maybe Text
metricStatisticRecommendation) (\s :: MetricInfo
s@MetricInfo' {} Maybe Text
a -> MetricInfo
s {$sel:metricStatisticRecommendation:MetricInfo' :: Maybe Text
metricStatisticRecommendation = Maybe Text
a} :: MetricInfo)
metricInfo_metricNamespace :: Lens.Lens' MetricInfo (Prelude.Maybe Prelude.Text)
metricInfo_metricNamespace :: (Maybe Text -> f (Maybe Text)) -> MetricInfo -> f MetricInfo
metricInfo_metricNamespace = (MetricInfo -> Maybe Text)
-> (MetricInfo -> Maybe Text -> MetricInfo)
-> Lens MetricInfo MetricInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricInfo' {Maybe Text
metricNamespace :: Maybe Text
$sel:metricNamespace:MetricInfo' :: MetricInfo -> Maybe Text
metricNamespace} -> Maybe Text
metricNamespace) (\s :: MetricInfo
s@MetricInfo' {} Maybe Text
a -> MetricInfo
s {$sel:metricNamespace:MetricInfo' :: Maybe Text
metricNamespace = Maybe Text
a} :: MetricInfo)
instance Core.FromJSON MetricInfo where
parseJSON :: Value -> Parser MetricInfo
parseJSON =
String
-> (Object -> Parser MetricInfo) -> Value -> Parser MetricInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MetricInfo"
( \Object
x ->
Maybe (HashMap Text Text)
-> Maybe Text -> Maybe Text -> Maybe Text -> MetricInfo
MetricInfo'
(Maybe (HashMap Text Text)
-> Maybe Text -> Maybe Text -> Maybe Text -> MetricInfo)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> MetricInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MetricDimensions"
Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Text -> Maybe Text -> Maybe Text -> MetricInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> MetricInfo)
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 Text -> MetricInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> MetricInfo)
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
"MetricStatisticRecommendation")
Parser (Maybe Text -> MetricInfo)
-> Parser (Maybe Text) -> Parser MetricInfo
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
"MetricNamespace")
)
instance Prelude.Hashable MetricInfo
instance Prelude.NFData MetricInfo