{-# 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.ConditionBasedCollectionScheme where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTFleetWise.Types.TriggerMode
import qualified Amazonka.Prelude as Prelude
data ConditionBasedCollectionScheme = ConditionBasedCollectionScheme'
{
ConditionBasedCollectionScheme -> Maybe Natural
conditionLanguageVersion :: Prelude.Maybe Prelude.Natural,
ConditionBasedCollectionScheme -> Maybe Natural
minimumTriggerIntervalMs :: Prelude.Maybe Prelude.Natural,
ConditionBasedCollectionScheme -> Maybe TriggerMode
triggerMode :: Prelude.Maybe TriggerMode,
ConditionBasedCollectionScheme -> Text
expression :: Prelude.Text
}
deriving (ConditionBasedCollectionScheme
-> ConditionBasedCollectionScheme -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConditionBasedCollectionScheme
-> ConditionBasedCollectionScheme -> Bool
$c/= :: ConditionBasedCollectionScheme
-> ConditionBasedCollectionScheme -> Bool
== :: ConditionBasedCollectionScheme
-> ConditionBasedCollectionScheme -> Bool
$c== :: ConditionBasedCollectionScheme
-> ConditionBasedCollectionScheme -> Bool
Prelude.Eq, ReadPrec [ConditionBasedCollectionScheme]
ReadPrec ConditionBasedCollectionScheme
Int -> ReadS ConditionBasedCollectionScheme
ReadS [ConditionBasedCollectionScheme]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConditionBasedCollectionScheme]
$creadListPrec :: ReadPrec [ConditionBasedCollectionScheme]
readPrec :: ReadPrec ConditionBasedCollectionScheme
$creadPrec :: ReadPrec ConditionBasedCollectionScheme
readList :: ReadS [ConditionBasedCollectionScheme]
$creadList :: ReadS [ConditionBasedCollectionScheme]
readsPrec :: Int -> ReadS ConditionBasedCollectionScheme
$creadsPrec :: Int -> ReadS ConditionBasedCollectionScheme
Prelude.Read, Int -> ConditionBasedCollectionScheme -> ShowS
[ConditionBasedCollectionScheme] -> ShowS
ConditionBasedCollectionScheme -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConditionBasedCollectionScheme] -> ShowS
$cshowList :: [ConditionBasedCollectionScheme] -> ShowS
show :: ConditionBasedCollectionScheme -> String
$cshow :: ConditionBasedCollectionScheme -> String
showsPrec :: Int -> ConditionBasedCollectionScheme -> ShowS
$cshowsPrec :: Int -> ConditionBasedCollectionScheme -> ShowS
Prelude.Show, forall x.
Rep ConditionBasedCollectionScheme x
-> ConditionBasedCollectionScheme
forall x.
ConditionBasedCollectionScheme
-> Rep ConditionBasedCollectionScheme x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ConditionBasedCollectionScheme x
-> ConditionBasedCollectionScheme
$cfrom :: forall x.
ConditionBasedCollectionScheme
-> Rep ConditionBasedCollectionScheme x
Prelude.Generic)
newConditionBasedCollectionScheme ::
Prelude.Text ->
ConditionBasedCollectionScheme
newConditionBasedCollectionScheme :: Text -> ConditionBasedCollectionScheme
newConditionBasedCollectionScheme Text
pExpression_ =
ConditionBasedCollectionScheme'
{ $sel:conditionLanguageVersion:ConditionBasedCollectionScheme' :: Maybe Natural
conditionLanguageVersion =
forall a. Maybe a
Prelude.Nothing,
$sel:minimumTriggerIntervalMs:ConditionBasedCollectionScheme' :: Maybe Natural
minimumTriggerIntervalMs = forall a. Maybe a
Prelude.Nothing,
$sel:triggerMode:ConditionBasedCollectionScheme' :: Maybe TriggerMode
triggerMode = forall a. Maybe a
Prelude.Nothing,
$sel:expression:ConditionBasedCollectionScheme' :: Text
expression = Text
pExpression_
}
conditionBasedCollectionScheme_conditionLanguageVersion :: Lens.Lens' ConditionBasedCollectionScheme (Prelude.Maybe Prelude.Natural)
conditionBasedCollectionScheme_conditionLanguageVersion :: Lens' ConditionBasedCollectionScheme (Maybe Natural)
conditionBasedCollectionScheme_conditionLanguageVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConditionBasedCollectionScheme' {Maybe Natural
conditionLanguageVersion :: Maybe Natural
$sel:conditionLanguageVersion:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Maybe Natural
conditionLanguageVersion} -> Maybe Natural
conditionLanguageVersion) (\s :: ConditionBasedCollectionScheme
s@ConditionBasedCollectionScheme' {} Maybe Natural
a -> ConditionBasedCollectionScheme
s {$sel:conditionLanguageVersion:ConditionBasedCollectionScheme' :: Maybe Natural
conditionLanguageVersion = Maybe Natural
a} :: ConditionBasedCollectionScheme)
conditionBasedCollectionScheme_minimumTriggerIntervalMs :: Lens.Lens' ConditionBasedCollectionScheme (Prelude.Maybe Prelude.Natural)
conditionBasedCollectionScheme_minimumTriggerIntervalMs :: Lens' ConditionBasedCollectionScheme (Maybe Natural)
conditionBasedCollectionScheme_minimumTriggerIntervalMs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConditionBasedCollectionScheme' {Maybe Natural
minimumTriggerIntervalMs :: Maybe Natural
$sel:minimumTriggerIntervalMs:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Maybe Natural
minimumTriggerIntervalMs} -> Maybe Natural
minimumTriggerIntervalMs) (\s :: ConditionBasedCollectionScheme
s@ConditionBasedCollectionScheme' {} Maybe Natural
a -> ConditionBasedCollectionScheme
s {$sel:minimumTriggerIntervalMs:ConditionBasedCollectionScheme' :: Maybe Natural
minimumTriggerIntervalMs = Maybe Natural
a} :: ConditionBasedCollectionScheme)
conditionBasedCollectionScheme_triggerMode :: Lens.Lens' ConditionBasedCollectionScheme (Prelude.Maybe TriggerMode)
conditionBasedCollectionScheme_triggerMode :: Lens' ConditionBasedCollectionScheme (Maybe TriggerMode)
conditionBasedCollectionScheme_triggerMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConditionBasedCollectionScheme' {Maybe TriggerMode
triggerMode :: Maybe TriggerMode
$sel:triggerMode:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Maybe TriggerMode
triggerMode} -> Maybe TriggerMode
triggerMode) (\s :: ConditionBasedCollectionScheme
s@ConditionBasedCollectionScheme' {} Maybe TriggerMode
a -> ConditionBasedCollectionScheme
s {$sel:triggerMode:ConditionBasedCollectionScheme' :: Maybe TriggerMode
triggerMode = Maybe TriggerMode
a} :: ConditionBasedCollectionScheme)
conditionBasedCollectionScheme_expression :: Lens.Lens' ConditionBasedCollectionScheme Prelude.Text
conditionBasedCollectionScheme_expression :: Lens' ConditionBasedCollectionScheme Text
conditionBasedCollectionScheme_expression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConditionBasedCollectionScheme' {Text
expression :: Text
$sel:expression:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Text
expression} -> Text
expression) (\s :: ConditionBasedCollectionScheme
s@ConditionBasedCollectionScheme' {} Text
a -> ConditionBasedCollectionScheme
s {$sel:expression:ConditionBasedCollectionScheme' :: Text
expression = Text
a} :: ConditionBasedCollectionScheme)
instance Data.FromJSON ConditionBasedCollectionScheme where
parseJSON :: Value -> Parser ConditionBasedCollectionScheme
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ConditionBasedCollectionScheme"
( \Object
x ->
Maybe Natural
-> Maybe Natural
-> Maybe TriggerMode
-> Text
-> ConditionBasedCollectionScheme
ConditionBasedCollectionScheme'
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
"conditionLanguageVersion")
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
"minimumTriggerIntervalMs")
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
"triggerMode")
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
"expression")
)
instance
Prelude.Hashable
ConditionBasedCollectionScheme
where
hashWithSalt :: Int -> ConditionBasedCollectionScheme -> Int
hashWithSalt
Int
_salt
ConditionBasedCollectionScheme' {Maybe Natural
Maybe TriggerMode
Text
expression :: Text
triggerMode :: Maybe TriggerMode
minimumTriggerIntervalMs :: Maybe Natural
conditionLanguageVersion :: Maybe Natural
$sel:expression:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Text
$sel:triggerMode:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Maybe TriggerMode
$sel:minimumTriggerIntervalMs:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Maybe Natural
$sel:conditionLanguageVersion:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
conditionLanguageVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
minimumTriggerIntervalMs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TriggerMode
triggerMode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
expression
instance
Prelude.NFData
ConditionBasedCollectionScheme
where
rnf :: ConditionBasedCollectionScheme -> ()
rnf ConditionBasedCollectionScheme' {Maybe Natural
Maybe TriggerMode
Text
expression :: Text
triggerMode :: Maybe TriggerMode
minimumTriggerIntervalMs :: Maybe Natural
conditionLanguageVersion :: Maybe Natural
$sel:expression:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Text
$sel:triggerMode:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Maybe TriggerMode
$sel:minimumTriggerIntervalMs:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Maybe Natural
$sel:conditionLanguageVersion:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
conditionLanguageVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
minimumTriggerIntervalMs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TriggerMode
triggerMode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
expression
instance Data.ToJSON ConditionBasedCollectionScheme where
toJSON :: ConditionBasedCollectionScheme -> Value
toJSON ConditionBasedCollectionScheme' {Maybe Natural
Maybe TriggerMode
Text
expression :: Text
triggerMode :: Maybe TriggerMode
minimumTriggerIntervalMs :: Maybe Natural
conditionLanguageVersion :: Maybe Natural
$sel:expression:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Text
$sel:triggerMode:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Maybe TriggerMode
$sel:minimumTriggerIntervalMs:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Maybe Natural
$sel:conditionLanguageVersion:ConditionBasedCollectionScheme' :: ConditionBasedCollectionScheme -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"conditionLanguageVersion" 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
conditionLanguageVersion,
(Key
"minimumTriggerIntervalMs" 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
minimumTriggerIntervalMs,
(Key
"triggerMode" 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 TriggerMode
triggerMode,
forall a. a -> Maybe a
Prelude.Just (Key
"expression" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
expression)
]
)