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