{-# 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.IoT.Types.TimestreamTimestamp 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
data TimestreamTimestamp = TimestreamTimestamp'
{
TimestreamTimestamp -> Text
value :: Prelude.Text,
TimestreamTimestamp -> Text
unit :: Prelude.Text
}
deriving (TimestreamTimestamp -> TimestreamTimestamp -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TimestreamTimestamp -> TimestreamTimestamp -> Bool
$c/= :: TimestreamTimestamp -> TimestreamTimestamp -> Bool
== :: TimestreamTimestamp -> TimestreamTimestamp -> Bool
$c== :: TimestreamTimestamp -> TimestreamTimestamp -> Bool
Prelude.Eq, ReadPrec [TimestreamTimestamp]
ReadPrec TimestreamTimestamp
Int -> ReadS TimestreamTimestamp
ReadS [TimestreamTimestamp]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TimestreamTimestamp]
$creadListPrec :: ReadPrec [TimestreamTimestamp]
readPrec :: ReadPrec TimestreamTimestamp
$creadPrec :: ReadPrec TimestreamTimestamp
readList :: ReadS [TimestreamTimestamp]
$creadList :: ReadS [TimestreamTimestamp]
readsPrec :: Int -> ReadS TimestreamTimestamp
$creadsPrec :: Int -> ReadS TimestreamTimestamp
Prelude.Read, Int -> TimestreamTimestamp -> ShowS
[TimestreamTimestamp] -> ShowS
TimestreamTimestamp -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TimestreamTimestamp] -> ShowS
$cshowList :: [TimestreamTimestamp] -> ShowS
show :: TimestreamTimestamp -> String
$cshow :: TimestreamTimestamp -> String
showsPrec :: Int -> TimestreamTimestamp -> ShowS
$cshowsPrec :: Int -> TimestreamTimestamp -> ShowS
Prelude.Show, forall x. Rep TimestreamTimestamp x -> TimestreamTimestamp
forall x. TimestreamTimestamp -> Rep TimestreamTimestamp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TimestreamTimestamp x -> TimestreamTimestamp
$cfrom :: forall x. TimestreamTimestamp -> Rep TimestreamTimestamp x
Prelude.Generic)
newTimestreamTimestamp ::
Prelude.Text ->
Prelude.Text ->
TimestreamTimestamp
newTimestreamTimestamp :: Text -> Text -> TimestreamTimestamp
newTimestreamTimestamp Text
pValue_ Text
pUnit_ =
TimestreamTimestamp'
{ $sel:value:TimestreamTimestamp' :: Text
value = Text
pValue_,
$sel:unit:TimestreamTimestamp' :: Text
unit = Text
pUnit_
}
timestreamTimestamp_value :: Lens.Lens' TimestreamTimestamp Prelude.Text
timestreamTimestamp_value :: Lens' TimestreamTimestamp Text
timestreamTimestamp_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimestreamTimestamp' {Text
value :: Text
$sel:value:TimestreamTimestamp' :: TimestreamTimestamp -> Text
value} -> Text
value) (\s :: TimestreamTimestamp
s@TimestreamTimestamp' {} Text
a -> TimestreamTimestamp
s {$sel:value:TimestreamTimestamp' :: Text
value = Text
a} :: TimestreamTimestamp)
timestreamTimestamp_unit :: Lens.Lens' TimestreamTimestamp Prelude.Text
timestreamTimestamp_unit :: Lens' TimestreamTimestamp Text
timestreamTimestamp_unit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimestreamTimestamp' {Text
unit :: Text
$sel:unit:TimestreamTimestamp' :: TimestreamTimestamp -> Text
unit} -> Text
unit) (\s :: TimestreamTimestamp
s@TimestreamTimestamp' {} Text
a -> TimestreamTimestamp
s {$sel:unit:TimestreamTimestamp' :: Text
unit = Text
a} :: TimestreamTimestamp)
instance Data.FromJSON TimestreamTimestamp where
parseJSON :: Value -> Parser TimestreamTimestamp
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TimestreamTimestamp"
( \Object
x ->
Text -> Text -> TimestreamTimestamp
TimestreamTimestamp'
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
"value")
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
"unit")
)
instance Prelude.Hashable TimestreamTimestamp where
hashWithSalt :: Int -> TimestreamTimestamp -> Int
hashWithSalt Int
_salt TimestreamTimestamp' {Text
unit :: Text
value :: Text
$sel:unit:TimestreamTimestamp' :: TimestreamTimestamp -> Text
$sel:value:TimestreamTimestamp' :: TimestreamTimestamp -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
value
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
unit
instance Prelude.NFData TimestreamTimestamp where
rnf :: TimestreamTimestamp -> ()
rnf TimestreamTimestamp' {Text
unit :: Text
value :: Text
$sel:unit:TimestreamTimestamp' :: TimestreamTimestamp -> Text
$sel:value:TimestreamTimestamp' :: TimestreamTimestamp -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
value seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
unit
instance Data.ToJSON TimestreamTimestamp where
toJSON :: TimestreamTimestamp -> Value
toJSON TimestreamTimestamp' {Text
unit :: Text
value :: Text
$sel:unit:TimestreamTimestamp' :: TimestreamTimestamp -> Text
$sel:value:TimestreamTimestamp' :: TimestreamTimestamp -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
value),
forall a. a -> Maybe a
Prelude.Just (Key
"unit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
unit)
]
)