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