{-# 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.AssetModelPropertyDefinition where
import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.Types.PropertyDataType
import Amazonka.IoTSiteWise.Types.PropertyType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssetModelPropertyDefinition = AssetModelPropertyDefinition'
{
AssetModelPropertyDefinition -> Maybe Text
dataTypeSpec :: Prelude.Maybe Prelude.Text,
AssetModelPropertyDefinition -> Maybe Text
unit :: Prelude.Maybe Prelude.Text,
AssetModelPropertyDefinition -> Text
name :: Prelude.Text,
AssetModelPropertyDefinition -> PropertyDataType
dataType :: PropertyDataType,
AssetModelPropertyDefinition -> PropertyType
type' :: PropertyType
}
deriving (AssetModelPropertyDefinition
-> AssetModelPropertyDefinition -> Bool
(AssetModelPropertyDefinition
-> AssetModelPropertyDefinition -> Bool)
-> (AssetModelPropertyDefinition
-> AssetModelPropertyDefinition -> Bool)
-> Eq AssetModelPropertyDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetModelPropertyDefinition
-> AssetModelPropertyDefinition -> Bool
$c/= :: AssetModelPropertyDefinition
-> AssetModelPropertyDefinition -> Bool
== :: AssetModelPropertyDefinition
-> AssetModelPropertyDefinition -> Bool
$c== :: AssetModelPropertyDefinition
-> AssetModelPropertyDefinition -> Bool
Prelude.Eq, ReadPrec [AssetModelPropertyDefinition]
ReadPrec AssetModelPropertyDefinition
Int -> ReadS AssetModelPropertyDefinition
ReadS [AssetModelPropertyDefinition]
(Int -> ReadS AssetModelPropertyDefinition)
-> ReadS [AssetModelPropertyDefinition]
-> ReadPrec AssetModelPropertyDefinition
-> ReadPrec [AssetModelPropertyDefinition]
-> Read AssetModelPropertyDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssetModelPropertyDefinition]
$creadListPrec :: ReadPrec [AssetModelPropertyDefinition]
readPrec :: ReadPrec AssetModelPropertyDefinition
$creadPrec :: ReadPrec AssetModelPropertyDefinition
readList :: ReadS [AssetModelPropertyDefinition]
$creadList :: ReadS [AssetModelPropertyDefinition]
readsPrec :: Int -> ReadS AssetModelPropertyDefinition
$creadsPrec :: Int -> ReadS AssetModelPropertyDefinition
Prelude.Read, Int -> AssetModelPropertyDefinition -> ShowS
[AssetModelPropertyDefinition] -> ShowS
AssetModelPropertyDefinition -> String
(Int -> AssetModelPropertyDefinition -> ShowS)
-> (AssetModelPropertyDefinition -> String)
-> ([AssetModelPropertyDefinition] -> ShowS)
-> Show AssetModelPropertyDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetModelPropertyDefinition] -> ShowS
$cshowList :: [AssetModelPropertyDefinition] -> ShowS
show :: AssetModelPropertyDefinition -> String
$cshow :: AssetModelPropertyDefinition -> String
showsPrec :: Int -> AssetModelPropertyDefinition -> ShowS
$cshowsPrec :: Int -> AssetModelPropertyDefinition -> ShowS
Prelude.Show, (forall x.
AssetModelPropertyDefinition -> Rep AssetModelPropertyDefinition x)
-> (forall x.
Rep AssetModelPropertyDefinition x -> AssetModelPropertyDefinition)
-> Generic AssetModelPropertyDefinition
forall x.
Rep AssetModelPropertyDefinition x -> AssetModelPropertyDefinition
forall x.
AssetModelPropertyDefinition -> Rep AssetModelPropertyDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssetModelPropertyDefinition x -> AssetModelPropertyDefinition
$cfrom :: forall x.
AssetModelPropertyDefinition -> Rep AssetModelPropertyDefinition x
Prelude.Generic)
newAssetModelPropertyDefinition ::
Prelude.Text ->
PropertyDataType ->
PropertyType ->
AssetModelPropertyDefinition
newAssetModelPropertyDefinition :: Text
-> PropertyDataType -> PropertyType -> AssetModelPropertyDefinition
newAssetModelPropertyDefinition
Text
pName_
PropertyDataType
pDataType_
PropertyType
pType_ =
AssetModelPropertyDefinition' :: Maybe Text
-> Maybe Text
-> Text
-> PropertyDataType
-> PropertyType
-> AssetModelPropertyDefinition
AssetModelPropertyDefinition'
{ $sel:dataTypeSpec:AssetModelPropertyDefinition' :: Maybe Text
dataTypeSpec =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:unit:AssetModelPropertyDefinition' :: Maybe Text
unit = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:AssetModelPropertyDefinition' :: Text
name = Text
pName_,
$sel:dataType:AssetModelPropertyDefinition' :: PropertyDataType
dataType = PropertyDataType
pDataType_,
$sel:type':AssetModelPropertyDefinition' :: PropertyType
type' = PropertyType
pType_
}
assetModelPropertyDefinition_dataTypeSpec :: Lens.Lens' AssetModelPropertyDefinition (Prelude.Maybe Prelude.Text)
assetModelPropertyDefinition_dataTypeSpec :: (Maybe Text -> f (Maybe Text))
-> AssetModelPropertyDefinition -> f AssetModelPropertyDefinition
assetModelPropertyDefinition_dataTypeSpec = (AssetModelPropertyDefinition -> Maybe Text)
-> (AssetModelPropertyDefinition
-> Maybe Text -> AssetModelPropertyDefinition)
-> Lens
AssetModelPropertyDefinition
AssetModelPropertyDefinition
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetModelPropertyDefinition' {Maybe Text
dataTypeSpec :: Maybe Text
$sel:dataTypeSpec:AssetModelPropertyDefinition' :: AssetModelPropertyDefinition -> Maybe Text
dataTypeSpec} -> Maybe Text
dataTypeSpec) (\s :: AssetModelPropertyDefinition
s@AssetModelPropertyDefinition' {} Maybe Text
a -> AssetModelPropertyDefinition
s {$sel:dataTypeSpec:AssetModelPropertyDefinition' :: Maybe Text
dataTypeSpec = Maybe Text
a} :: AssetModelPropertyDefinition)
assetModelPropertyDefinition_unit :: Lens.Lens' AssetModelPropertyDefinition (Prelude.Maybe Prelude.Text)
assetModelPropertyDefinition_unit :: (Maybe Text -> f (Maybe Text))
-> AssetModelPropertyDefinition -> f AssetModelPropertyDefinition
assetModelPropertyDefinition_unit = (AssetModelPropertyDefinition -> Maybe Text)
-> (AssetModelPropertyDefinition
-> Maybe Text -> AssetModelPropertyDefinition)
-> Lens
AssetModelPropertyDefinition
AssetModelPropertyDefinition
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetModelPropertyDefinition' {Maybe Text
unit :: Maybe Text
$sel:unit:AssetModelPropertyDefinition' :: AssetModelPropertyDefinition -> Maybe Text
unit} -> Maybe Text
unit) (\s :: AssetModelPropertyDefinition
s@AssetModelPropertyDefinition' {} Maybe Text
a -> AssetModelPropertyDefinition
s {$sel:unit:AssetModelPropertyDefinition' :: Maybe Text
unit = Maybe Text
a} :: AssetModelPropertyDefinition)
assetModelPropertyDefinition_name :: Lens.Lens' AssetModelPropertyDefinition Prelude.Text
assetModelPropertyDefinition_name :: (Text -> f Text)
-> AssetModelPropertyDefinition -> f AssetModelPropertyDefinition
assetModelPropertyDefinition_name = (AssetModelPropertyDefinition -> Text)
-> (AssetModelPropertyDefinition
-> Text -> AssetModelPropertyDefinition)
-> Lens
AssetModelPropertyDefinition AssetModelPropertyDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetModelPropertyDefinition' {Text
name :: Text
$sel:name:AssetModelPropertyDefinition' :: AssetModelPropertyDefinition -> Text
name} -> Text
name) (\s :: AssetModelPropertyDefinition
s@AssetModelPropertyDefinition' {} Text
a -> AssetModelPropertyDefinition
s {$sel:name:AssetModelPropertyDefinition' :: Text
name = Text
a} :: AssetModelPropertyDefinition)
assetModelPropertyDefinition_dataType :: Lens.Lens' AssetModelPropertyDefinition PropertyDataType
assetModelPropertyDefinition_dataType :: (PropertyDataType -> f PropertyDataType)
-> AssetModelPropertyDefinition -> f AssetModelPropertyDefinition
assetModelPropertyDefinition_dataType = (AssetModelPropertyDefinition -> PropertyDataType)
-> (AssetModelPropertyDefinition
-> PropertyDataType -> AssetModelPropertyDefinition)
-> Lens
AssetModelPropertyDefinition
AssetModelPropertyDefinition
PropertyDataType
PropertyDataType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetModelPropertyDefinition' {PropertyDataType
dataType :: PropertyDataType
$sel:dataType:AssetModelPropertyDefinition' :: AssetModelPropertyDefinition -> PropertyDataType
dataType} -> PropertyDataType
dataType) (\s :: AssetModelPropertyDefinition
s@AssetModelPropertyDefinition' {} PropertyDataType
a -> AssetModelPropertyDefinition
s {$sel:dataType:AssetModelPropertyDefinition' :: PropertyDataType
dataType = PropertyDataType
a} :: AssetModelPropertyDefinition)
assetModelPropertyDefinition_type :: Lens.Lens' AssetModelPropertyDefinition PropertyType
assetModelPropertyDefinition_type :: (PropertyType -> f PropertyType)
-> AssetModelPropertyDefinition -> f AssetModelPropertyDefinition
assetModelPropertyDefinition_type = (AssetModelPropertyDefinition -> PropertyType)
-> (AssetModelPropertyDefinition
-> PropertyType -> AssetModelPropertyDefinition)
-> Lens
AssetModelPropertyDefinition
AssetModelPropertyDefinition
PropertyType
PropertyType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetModelPropertyDefinition' {PropertyType
type' :: PropertyType
$sel:type':AssetModelPropertyDefinition' :: AssetModelPropertyDefinition -> PropertyType
type'} -> PropertyType
type') (\s :: AssetModelPropertyDefinition
s@AssetModelPropertyDefinition' {} PropertyType
a -> AssetModelPropertyDefinition
s {$sel:type':AssetModelPropertyDefinition' :: PropertyType
type' = PropertyType
a} :: AssetModelPropertyDefinition)
instance
Prelude.Hashable
AssetModelPropertyDefinition
instance Prelude.NFData AssetModelPropertyDefinition
instance Core.ToJSON AssetModelPropertyDefinition where
toJSON :: AssetModelPropertyDefinition -> Value
toJSON AssetModelPropertyDefinition' {Maybe Text
Text
PropertyDataType
PropertyType
type' :: PropertyType
dataType :: PropertyDataType
name :: Text
unit :: Maybe Text
dataTypeSpec :: Maybe Text
$sel:type':AssetModelPropertyDefinition' :: AssetModelPropertyDefinition -> PropertyType
$sel:dataType:AssetModelPropertyDefinition' :: AssetModelPropertyDefinition -> PropertyDataType
$sel:name:AssetModelPropertyDefinition' :: AssetModelPropertyDefinition -> Text
$sel:unit:AssetModelPropertyDefinition' :: AssetModelPropertyDefinition -> Maybe Text
$sel:dataTypeSpec:AssetModelPropertyDefinition' :: AssetModelPropertyDefinition -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"dataTypeSpec" 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
dataTypeSpec,
(Text
"unit" 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
unit,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"dataType" Text -> PropertyDataType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= PropertyDataType
dataType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> PropertyType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= PropertyType
type')
]
)