{-# 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.IotSiteWiseAction where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types.PutAssetPropertyValueEntry
import qualified Amazonka.Prelude as Prelude
data IotSiteWiseAction = IotSiteWiseAction'
{
IotSiteWiseAction -> NonEmpty PutAssetPropertyValueEntry
putAssetPropertyValueEntries :: Prelude.NonEmpty PutAssetPropertyValueEntry,
IotSiteWiseAction -> Text
roleArn :: Prelude.Text
}
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 ::
Prelude.NonEmpty PutAssetPropertyValueEntry ->
Prelude.Text ->
IotSiteWiseAction
newIotSiteWiseAction :: NonEmpty PutAssetPropertyValueEntry -> Text -> IotSiteWiseAction
newIotSiteWiseAction
NonEmpty PutAssetPropertyValueEntry
pPutAssetPropertyValueEntries_
Text
pRoleArn_ =
IotSiteWiseAction'
{ $sel:putAssetPropertyValueEntries:IotSiteWiseAction' :: NonEmpty PutAssetPropertyValueEntry
putAssetPropertyValueEntries =
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty PutAssetPropertyValueEntry
pPutAssetPropertyValueEntries_,
$sel:roleArn:IotSiteWiseAction' :: Text
roleArn = Text
pRoleArn_
}
iotSiteWiseAction_putAssetPropertyValueEntries :: Lens.Lens' IotSiteWiseAction (Prelude.NonEmpty PutAssetPropertyValueEntry)
iotSiteWiseAction_putAssetPropertyValueEntries :: Lens' IotSiteWiseAction (NonEmpty PutAssetPropertyValueEntry)
iotSiteWiseAction_putAssetPropertyValueEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotSiteWiseAction' {NonEmpty PutAssetPropertyValueEntry
putAssetPropertyValueEntries :: NonEmpty PutAssetPropertyValueEntry
$sel:putAssetPropertyValueEntries:IotSiteWiseAction' :: IotSiteWiseAction -> NonEmpty PutAssetPropertyValueEntry
putAssetPropertyValueEntries} -> NonEmpty PutAssetPropertyValueEntry
putAssetPropertyValueEntries) (\s :: IotSiteWiseAction
s@IotSiteWiseAction' {} NonEmpty PutAssetPropertyValueEntry
a -> IotSiteWiseAction
s {$sel:putAssetPropertyValueEntries:IotSiteWiseAction' :: NonEmpty PutAssetPropertyValueEntry
putAssetPropertyValueEntries = NonEmpty PutAssetPropertyValueEntry
a} :: IotSiteWiseAction) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
iotSiteWiseAction_roleArn :: Lens.Lens' IotSiteWiseAction Prelude.Text
iotSiteWiseAction_roleArn :: Lens' IotSiteWiseAction Text
iotSiteWiseAction_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotSiteWiseAction' {Text
roleArn :: Text
$sel:roleArn:IotSiteWiseAction' :: IotSiteWiseAction -> Text
roleArn} -> Text
roleArn) (\s :: IotSiteWiseAction
s@IotSiteWiseAction' {} Text
a -> IotSiteWiseAction
s {$sel:roleArn:IotSiteWiseAction' :: Text
roleArn = Text
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 ->
NonEmpty PutAssetPropertyValueEntry -> Text -> IotSiteWiseAction
IotSiteWiseAction'
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
"putAssetPropertyValueEntries")
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
"roleArn")
)
instance Prelude.Hashable IotSiteWiseAction where
hashWithSalt :: Int -> IotSiteWiseAction -> Int
hashWithSalt Int
_salt IotSiteWiseAction' {NonEmpty PutAssetPropertyValueEntry
Text
roleArn :: Text
putAssetPropertyValueEntries :: NonEmpty PutAssetPropertyValueEntry
$sel:roleArn:IotSiteWiseAction' :: IotSiteWiseAction -> Text
$sel:putAssetPropertyValueEntries:IotSiteWiseAction' :: IotSiteWiseAction -> NonEmpty PutAssetPropertyValueEntry
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty PutAssetPropertyValueEntry
putAssetPropertyValueEntries
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
instance Prelude.NFData IotSiteWiseAction where
rnf :: IotSiteWiseAction -> ()
rnf IotSiteWiseAction' {NonEmpty PutAssetPropertyValueEntry
Text
roleArn :: Text
putAssetPropertyValueEntries :: NonEmpty PutAssetPropertyValueEntry
$sel:roleArn:IotSiteWiseAction' :: IotSiteWiseAction -> Text
$sel:putAssetPropertyValueEntries:IotSiteWiseAction' :: IotSiteWiseAction -> NonEmpty PutAssetPropertyValueEntry
..} =
forall a. NFData a => a -> ()
Prelude.rnf NonEmpty PutAssetPropertyValueEntry
putAssetPropertyValueEntries
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
instance Data.ToJSON IotSiteWiseAction where
toJSON :: IotSiteWiseAction -> Value
toJSON IotSiteWiseAction' {NonEmpty PutAssetPropertyValueEntry
Text
roleArn :: Text
putAssetPropertyValueEntries :: NonEmpty PutAssetPropertyValueEntry
$sel:roleArn:IotSiteWiseAction' :: IotSiteWiseAction -> Text
$sel:putAssetPropertyValueEntries:IotSiteWiseAction' :: IotSiteWiseAction -> NonEmpty PutAssetPropertyValueEntry
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"putAssetPropertyValueEntries"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty PutAssetPropertyValueEntry
putAssetPropertyValueEntries
),
forall a. a -> Maybe a
Prelude.Just (Key
"roleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn)
]
)