{-# 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.SignalInformation 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 SignalInformation = SignalInformation'
{
SignalInformation -> Maybe Natural
maxSampleCount :: Prelude.Maybe Prelude.Natural,
SignalInformation -> Maybe Natural
minimumSamplingIntervalMs :: Prelude.Maybe Prelude.Natural,
SignalInformation -> Text
name :: Prelude.Text
}
deriving (SignalInformation -> SignalInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignalInformation -> SignalInformation -> Bool
$c/= :: SignalInformation -> SignalInformation -> Bool
== :: SignalInformation -> SignalInformation -> Bool
$c== :: SignalInformation -> SignalInformation -> Bool
Prelude.Eq, ReadPrec [SignalInformation]
ReadPrec SignalInformation
Int -> ReadS SignalInformation
ReadS [SignalInformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SignalInformation]
$creadListPrec :: ReadPrec [SignalInformation]
readPrec :: ReadPrec SignalInformation
$creadPrec :: ReadPrec SignalInformation
readList :: ReadS [SignalInformation]
$creadList :: ReadS [SignalInformation]
readsPrec :: Int -> ReadS SignalInformation
$creadsPrec :: Int -> ReadS SignalInformation
Prelude.Read, Int -> SignalInformation -> ShowS
[SignalInformation] -> ShowS
SignalInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignalInformation] -> ShowS
$cshowList :: [SignalInformation] -> ShowS
show :: SignalInformation -> String
$cshow :: SignalInformation -> String
showsPrec :: Int -> SignalInformation -> ShowS
$cshowsPrec :: Int -> SignalInformation -> ShowS
Prelude.Show, forall x. Rep SignalInformation x -> SignalInformation
forall x. SignalInformation -> Rep SignalInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SignalInformation x -> SignalInformation
$cfrom :: forall x. SignalInformation -> Rep SignalInformation x
Prelude.Generic)
newSignalInformation ::
Prelude.Text ->
SignalInformation
newSignalInformation :: Text -> SignalInformation
newSignalInformation Text
pName_ =
SignalInformation'
{ $sel:maxSampleCount:SignalInformation' :: Maybe Natural
maxSampleCount =
forall a. Maybe a
Prelude.Nothing,
$sel:minimumSamplingIntervalMs:SignalInformation' :: Maybe Natural
minimumSamplingIntervalMs = forall a. Maybe a
Prelude.Nothing,
$sel:name:SignalInformation' :: Text
name = Text
pName_
}
signalInformation_maxSampleCount :: Lens.Lens' SignalInformation (Prelude.Maybe Prelude.Natural)
signalInformation_maxSampleCount :: Lens' SignalInformation (Maybe Natural)
signalInformation_maxSampleCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignalInformation' {Maybe Natural
maxSampleCount :: Maybe Natural
$sel:maxSampleCount:SignalInformation' :: SignalInformation -> Maybe Natural
maxSampleCount} -> Maybe Natural
maxSampleCount) (\s :: SignalInformation
s@SignalInformation' {} Maybe Natural
a -> SignalInformation
s {$sel:maxSampleCount:SignalInformation' :: Maybe Natural
maxSampleCount = Maybe Natural
a} :: SignalInformation)
signalInformation_minimumSamplingIntervalMs :: Lens.Lens' SignalInformation (Prelude.Maybe Prelude.Natural)
signalInformation_minimumSamplingIntervalMs :: Lens' SignalInformation (Maybe Natural)
signalInformation_minimumSamplingIntervalMs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignalInformation' {Maybe Natural
minimumSamplingIntervalMs :: Maybe Natural
$sel:minimumSamplingIntervalMs:SignalInformation' :: SignalInformation -> Maybe Natural
minimumSamplingIntervalMs} -> Maybe Natural
minimumSamplingIntervalMs) (\s :: SignalInformation
s@SignalInformation' {} Maybe Natural
a -> SignalInformation
s {$sel:minimumSamplingIntervalMs:SignalInformation' :: Maybe Natural
minimumSamplingIntervalMs = Maybe Natural
a} :: SignalInformation)
signalInformation_name :: Lens.Lens' SignalInformation Prelude.Text
signalInformation_name :: Lens' SignalInformation Text
signalInformation_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignalInformation' {Text
name :: Text
$sel:name:SignalInformation' :: SignalInformation -> Text
name} -> Text
name) (\s :: SignalInformation
s@SignalInformation' {} Text
a -> SignalInformation
s {$sel:name:SignalInformation' :: Text
name = Text
a} :: SignalInformation)
instance Data.FromJSON SignalInformation where
parseJSON :: Value -> Parser SignalInformation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SignalInformation"
( \Object
x ->
Maybe Natural -> Maybe Natural -> Text -> SignalInformation
SignalInformation'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"maxSampleCount")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"minimumSamplingIntervalMs")
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
"name")
)
instance Prelude.Hashable SignalInformation where
hashWithSalt :: Int -> SignalInformation -> Int
hashWithSalt Int
_salt SignalInformation' {Maybe Natural
Text
name :: Text
minimumSamplingIntervalMs :: Maybe Natural
maxSampleCount :: Maybe Natural
$sel:name:SignalInformation' :: SignalInformation -> Text
$sel:minimumSamplingIntervalMs:SignalInformation' :: SignalInformation -> Maybe Natural
$sel:maxSampleCount:SignalInformation' :: SignalInformation -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxSampleCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
minimumSamplingIntervalMs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData SignalInformation where
rnf :: SignalInformation -> ()
rnf SignalInformation' {Maybe Natural
Text
name :: Text
minimumSamplingIntervalMs :: Maybe Natural
maxSampleCount :: Maybe Natural
$sel:name:SignalInformation' :: SignalInformation -> Text
$sel:minimumSamplingIntervalMs:SignalInformation' :: SignalInformation -> Maybe Natural
$sel:maxSampleCount:SignalInformation' :: SignalInformation -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxSampleCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
minimumSamplingIntervalMs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToJSON SignalInformation where
toJSON :: SignalInformation -> Value
toJSON SignalInformation' {Maybe Natural
Text
name :: Text
minimumSamplingIntervalMs :: Maybe Natural
maxSampleCount :: Maybe Natural
$sel:name:SignalInformation' :: SignalInformation -> Text
$sel:minimumSamplingIntervalMs:SignalInformation' :: SignalInformation -> Maybe Natural
$sel:maxSampleCount:SignalInformation' :: SignalInformation -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"maxSampleCount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxSampleCount,
(Key
"minimumSamplingIntervalMs" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
minimumSamplingIntervalMs,
forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
]
)