{-# 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.TimeStreamQuery.Types.TimeSeriesDataPoint where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import {-# SOURCE #-} Amazonka.TimeStreamQuery.Types.Datum
data TimeSeriesDataPoint = TimeSeriesDataPoint'
{
TimeSeriesDataPoint -> Text
time :: Prelude.Text,
TimeSeriesDataPoint -> Datum
value :: Datum
}
deriving (TimeSeriesDataPoint -> TimeSeriesDataPoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TimeSeriesDataPoint -> TimeSeriesDataPoint -> Bool
$c/= :: TimeSeriesDataPoint -> TimeSeriesDataPoint -> Bool
== :: TimeSeriesDataPoint -> TimeSeriesDataPoint -> Bool
$c== :: TimeSeriesDataPoint -> TimeSeriesDataPoint -> Bool
Prelude.Eq, ReadPrec [TimeSeriesDataPoint]
ReadPrec TimeSeriesDataPoint
Int -> ReadS TimeSeriesDataPoint
ReadS [TimeSeriesDataPoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TimeSeriesDataPoint]
$creadListPrec :: ReadPrec [TimeSeriesDataPoint]
readPrec :: ReadPrec TimeSeriesDataPoint
$creadPrec :: ReadPrec TimeSeriesDataPoint
readList :: ReadS [TimeSeriesDataPoint]
$creadList :: ReadS [TimeSeriesDataPoint]
readsPrec :: Int -> ReadS TimeSeriesDataPoint
$creadsPrec :: Int -> ReadS TimeSeriesDataPoint
Prelude.Read, Int -> TimeSeriesDataPoint -> ShowS
[TimeSeriesDataPoint] -> ShowS
TimeSeriesDataPoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TimeSeriesDataPoint] -> ShowS
$cshowList :: [TimeSeriesDataPoint] -> ShowS
show :: TimeSeriesDataPoint -> String
$cshow :: TimeSeriesDataPoint -> String
showsPrec :: Int -> TimeSeriesDataPoint -> ShowS
$cshowsPrec :: Int -> TimeSeriesDataPoint -> ShowS
Prelude.Show, forall x. Rep TimeSeriesDataPoint x -> TimeSeriesDataPoint
forall x. TimeSeriesDataPoint -> Rep TimeSeriesDataPoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TimeSeriesDataPoint x -> TimeSeriesDataPoint
$cfrom :: forall x. TimeSeriesDataPoint -> Rep TimeSeriesDataPoint x
Prelude.Generic)
newTimeSeriesDataPoint ::
Prelude.Text ->
Datum ->
TimeSeriesDataPoint
newTimeSeriesDataPoint :: Text -> Datum -> TimeSeriesDataPoint
newTimeSeriesDataPoint Text
pTime_ Datum
pValue_ =
TimeSeriesDataPoint'
{ $sel:time:TimeSeriesDataPoint' :: Text
time = Text
pTime_,
$sel:value:TimeSeriesDataPoint' :: Datum
value = Datum
pValue_
}
timeSeriesDataPoint_time :: Lens.Lens' TimeSeriesDataPoint Prelude.Text
timeSeriesDataPoint_time :: Lens' TimeSeriesDataPoint Text
timeSeriesDataPoint_time = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimeSeriesDataPoint' {Text
time :: Text
$sel:time:TimeSeriesDataPoint' :: TimeSeriesDataPoint -> Text
time} -> Text
time) (\s :: TimeSeriesDataPoint
s@TimeSeriesDataPoint' {} Text
a -> TimeSeriesDataPoint
s {$sel:time:TimeSeriesDataPoint' :: Text
time = Text
a} :: TimeSeriesDataPoint)
timeSeriesDataPoint_value :: Lens.Lens' TimeSeriesDataPoint Datum
timeSeriesDataPoint_value :: Lens' TimeSeriesDataPoint Datum
timeSeriesDataPoint_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimeSeriesDataPoint' {Datum
value :: Datum
$sel:value:TimeSeriesDataPoint' :: TimeSeriesDataPoint -> Datum
value} -> Datum
value) (\s :: TimeSeriesDataPoint
s@TimeSeriesDataPoint' {} Datum
a -> TimeSeriesDataPoint
s {$sel:value:TimeSeriesDataPoint' :: Datum
value = Datum
a} :: TimeSeriesDataPoint)
instance Data.FromJSON TimeSeriesDataPoint where
parseJSON :: Value -> Parser TimeSeriesDataPoint
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TimeSeriesDataPoint"
( \Object
x ->
Text -> Datum -> TimeSeriesDataPoint
TimeSeriesDataPoint'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Time")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Value")
)
instance Prelude.Hashable TimeSeriesDataPoint where
hashWithSalt :: Int -> TimeSeriesDataPoint -> Int
hashWithSalt Int
_salt TimeSeriesDataPoint' {Text
Datum
value :: Datum
time :: Text
$sel:value:TimeSeriesDataPoint' :: TimeSeriesDataPoint -> Datum
$sel:time:TimeSeriesDataPoint' :: TimeSeriesDataPoint -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
time
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Datum
value
instance Prelude.NFData TimeSeriesDataPoint where
rnf :: TimeSeriesDataPoint -> ()
rnf TimeSeriesDataPoint' {Text
Datum
value :: Datum
time :: Text
$sel:value:TimeSeriesDataPoint' :: TimeSeriesDataPoint -> Datum
$sel:time:TimeSeriesDataPoint' :: TimeSeriesDataPoint -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
time seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Datum
value