{-# 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.LookoutMetrics.Types.MetricLevelImpact where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LookoutMetrics.Types.ContributionMatrix
import qualified Amazonka.Prelude as Prelude
data MetricLevelImpact = MetricLevelImpact'
{
MetricLevelImpact -> Maybe ContributionMatrix
contributionMatrix :: Prelude.Maybe ContributionMatrix,
MetricLevelImpact -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
MetricLevelImpact -> Maybe Int
numTimeSeries :: Prelude.Maybe Prelude.Int
}
deriving (MetricLevelImpact -> MetricLevelImpact -> Bool
(MetricLevelImpact -> MetricLevelImpact -> Bool)
-> (MetricLevelImpact -> MetricLevelImpact -> Bool)
-> Eq MetricLevelImpact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetricLevelImpact -> MetricLevelImpact -> Bool
$c/= :: MetricLevelImpact -> MetricLevelImpact -> Bool
== :: MetricLevelImpact -> MetricLevelImpact -> Bool
$c== :: MetricLevelImpact -> MetricLevelImpact -> Bool
Prelude.Eq, ReadPrec [MetricLevelImpact]
ReadPrec MetricLevelImpact
Int -> ReadS MetricLevelImpact
ReadS [MetricLevelImpact]
(Int -> ReadS MetricLevelImpact)
-> ReadS [MetricLevelImpact]
-> ReadPrec MetricLevelImpact
-> ReadPrec [MetricLevelImpact]
-> Read MetricLevelImpact
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetricLevelImpact]
$creadListPrec :: ReadPrec [MetricLevelImpact]
readPrec :: ReadPrec MetricLevelImpact
$creadPrec :: ReadPrec MetricLevelImpact
readList :: ReadS [MetricLevelImpact]
$creadList :: ReadS [MetricLevelImpact]
readsPrec :: Int -> ReadS MetricLevelImpact
$creadsPrec :: Int -> ReadS MetricLevelImpact
Prelude.Read, Int -> MetricLevelImpact -> ShowS
[MetricLevelImpact] -> ShowS
MetricLevelImpact -> String
(Int -> MetricLevelImpact -> ShowS)
-> (MetricLevelImpact -> String)
-> ([MetricLevelImpact] -> ShowS)
-> Show MetricLevelImpact
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetricLevelImpact] -> ShowS
$cshowList :: [MetricLevelImpact] -> ShowS
show :: MetricLevelImpact -> String
$cshow :: MetricLevelImpact -> String
showsPrec :: Int -> MetricLevelImpact -> ShowS
$cshowsPrec :: Int -> MetricLevelImpact -> ShowS
Prelude.Show, (forall x. MetricLevelImpact -> Rep MetricLevelImpact x)
-> (forall x. Rep MetricLevelImpact x -> MetricLevelImpact)
-> Generic MetricLevelImpact
forall x. Rep MetricLevelImpact x -> MetricLevelImpact
forall x. MetricLevelImpact -> Rep MetricLevelImpact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetricLevelImpact x -> MetricLevelImpact
$cfrom :: forall x. MetricLevelImpact -> Rep MetricLevelImpact x
Prelude.Generic)
newMetricLevelImpact ::
MetricLevelImpact
newMetricLevelImpact :: MetricLevelImpact
newMetricLevelImpact =
MetricLevelImpact' :: Maybe ContributionMatrix
-> Maybe Text -> Maybe Int -> MetricLevelImpact
MetricLevelImpact'
{ $sel:contributionMatrix:MetricLevelImpact' :: Maybe ContributionMatrix
contributionMatrix =
Maybe ContributionMatrix
forall a. Maybe a
Prelude.Nothing,
$sel:metricName:MetricLevelImpact' :: Maybe Text
metricName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:numTimeSeries:MetricLevelImpact' :: Maybe Int
numTimeSeries = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
metricLevelImpact_contributionMatrix :: Lens.Lens' MetricLevelImpact (Prelude.Maybe ContributionMatrix)
metricLevelImpact_contributionMatrix :: (Maybe ContributionMatrix -> f (Maybe ContributionMatrix))
-> MetricLevelImpact -> f MetricLevelImpact
metricLevelImpact_contributionMatrix = (MetricLevelImpact -> Maybe ContributionMatrix)
-> (MetricLevelImpact
-> Maybe ContributionMatrix -> MetricLevelImpact)
-> Lens
MetricLevelImpact
MetricLevelImpact
(Maybe ContributionMatrix)
(Maybe ContributionMatrix)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricLevelImpact' {Maybe ContributionMatrix
contributionMatrix :: Maybe ContributionMatrix
$sel:contributionMatrix:MetricLevelImpact' :: MetricLevelImpact -> Maybe ContributionMatrix
contributionMatrix} -> Maybe ContributionMatrix
contributionMatrix) (\s :: MetricLevelImpact
s@MetricLevelImpact' {} Maybe ContributionMatrix
a -> MetricLevelImpact
s {$sel:contributionMatrix:MetricLevelImpact' :: Maybe ContributionMatrix
contributionMatrix = Maybe ContributionMatrix
a} :: MetricLevelImpact)
metricLevelImpact_metricName :: Lens.Lens' MetricLevelImpact (Prelude.Maybe Prelude.Text)
metricLevelImpact_metricName :: (Maybe Text -> f (Maybe Text))
-> MetricLevelImpact -> f MetricLevelImpact
metricLevelImpact_metricName = (MetricLevelImpact -> Maybe Text)
-> (MetricLevelImpact -> Maybe Text -> MetricLevelImpact)
-> Lens
MetricLevelImpact MetricLevelImpact (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricLevelImpact' {Maybe Text
metricName :: Maybe Text
$sel:metricName:MetricLevelImpact' :: MetricLevelImpact -> Maybe Text
metricName} -> Maybe Text
metricName) (\s :: MetricLevelImpact
s@MetricLevelImpact' {} Maybe Text
a -> MetricLevelImpact
s {$sel:metricName:MetricLevelImpact' :: Maybe Text
metricName = Maybe Text
a} :: MetricLevelImpact)
metricLevelImpact_numTimeSeries :: Lens.Lens' MetricLevelImpact (Prelude.Maybe Prelude.Int)
metricLevelImpact_numTimeSeries :: (Maybe Int -> f (Maybe Int))
-> MetricLevelImpact -> f MetricLevelImpact
metricLevelImpact_numTimeSeries = (MetricLevelImpact -> Maybe Int)
-> (MetricLevelImpact -> Maybe Int -> MetricLevelImpact)
-> Lens MetricLevelImpact MetricLevelImpact (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricLevelImpact' {Maybe Int
numTimeSeries :: Maybe Int
$sel:numTimeSeries:MetricLevelImpact' :: MetricLevelImpact -> Maybe Int
numTimeSeries} -> Maybe Int
numTimeSeries) (\s :: MetricLevelImpact
s@MetricLevelImpact' {} Maybe Int
a -> MetricLevelImpact
s {$sel:numTimeSeries:MetricLevelImpact' :: Maybe Int
numTimeSeries = Maybe Int
a} :: MetricLevelImpact)
instance Core.FromJSON MetricLevelImpact where
parseJSON :: Value -> Parser MetricLevelImpact
parseJSON =
String
-> (Object -> Parser MetricLevelImpact)
-> Value
-> Parser MetricLevelImpact
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MetricLevelImpact"
( \Object
x ->
Maybe ContributionMatrix
-> Maybe Text -> Maybe Int -> MetricLevelImpact
MetricLevelImpact'
(Maybe ContributionMatrix
-> Maybe Text -> Maybe Int -> MetricLevelImpact)
-> Parser (Maybe ContributionMatrix)
-> Parser (Maybe Text -> Maybe Int -> MetricLevelImpact)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ContributionMatrix)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContributionMatrix")
Parser (Maybe Text -> Maybe Int -> MetricLevelImpact)
-> Parser (Maybe Text) -> Parser (Maybe Int -> MetricLevelImpact)
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 Int -> MetricLevelImpact)
-> Parser (Maybe Int) -> Parser MetricLevelImpact
forall (f :: * -> *) a b. Applicative f => 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
"NumTimeSeries")
)
instance Prelude.Hashable MetricLevelImpact
instance Prelude.NFData MetricLevelImpact