{-# 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.IoTSiteWise.Types.InterpolatedAssetPropertyValue where
import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.Types.TimeInNanos
import Amazonka.IoTSiteWise.Types.Variant
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InterpolatedAssetPropertyValue = InterpolatedAssetPropertyValue'
{ InterpolatedAssetPropertyValue -> TimeInNanos
timestamp :: TimeInNanos,
InterpolatedAssetPropertyValue -> Variant
value :: Variant
}
deriving (InterpolatedAssetPropertyValue
-> InterpolatedAssetPropertyValue -> Bool
(InterpolatedAssetPropertyValue
-> InterpolatedAssetPropertyValue -> Bool)
-> (InterpolatedAssetPropertyValue
-> InterpolatedAssetPropertyValue -> Bool)
-> Eq InterpolatedAssetPropertyValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InterpolatedAssetPropertyValue
-> InterpolatedAssetPropertyValue -> Bool
$c/= :: InterpolatedAssetPropertyValue
-> InterpolatedAssetPropertyValue -> Bool
== :: InterpolatedAssetPropertyValue
-> InterpolatedAssetPropertyValue -> Bool
$c== :: InterpolatedAssetPropertyValue
-> InterpolatedAssetPropertyValue -> Bool
Prelude.Eq, ReadPrec [InterpolatedAssetPropertyValue]
ReadPrec InterpolatedAssetPropertyValue
Int -> ReadS InterpolatedAssetPropertyValue
ReadS [InterpolatedAssetPropertyValue]
(Int -> ReadS InterpolatedAssetPropertyValue)
-> ReadS [InterpolatedAssetPropertyValue]
-> ReadPrec InterpolatedAssetPropertyValue
-> ReadPrec [InterpolatedAssetPropertyValue]
-> Read InterpolatedAssetPropertyValue
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InterpolatedAssetPropertyValue]
$creadListPrec :: ReadPrec [InterpolatedAssetPropertyValue]
readPrec :: ReadPrec InterpolatedAssetPropertyValue
$creadPrec :: ReadPrec InterpolatedAssetPropertyValue
readList :: ReadS [InterpolatedAssetPropertyValue]
$creadList :: ReadS [InterpolatedAssetPropertyValue]
readsPrec :: Int -> ReadS InterpolatedAssetPropertyValue
$creadsPrec :: Int -> ReadS InterpolatedAssetPropertyValue
Prelude.Read, Int -> InterpolatedAssetPropertyValue -> ShowS
[InterpolatedAssetPropertyValue] -> ShowS
InterpolatedAssetPropertyValue -> String
(Int -> InterpolatedAssetPropertyValue -> ShowS)
-> (InterpolatedAssetPropertyValue -> String)
-> ([InterpolatedAssetPropertyValue] -> ShowS)
-> Show InterpolatedAssetPropertyValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InterpolatedAssetPropertyValue] -> ShowS
$cshowList :: [InterpolatedAssetPropertyValue] -> ShowS
show :: InterpolatedAssetPropertyValue -> String
$cshow :: InterpolatedAssetPropertyValue -> String
showsPrec :: Int -> InterpolatedAssetPropertyValue -> ShowS
$cshowsPrec :: Int -> InterpolatedAssetPropertyValue -> ShowS
Prelude.Show, (forall x.
InterpolatedAssetPropertyValue
-> Rep InterpolatedAssetPropertyValue x)
-> (forall x.
Rep InterpolatedAssetPropertyValue x
-> InterpolatedAssetPropertyValue)
-> Generic InterpolatedAssetPropertyValue
forall x.
Rep InterpolatedAssetPropertyValue x
-> InterpolatedAssetPropertyValue
forall x.
InterpolatedAssetPropertyValue
-> Rep InterpolatedAssetPropertyValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InterpolatedAssetPropertyValue x
-> InterpolatedAssetPropertyValue
$cfrom :: forall x.
InterpolatedAssetPropertyValue
-> Rep InterpolatedAssetPropertyValue x
Prelude.Generic)
newInterpolatedAssetPropertyValue ::
TimeInNanos ->
Variant ->
InterpolatedAssetPropertyValue
newInterpolatedAssetPropertyValue :: TimeInNanos -> Variant -> InterpolatedAssetPropertyValue
newInterpolatedAssetPropertyValue TimeInNanos
pTimestamp_ Variant
pValue_ =
InterpolatedAssetPropertyValue' :: TimeInNanos -> Variant -> InterpolatedAssetPropertyValue
InterpolatedAssetPropertyValue'
{ $sel:timestamp:InterpolatedAssetPropertyValue' :: TimeInNanos
timestamp =
TimeInNanos
pTimestamp_,
$sel:value:InterpolatedAssetPropertyValue' :: Variant
value = Variant
pValue_
}
interpolatedAssetPropertyValue_timestamp :: Lens.Lens' InterpolatedAssetPropertyValue TimeInNanos
interpolatedAssetPropertyValue_timestamp :: (TimeInNanos -> f TimeInNanos)
-> InterpolatedAssetPropertyValue
-> f InterpolatedAssetPropertyValue
interpolatedAssetPropertyValue_timestamp = (InterpolatedAssetPropertyValue -> TimeInNanos)
-> (InterpolatedAssetPropertyValue
-> TimeInNanos -> InterpolatedAssetPropertyValue)
-> Lens
InterpolatedAssetPropertyValue
InterpolatedAssetPropertyValue
TimeInNanos
TimeInNanos
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InterpolatedAssetPropertyValue' {TimeInNanos
timestamp :: TimeInNanos
$sel:timestamp:InterpolatedAssetPropertyValue' :: InterpolatedAssetPropertyValue -> TimeInNanos
timestamp} -> TimeInNanos
timestamp) (\s :: InterpolatedAssetPropertyValue
s@InterpolatedAssetPropertyValue' {} TimeInNanos
a -> InterpolatedAssetPropertyValue
s {$sel:timestamp:InterpolatedAssetPropertyValue' :: TimeInNanos
timestamp = TimeInNanos
a} :: InterpolatedAssetPropertyValue)
interpolatedAssetPropertyValue_value :: Lens.Lens' InterpolatedAssetPropertyValue Variant
interpolatedAssetPropertyValue_value :: (Variant -> f Variant)
-> InterpolatedAssetPropertyValue
-> f InterpolatedAssetPropertyValue
interpolatedAssetPropertyValue_value = (InterpolatedAssetPropertyValue -> Variant)
-> (InterpolatedAssetPropertyValue
-> Variant -> InterpolatedAssetPropertyValue)
-> Lens
InterpolatedAssetPropertyValue
InterpolatedAssetPropertyValue
Variant
Variant
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InterpolatedAssetPropertyValue' {Variant
value :: Variant
$sel:value:InterpolatedAssetPropertyValue' :: InterpolatedAssetPropertyValue -> Variant
value} -> Variant
value) (\s :: InterpolatedAssetPropertyValue
s@InterpolatedAssetPropertyValue' {} Variant
a -> InterpolatedAssetPropertyValue
s {$sel:value:InterpolatedAssetPropertyValue' :: Variant
value = Variant
a} :: InterpolatedAssetPropertyValue)
instance Core.FromJSON InterpolatedAssetPropertyValue where
parseJSON :: Value -> Parser InterpolatedAssetPropertyValue
parseJSON =
String
-> (Object -> Parser InterpolatedAssetPropertyValue)
-> Value
-> Parser InterpolatedAssetPropertyValue
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InterpolatedAssetPropertyValue"
( \Object
x ->
TimeInNanos -> Variant -> InterpolatedAssetPropertyValue
InterpolatedAssetPropertyValue'
(TimeInNanos -> Variant -> InterpolatedAssetPropertyValue)
-> Parser TimeInNanos
-> Parser (Variant -> InterpolatedAssetPropertyValue)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser TimeInNanos
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"timestamp")
Parser (Variant -> InterpolatedAssetPropertyValue)
-> Parser Variant -> Parser InterpolatedAssetPropertyValue
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Variant
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"value")
)
instance
Prelude.Hashable
InterpolatedAssetPropertyValue
instance
Prelude.NFData
InterpolatedAssetPropertyValue