{-# 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.IoTEvents.Types.IotSiteWiseAction where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTEvents.Types.AssetPropertyValue
import qualified Amazonka.Prelude as Prelude
data IotSiteWiseAction = IotSiteWiseAction'
{
IotSiteWiseAction -> Maybe Text
assetId :: Prelude.Maybe Prelude.Text,
IotSiteWiseAction -> Maybe Text
entryId :: Prelude.Maybe Prelude.Text,
IotSiteWiseAction -> Maybe Text
propertyAlias :: Prelude.Maybe Prelude.Text,
IotSiteWiseAction -> Maybe Text
propertyId :: Prelude.Maybe Prelude.Text,
IotSiteWiseAction -> Maybe AssetPropertyValue
propertyValue :: Prelude.Maybe AssetPropertyValue
}
deriving (IotSiteWiseAction -> IotSiteWiseAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IotSiteWiseAction -> IotSiteWiseAction -> Bool
$c/= :: IotSiteWiseAction -> IotSiteWiseAction -> Bool
== :: IotSiteWiseAction -> IotSiteWiseAction -> Bool
$c== :: IotSiteWiseAction -> IotSiteWiseAction -> Bool
Prelude.Eq, ReadPrec [IotSiteWiseAction]
ReadPrec IotSiteWiseAction
Int -> ReadS IotSiteWiseAction
ReadS [IotSiteWiseAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IotSiteWiseAction]
$creadListPrec :: ReadPrec [IotSiteWiseAction]
readPrec :: ReadPrec IotSiteWiseAction
$creadPrec :: ReadPrec IotSiteWiseAction
readList :: ReadS [IotSiteWiseAction]
$creadList :: ReadS [IotSiteWiseAction]
readsPrec :: Int -> ReadS IotSiteWiseAction
$creadsPrec :: Int -> ReadS IotSiteWiseAction
Prelude.Read, Int -> IotSiteWiseAction -> ShowS
[IotSiteWiseAction] -> ShowS
IotSiteWiseAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IotSiteWiseAction] -> ShowS
$cshowList :: [IotSiteWiseAction] -> ShowS
show :: IotSiteWiseAction -> String
$cshow :: IotSiteWiseAction -> String
showsPrec :: Int -> IotSiteWiseAction -> ShowS
$cshowsPrec :: Int -> IotSiteWiseAction -> ShowS
Prelude.Show, forall x. Rep IotSiteWiseAction x -> IotSiteWiseAction
forall x. IotSiteWiseAction -> Rep IotSiteWiseAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IotSiteWiseAction x -> IotSiteWiseAction
$cfrom :: forall x. IotSiteWiseAction -> Rep IotSiteWiseAction x
Prelude.Generic)
newIotSiteWiseAction ::
IotSiteWiseAction
newIotSiteWiseAction :: IotSiteWiseAction
newIotSiteWiseAction =
IotSiteWiseAction'
{ $sel:assetId:IotSiteWiseAction' :: Maybe Text
assetId = forall a. Maybe a
Prelude.Nothing,
$sel:entryId:IotSiteWiseAction' :: Maybe Text
entryId = forall a. Maybe a
Prelude.Nothing,
$sel:propertyAlias:IotSiteWiseAction' :: Maybe Text
propertyAlias = forall a. Maybe a
Prelude.Nothing,
$sel:propertyId:IotSiteWiseAction' :: Maybe Text
propertyId = forall a. Maybe a
Prelude.Nothing,
$sel:propertyValue:IotSiteWiseAction' :: Maybe AssetPropertyValue
propertyValue = forall a. Maybe a
Prelude.Nothing
}
iotSiteWiseAction_assetId :: Lens.Lens' IotSiteWiseAction (Prelude.Maybe Prelude.Text)
iotSiteWiseAction_assetId :: Lens' IotSiteWiseAction (Maybe Text)
iotSiteWiseAction_assetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotSiteWiseAction' {Maybe Text
assetId :: Maybe Text
$sel:assetId:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
assetId} -> Maybe Text
assetId) (\s :: IotSiteWiseAction
s@IotSiteWiseAction' {} Maybe Text
a -> IotSiteWiseAction
s {$sel:assetId:IotSiteWiseAction' :: Maybe Text
assetId = Maybe Text
a} :: IotSiteWiseAction)
iotSiteWiseAction_entryId :: Lens.Lens' IotSiteWiseAction (Prelude.Maybe Prelude.Text)
iotSiteWiseAction_entryId :: Lens' IotSiteWiseAction (Maybe Text)
iotSiteWiseAction_entryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotSiteWiseAction' {Maybe Text
entryId :: Maybe Text
$sel:entryId:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
entryId} -> Maybe Text
entryId) (\s :: IotSiteWiseAction
s@IotSiteWiseAction' {} Maybe Text
a -> IotSiteWiseAction
s {$sel:entryId:IotSiteWiseAction' :: Maybe Text
entryId = Maybe Text
a} :: IotSiteWiseAction)
iotSiteWiseAction_propertyAlias :: Lens.Lens' IotSiteWiseAction (Prelude.Maybe Prelude.Text)
iotSiteWiseAction_propertyAlias :: Lens' IotSiteWiseAction (Maybe Text)
iotSiteWiseAction_propertyAlias = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotSiteWiseAction' {Maybe Text
propertyAlias :: Maybe Text
$sel:propertyAlias:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
propertyAlias} -> Maybe Text
propertyAlias) (\s :: IotSiteWiseAction
s@IotSiteWiseAction' {} Maybe Text
a -> IotSiteWiseAction
s {$sel:propertyAlias:IotSiteWiseAction' :: Maybe Text
propertyAlias = Maybe Text
a} :: IotSiteWiseAction)
iotSiteWiseAction_propertyId :: Lens.Lens' IotSiteWiseAction (Prelude.Maybe Prelude.Text)
iotSiteWiseAction_propertyId :: Lens' IotSiteWiseAction (Maybe Text)
iotSiteWiseAction_propertyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotSiteWiseAction' {Maybe Text
propertyId :: Maybe Text
$sel:propertyId:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
propertyId} -> Maybe Text
propertyId) (\s :: IotSiteWiseAction
s@IotSiteWiseAction' {} Maybe Text
a -> IotSiteWiseAction
s {$sel:propertyId:IotSiteWiseAction' :: Maybe Text
propertyId = Maybe Text
a} :: IotSiteWiseAction)
iotSiteWiseAction_propertyValue :: Lens.Lens' IotSiteWiseAction (Prelude.Maybe AssetPropertyValue)
iotSiteWiseAction_propertyValue :: Lens' IotSiteWiseAction (Maybe AssetPropertyValue)
iotSiteWiseAction_propertyValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotSiteWiseAction' {Maybe AssetPropertyValue
propertyValue :: Maybe AssetPropertyValue
$sel:propertyValue:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe AssetPropertyValue
propertyValue} -> Maybe AssetPropertyValue
propertyValue) (\s :: IotSiteWiseAction
s@IotSiteWiseAction' {} Maybe AssetPropertyValue
a -> IotSiteWiseAction
s {$sel:propertyValue:IotSiteWiseAction' :: Maybe AssetPropertyValue
propertyValue = Maybe AssetPropertyValue
a} :: IotSiteWiseAction)
instance Data.FromJSON IotSiteWiseAction where
parseJSON :: Value -> Parser IotSiteWiseAction
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"IotSiteWiseAction"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AssetPropertyValue
-> IotSiteWiseAction
IotSiteWiseAction'
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
"assetId")
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
"entryId")
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
"propertyAlias")
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
"propertyId")
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
"propertyValue")
)
instance Prelude.Hashable IotSiteWiseAction where
hashWithSalt :: Int -> IotSiteWiseAction -> Int
hashWithSalt Int
_salt IotSiteWiseAction' {Maybe Text
Maybe AssetPropertyValue
propertyValue :: Maybe AssetPropertyValue
propertyId :: Maybe Text
propertyAlias :: Maybe Text
entryId :: Maybe Text
assetId :: Maybe Text
$sel:propertyValue:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe AssetPropertyValue
$sel:propertyId:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
$sel:propertyAlias:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
$sel:entryId:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
$sel:assetId:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
assetId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
entryId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
propertyAlias
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
propertyId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AssetPropertyValue
propertyValue
instance Prelude.NFData IotSiteWiseAction where
rnf :: IotSiteWiseAction -> ()
rnf IotSiteWiseAction' {Maybe Text
Maybe AssetPropertyValue
propertyValue :: Maybe AssetPropertyValue
propertyId :: Maybe Text
propertyAlias :: Maybe Text
entryId :: Maybe Text
assetId :: Maybe Text
$sel:propertyValue:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe AssetPropertyValue
$sel:propertyId:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
$sel:propertyAlias:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
$sel:entryId:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
$sel:assetId:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
assetId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
entryId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
propertyAlias
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
propertyId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AssetPropertyValue
propertyValue
instance Data.ToJSON IotSiteWiseAction where
toJSON :: IotSiteWiseAction -> Value
toJSON IotSiteWiseAction' {Maybe Text
Maybe AssetPropertyValue
propertyValue :: Maybe AssetPropertyValue
propertyId :: Maybe Text
propertyAlias :: Maybe Text
entryId :: Maybe Text
assetId :: Maybe Text
$sel:propertyValue:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe AssetPropertyValue
$sel:propertyId:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
$sel:propertyAlias:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
$sel:entryId:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
$sel:assetId:IotSiteWiseAction' :: IotSiteWiseAction -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"assetId" 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 Text
assetId,
(Key
"entryId" 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 Text
entryId,
(Key
"propertyAlias" 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 Text
propertyAlias,
(Key
"propertyId" 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 Text
propertyId,
(Key
"propertyValue" 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 AssetPropertyValue
propertyValue
]
)