{-# 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.AssetModelCompositeModelDefinition where
import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.Types.AssetModelPropertyDefinition
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssetModelCompositeModelDefinition = AssetModelCompositeModelDefinition'
{
AssetModelCompositeModelDefinition -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
AssetModelCompositeModelDefinition
-> Maybe [AssetModelPropertyDefinition]
properties :: Prelude.Maybe [AssetModelPropertyDefinition],
AssetModelCompositeModelDefinition -> Text
name :: Prelude.Text,
AssetModelCompositeModelDefinition -> Text
type' :: Prelude.Text
}
deriving (AssetModelCompositeModelDefinition
-> AssetModelCompositeModelDefinition -> Bool
(AssetModelCompositeModelDefinition
-> AssetModelCompositeModelDefinition -> Bool)
-> (AssetModelCompositeModelDefinition
-> AssetModelCompositeModelDefinition -> Bool)
-> Eq AssetModelCompositeModelDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetModelCompositeModelDefinition
-> AssetModelCompositeModelDefinition -> Bool
$c/= :: AssetModelCompositeModelDefinition
-> AssetModelCompositeModelDefinition -> Bool
== :: AssetModelCompositeModelDefinition
-> AssetModelCompositeModelDefinition -> Bool
$c== :: AssetModelCompositeModelDefinition
-> AssetModelCompositeModelDefinition -> Bool
Prelude.Eq, ReadPrec [AssetModelCompositeModelDefinition]
ReadPrec AssetModelCompositeModelDefinition
Int -> ReadS AssetModelCompositeModelDefinition
ReadS [AssetModelCompositeModelDefinition]
(Int -> ReadS AssetModelCompositeModelDefinition)
-> ReadS [AssetModelCompositeModelDefinition]
-> ReadPrec AssetModelCompositeModelDefinition
-> ReadPrec [AssetModelCompositeModelDefinition]
-> Read AssetModelCompositeModelDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssetModelCompositeModelDefinition]
$creadListPrec :: ReadPrec [AssetModelCompositeModelDefinition]
readPrec :: ReadPrec AssetModelCompositeModelDefinition
$creadPrec :: ReadPrec AssetModelCompositeModelDefinition
readList :: ReadS [AssetModelCompositeModelDefinition]
$creadList :: ReadS [AssetModelCompositeModelDefinition]
readsPrec :: Int -> ReadS AssetModelCompositeModelDefinition
$creadsPrec :: Int -> ReadS AssetModelCompositeModelDefinition
Prelude.Read, Int -> AssetModelCompositeModelDefinition -> ShowS
[AssetModelCompositeModelDefinition] -> ShowS
AssetModelCompositeModelDefinition -> String
(Int -> AssetModelCompositeModelDefinition -> ShowS)
-> (AssetModelCompositeModelDefinition -> String)
-> ([AssetModelCompositeModelDefinition] -> ShowS)
-> Show AssetModelCompositeModelDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetModelCompositeModelDefinition] -> ShowS
$cshowList :: [AssetModelCompositeModelDefinition] -> ShowS
show :: AssetModelCompositeModelDefinition -> String
$cshow :: AssetModelCompositeModelDefinition -> String
showsPrec :: Int -> AssetModelCompositeModelDefinition -> ShowS
$cshowsPrec :: Int -> AssetModelCompositeModelDefinition -> ShowS
Prelude.Show, (forall x.
AssetModelCompositeModelDefinition
-> Rep AssetModelCompositeModelDefinition x)
-> (forall x.
Rep AssetModelCompositeModelDefinition x
-> AssetModelCompositeModelDefinition)
-> Generic AssetModelCompositeModelDefinition
forall x.
Rep AssetModelCompositeModelDefinition x
-> AssetModelCompositeModelDefinition
forall x.
AssetModelCompositeModelDefinition
-> Rep AssetModelCompositeModelDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssetModelCompositeModelDefinition x
-> AssetModelCompositeModelDefinition
$cfrom :: forall x.
AssetModelCompositeModelDefinition
-> Rep AssetModelCompositeModelDefinition x
Prelude.Generic)
newAssetModelCompositeModelDefinition ::
Prelude.Text ->
Prelude.Text ->
AssetModelCompositeModelDefinition
newAssetModelCompositeModelDefinition :: Text -> Text -> AssetModelCompositeModelDefinition
newAssetModelCompositeModelDefinition Text
pName_ Text
pType_ =
AssetModelCompositeModelDefinition' :: Maybe Text
-> Maybe [AssetModelPropertyDefinition]
-> Text
-> Text
-> AssetModelCompositeModelDefinition
AssetModelCompositeModelDefinition'
{ $sel:description:AssetModelCompositeModelDefinition' :: Maybe Text
description =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:properties:AssetModelCompositeModelDefinition' :: Maybe [AssetModelPropertyDefinition]
properties = Maybe [AssetModelPropertyDefinition]
forall a. Maybe a
Prelude.Nothing,
$sel:name:AssetModelCompositeModelDefinition' :: Text
name = Text
pName_,
$sel:type':AssetModelCompositeModelDefinition' :: Text
type' = Text
pType_
}
assetModelCompositeModelDefinition_description :: Lens.Lens' AssetModelCompositeModelDefinition (Prelude.Maybe Prelude.Text)
assetModelCompositeModelDefinition_description :: (Maybe Text -> f (Maybe Text))
-> AssetModelCompositeModelDefinition
-> f AssetModelCompositeModelDefinition
assetModelCompositeModelDefinition_description = (AssetModelCompositeModelDefinition -> Maybe Text)
-> (AssetModelCompositeModelDefinition
-> Maybe Text -> AssetModelCompositeModelDefinition)
-> Lens
AssetModelCompositeModelDefinition
AssetModelCompositeModelDefinition
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetModelCompositeModelDefinition' {Maybe Text
description :: Maybe Text
$sel:description:AssetModelCompositeModelDefinition' :: AssetModelCompositeModelDefinition -> Maybe Text
description} -> Maybe Text
description) (\s :: AssetModelCompositeModelDefinition
s@AssetModelCompositeModelDefinition' {} Maybe Text
a -> AssetModelCompositeModelDefinition
s {$sel:description:AssetModelCompositeModelDefinition' :: Maybe Text
description = Maybe Text
a} :: AssetModelCompositeModelDefinition)
assetModelCompositeModelDefinition_properties :: Lens.Lens' AssetModelCompositeModelDefinition (Prelude.Maybe [AssetModelPropertyDefinition])
assetModelCompositeModelDefinition_properties :: (Maybe [AssetModelPropertyDefinition]
-> f (Maybe [AssetModelPropertyDefinition]))
-> AssetModelCompositeModelDefinition
-> f AssetModelCompositeModelDefinition
assetModelCompositeModelDefinition_properties = (AssetModelCompositeModelDefinition
-> Maybe [AssetModelPropertyDefinition])
-> (AssetModelCompositeModelDefinition
-> Maybe [AssetModelPropertyDefinition]
-> AssetModelCompositeModelDefinition)
-> Lens
AssetModelCompositeModelDefinition
AssetModelCompositeModelDefinition
(Maybe [AssetModelPropertyDefinition])
(Maybe [AssetModelPropertyDefinition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetModelCompositeModelDefinition' {Maybe [AssetModelPropertyDefinition]
properties :: Maybe [AssetModelPropertyDefinition]
$sel:properties:AssetModelCompositeModelDefinition' :: AssetModelCompositeModelDefinition
-> Maybe [AssetModelPropertyDefinition]
properties} -> Maybe [AssetModelPropertyDefinition]
properties) (\s :: AssetModelCompositeModelDefinition
s@AssetModelCompositeModelDefinition' {} Maybe [AssetModelPropertyDefinition]
a -> AssetModelCompositeModelDefinition
s {$sel:properties:AssetModelCompositeModelDefinition' :: Maybe [AssetModelPropertyDefinition]
properties = Maybe [AssetModelPropertyDefinition]
a} :: AssetModelCompositeModelDefinition) ((Maybe [AssetModelPropertyDefinition]
-> f (Maybe [AssetModelPropertyDefinition]))
-> AssetModelCompositeModelDefinition
-> f AssetModelCompositeModelDefinition)
-> ((Maybe [AssetModelPropertyDefinition]
-> f (Maybe [AssetModelPropertyDefinition]))
-> Maybe [AssetModelPropertyDefinition]
-> f (Maybe [AssetModelPropertyDefinition]))
-> (Maybe [AssetModelPropertyDefinition]
-> f (Maybe [AssetModelPropertyDefinition]))
-> AssetModelCompositeModelDefinition
-> f AssetModelCompositeModelDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AssetModelPropertyDefinition]
[AssetModelPropertyDefinition]
[AssetModelPropertyDefinition]
[AssetModelPropertyDefinition]
-> Iso
(Maybe [AssetModelPropertyDefinition])
(Maybe [AssetModelPropertyDefinition])
(Maybe [AssetModelPropertyDefinition])
(Maybe [AssetModelPropertyDefinition])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[AssetModelPropertyDefinition]
[AssetModelPropertyDefinition]
[AssetModelPropertyDefinition]
[AssetModelPropertyDefinition]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
assetModelCompositeModelDefinition_name :: Lens.Lens' AssetModelCompositeModelDefinition Prelude.Text
assetModelCompositeModelDefinition_name :: (Text -> f Text)
-> AssetModelCompositeModelDefinition
-> f AssetModelCompositeModelDefinition
assetModelCompositeModelDefinition_name = (AssetModelCompositeModelDefinition -> Text)
-> (AssetModelCompositeModelDefinition
-> Text -> AssetModelCompositeModelDefinition)
-> Lens
AssetModelCompositeModelDefinition
AssetModelCompositeModelDefinition
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetModelCompositeModelDefinition' {Text
name :: Text
$sel:name:AssetModelCompositeModelDefinition' :: AssetModelCompositeModelDefinition -> Text
name} -> Text
name) (\s :: AssetModelCompositeModelDefinition
s@AssetModelCompositeModelDefinition' {} Text
a -> AssetModelCompositeModelDefinition
s {$sel:name:AssetModelCompositeModelDefinition' :: Text
name = Text
a} :: AssetModelCompositeModelDefinition)
assetModelCompositeModelDefinition_type :: Lens.Lens' AssetModelCompositeModelDefinition Prelude.Text
assetModelCompositeModelDefinition_type :: (Text -> f Text)
-> AssetModelCompositeModelDefinition
-> f AssetModelCompositeModelDefinition
assetModelCompositeModelDefinition_type = (AssetModelCompositeModelDefinition -> Text)
-> (AssetModelCompositeModelDefinition
-> Text -> AssetModelCompositeModelDefinition)
-> Lens
AssetModelCompositeModelDefinition
AssetModelCompositeModelDefinition
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetModelCompositeModelDefinition' {Text
type' :: Text
$sel:type':AssetModelCompositeModelDefinition' :: AssetModelCompositeModelDefinition -> Text
type'} -> Text
type') (\s :: AssetModelCompositeModelDefinition
s@AssetModelCompositeModelDefinition' {} Text
a -> AssetModelCompositeModelDefinition
s {$sel:type':AssetModelCompositeModelDefinition' :: Text
type' = Text
a} :: AssetModelCompositeModelDefinition)
instance
Prelude.Hashable
AssetModelCompositeModelDefinition
instance
Prelude.NFData
AssetModelCompositeModelDefinition
instance
Core.ToJSON
AssetModelCompositeModelDefinition
where
toJSON :: AssetModelCompositeModelDefinition -> Value
toJSON AssetModelCompositeModelDefinition' {Maybe [AssetModelPropertyDefinition]
Maybe Text
Text
type' :: Text
name :: Text
properties :: Maybe [AssetModelPropertyDefinition]
description :: Maybe Text
$sel:type':AssetModelCompositeModelDefinition' :: AssetModelCompositeModelDefinition -> Text
$sel:name:AssetModelCompositeModelDefinition' :: AssetModelCompositeModelDefinition -> Text
$sel:properties:AssetModelCompositeModelDefinition' :: AssetModelCompositeModelDefinition
-> Maybe [AssetModelPropertyDefinition]
$sel:description:AssetModelCompositeModelDefinition' :: AssetModelCompositeModelDefinition -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"description" 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
description,
(Text
"properties" Text -> [AssetModelPropertyDefinition] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([AssetModelPropertyDefinition] -> Pair)
-> Maybe [AssetModelPropertyDefinition] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AssetModelPropertyDefinition]
properties,
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
"type" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
type')
]
)