{-# 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.IoTSiteWise.Types.PutAssetPropertyValueEntry where
import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.Types.AssetPropertyValue
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PutAssetPropertyValueEntry = PutAssetPropertyValueEntry'
{
PutAssetPropertyValueEntry -> Maybe Text
propertyAlias :: Prelude.Maybe Prelude.Text,
PutAssetPropertyValueEntry -> Maybe Text
propertyId :: Prelude.Maybe Prelude.Text,
PutAssetPropertyValueEntry -> Maybe Text
assetId :: Prelude.Maybe Prelude.Text,
PutAssetPropertyValueEntry -> Text
entryId :: Prelude.Text,
PutAssetPropertyValueEntry -> [AssetPropertyValue]
propertyValues :: [AssetPropertyValue]
}
deriving (PutAssetPropertyValueEntry -> PutAssetPropertyValueEntry -> Bool
(PutAssetPropertyValueEntry -> PutAssetPropertyValueEntry -> Bool)
-> (PutAssetPropertyValueEntry
-> PutAssetPropertyValueEntry -> Bool)
-> Eq PutAssetPropertyValueEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAssetPropertyValueEntry -> PutAssetPropertyValueEntry -> Bool
$c/= :: PutAssetPropertyValueEntry -> PutAssetPropertyValueEntry -> Bool
== :: PutAssetPropertyValueEntry -> PutAssetPropertyValueEntry -> Bool
$c== :: PutAssetPropertyValueEntry -> PutAssetPropertyValueEntry -> Bool
Prelude.Eq, ReadPrec [PutAssetPropertyValueEntry]
ReadPrec PutAssetPropertyValueEntry
Int -> ReadS PutAssetPropertyValueEntry
ReadS [PutAssetPropertyValueEntry]
(Int -> ReadS PutAssetPropertyValueEntry)
-> ReadS [PutAssetPropertyValueEntry]
-> ReadPrec PutAssetPropertyValueEntry
-> ReadPrec [PutAssetPropertyValueEntry]
-> Read PutAssetPropertyValueEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAssetPropertyValueEntry]
$creadListPrec :: ReadPrec [PutAssetPropertyValueEntry]
readPrec :: ReadPrec PutAssetPropertyValueEntry
$creadPrec :: ReadPrec PutAssetPropertyValueEntry
readList :: ReadS [PutAssetPropertyValueEntry]
$creadList :: ReadS [PutAssetPropertyValueEntry]
readsPrec :: Int -> ReadS PutAssetPropertyValueEntry
$creadsPrec :: Int -> ReadS PutAssetPropertyValueEntry
Prelude.Read, Int -> PutAssetPropertyValueEntry -> ShowS
[PutAssetPropertyValueEntry] -> ShowS
PutAssetPropertyValueEntry -> String
(Int -> PutAssetPropertyValueEntry -> ShowS)
-> (PutAssetPropertyValueEntry -> String)
-> ([PutAssetPropertyValueEntry] -> ShowS)
-> Show PutAssetPropertyValueEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAssetPropertyValueEntry] -> ShowS
$cshowList :: [PutAssetPropertyValueEntry] -> ShowS
show :: PutAssetPropertyValueEntry -> String
$cshow :: PutAssetPropertyValueEntry -> String
showsPrec :: Int -> PutAssetPropertyValueEntry -> ShowS
$cshowsPrec :: Int -> PutAssetPropertyValueEntry -> ShowS
Prelude.Show, (forall x.
PutAssetPropertyValueEntry -> Rep PutAssetPropertyValueEntry x)
-> (forall x.
Rep PutAssetPropertyValueEntry x -> PutAssetPropertyValueEntry)
-> Generic PutAssetPropertyValueEntry
forall x.
Rep PutAssetPropertyValueEntry x -> PutAssetPropertyValueEntry
forall x.
PutAssetPropertyValueEntry -> Rep PutAssetPropertyValueEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutAssetPropertyValueEntry x -> PutAssetPropertyValueEntry
$cfrom :: forall x.
PutAssetPropertyValueEntry -> Rep PutAssetPropertyValueEntry x
Prelude.Generic)
newPutAssetPropertyValueEntry ::
Prelude.Text ->
PutAssetPropertyValueEntry
newPutAssetPropertyValueEntry :: Text -> PutAssetPropertyValueEntry
newPutAssetPropertyValueEntry Text
pEntryId_ =
PutAssetPropertyValueEntry' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> [AssetPropertyValue]
-> PutAssetPropertyValueEntry
PutAssetPropertyValueEntry'
{ $sel:propertyAlias:PutAssetPropertyValueEntry' :: Maybe Text
propertyAlias =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:propertyId:PutAssetPropertyValueEntry' :: Maybe Text
propertyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:assetId:PutAssetPropertyValueEntry' :: Maybe Text
assetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:entryId:PutAssetPropertyValueEntry' :: Text
entryId = Text
pEntryId_,
$sel:propertyValues:PutAssetPropertyValueEntry' :: [AssetPropertyValue]
propertyValues = [AssetPropertyValue]
forall a. Monoid a => a
Prelude.mempty
}
putAssetPropertyValueEntry_propertyAlias :: Lens.Lens' PutAssetPropertyValueEntry (Prelude.Maybe Prelude.Text)
putAssetPropertyValueEntry_propertyAlias :: (Maybe Text -> f (Maybe Text))
-> PutAssetPropertyValueEntry -> f PutAssetPropertyValueEntry
putAssetPropertyValueEntry_propertyAlias = (PutAssetPropertyValueEntry -> Maybe Text)
-> (PutAssetPropertyValueEntry
-> Maybe Text -> PutAssetPropertyValueEntry)
-> Lens
PutAssetPropertyValueEntry
PutAssetPropertyValueEntry
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAssetPropertyValueEntry' {Maybe Text
propertyAlias :: Maybe Text
$sel:propertyAlias:PutAssetPropertyValueEntry' :: PutAssetPropertyValueEntry -> Maybe Text
propertyAlias} -> Maybe Text
propertyAlias) (\s :: PutAssetPropertyValueEntry
s@PutAssetPropertyValueEntry' {} Maybe Text
a -> PutAssetPropertyValueEntry
s {$sel:propertyAlias:PutAssetPropertyValueEntry' :: Maybe Text
propertyAlias = Maybe Text
a} :: PutAssetPropertyValueEntry)
putAssetPropertyValueEntry_propertyId :: Lens.Lens' PutAssetPropertyValueEntry (Prelude.Maybe Prelude.Text)
putAssetPropertyValueEntry_propertyId :: (Maybe Text -> f (Maybe Text))
-> PutAssetPropertyValueEntry -> f PutAssetPropertyValueEntry
putAssetPropertyValueEntry_propertyId = (PutAssetPropertyValueEntry -> Maybe Text)
-> (PutAssetPropertyValueEntry
-> Maybe Text -> PutAssetPropertyValueEntry)
-> Lens
PutAssetPropertyValueEntry
PutAssetPropertyValueEntry
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAssetPropertyValueEntry' {Maybe Text
propertyId :: Maybe Text
$sel:propertyId:PutAssetPropertyValueEntry' :: PutAssetPropertyValueEntry -> Maybe Text
propertyId} -> Maybe Text
propertyId) (\s :: PutAssetPropertyValueEntry
s@PutAssetPropertyValueEntry' {} Maybe Text
a -> PutAssetPropertyValueEntry
s {$sel:propertyId:PutAssetPropertyValueEntry' :: Maybe Text
propertyId = Maybe Text
a} :: PutAssetPropertyValueEntry)
putAssetPropertyValueEntry_assetId :: Lens.Lens' PutAssetPropertyValueEntry (Prelude.Maybe Prelude.Text)
putAssetPropertyValueEntry_assetId :: (Maybe Text -> f (Maybe Text))
-> PutAssetPropertyValueEntry -> f PutAssetPropertyValueEntry
putAssetPropertyValueEntry_assetId = (PutAssetPropertyValueEntry -> Maybe Text)
-> (PutAssetPropertyValueEntry
-> Maybe Text -> PutAssetPropertyValueEntry)
-> Lens
PutAssetPropertyValueEntry
PutAssetPropertyValueEntry
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAssetPropertyValueEntry' {Maybe Text
assetId :: Maybe Text
$sel:assetId:PutAssetPropertyValueEntry' :: PutAssetPropertyValueEntry -> Maybe Text
assetId} -> Maybe Text
assetId) (\s :: PutAssetPropertyValueEntry
s@PutAssetPropertyValueEntry' {} Maybe Text
a -> PutAssetPropertyValueEntry
s {$sel:assetId:PutAssetPropertyValueEntry' :: Maybe Text
assetId = Maybe Text
a} :: PutAssetPropertyValueEntry)
putAssetPropertyValueEntry_entryId :: Lens.Lens' PutAssetPropertyValueEntry Prelude.Text
putAssetPropertyValueEntry_entryId :: (Text -> f Text)
-> PutAssetPropertyValueEntry -> f PutAssetPropertyValueEntry
putAssetPropertyValueEntry_entryId = (PutAssetPropertyValueEntry -> Text)
-> (PutAssetPropertyValueEntry
-> Text -> PutAssetPropertyValueEntry)
-> Lens
PutAssetPropertyValueEntry PutAssetPropertyValueEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAssetPropertyValueEntry' {Text
entryId :: Text
$sel:entryId:PutAssetPropertyValueEntry' :: PutAssetPropertyValueEntry -> Text
entryId} -> Text
entryId) (\s :: PutAssetPropertyValueEntry
s@PutAssetPropertyValueEntry' {} Text
a -> PutAssetPropertyValueEntry
s {$sel:entryId:PutAssetPropertyValueEntry' :: Text
entryId = Text
a} :: PutAssetPropertyValueEntry)
putAssetPropertyValueEntry_propertyValues :: Lens.Lens' PutAssetPropertyValueEntry [AssetPropertyValue]
putAssetPropertyValueEntry_propertyValues :: ([AssetPropertyValue] -> f [AssetPropertyValue])
-> PutAssetPropertyValueEntry -> f PutAssetPropertyValueEntry
putAssetPropertyValueEntry_propertyValues = (PutAssetPropertyValueEntry -> [AssetPropertyValue])
-> (PutAssetPropertyValueEntry
-> [AssetPropertyValue] -> PutAssetPropertyValueEntry)
-> Lens
PutAssetPropertyValueEntry
PutAssetPropertyValueEntry
[AssetPropertyValue]
[AssetPropertyValue]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAssetPropertyValueEntry' {[AssetPropertyValue]
propertyValues :: [AssetPropertyValue]
$sel:propertyValues:PutAssetPropertyValueEntry' :: PutAssetPropertyValueEntry -> [AssetPropertyValue]
propertyValues} -> [AssetPropertyValue]
propertyValues) (\s :: PutAssetPropertyValueEntry
s@PutAssetPropertyValueEntry' {} [AssetPropertyValue]
a -> PutAssetPropertyValueEntry
s {$sel:propertyValues:PutAssetPropertyValueEntry' :: [AssetPropertyValue]
propertyValues = [AssetPropertyValue]
a} :: PutAssetPropertyValueEntry) (([AssetPropertyValue] -> f [AssetPropertyValue])
-> PutAssetPropertyValueEntry -> f PutAssetPropertyValueEntry)
-> (([AssetPropertyValue] -> f [AssetPropertyValue])
-> [AssetPropertyValue] -> f [AssetPropertyValue])
-> ([AssetPropertyValue] -> f [AssetPropertyValue])
-> PutAssetPropertyValueEntry
-> f PutAssetPropertyValueEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AssetPropertyValue] -> f [AssetPropertyValue])
-> [AssetPropertyValue] -> f [AssetPropertyValue]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable PutAssetPropertyValueEntry
instance Prelude.NFData PutAssetPropertyValueEntry
instance Core.ToJSON PutAssetPropertyValueEntry where
toJSON :: PutAssetPropertyValueEntry -> Value
toJSON PutAssetPropertyValueEntry' {[AssetPropertyValue]
Maybe Text
Text
propertyValues :: [AssetPropertyValue]
entryId :: Text
assetId :: Maybe Text
propertyId :: Maybe Text
propertyAlias :: Maybe Text
$sel:propertyValues:PutAssetPropertyValueEntry' :: PutAssetPropertyValueEntry -> [AssetPropertyValue]
$sel:entryId:PutAssetPropertyValueEntry' :: PutAssetPropertyValueEntry -> Text
$sel:assetId:PutAssetPropertyValueEntry' :: PutAssetPropertyValueEntry -> Maybe Text
$sel:propertyId:PutAssetPropertyValueEntry' :: PutAssetPropertyValueEntry -> Maybe Text
$sel:propertyAlias:PutAssetPropertyValueEntry' :: PutAssetPropertyValueEntry -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"propertyAlias" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
propertyAlias,
(Text
"propertyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
propertyId,
(Text
"assetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
assetId,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"entryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
entryId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"propertyValues" Text -> [AssetPropertyValue] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [AssetPropertyValue]
propertyValues)
]
)