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