{-# 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.AssetModelHierarchyDefinition where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssetModelHierarchyDefinition = AssetModelHierarchyDefinition'
{
AssetModelHierarchyDefinition -> Text
name :: Prelude.Text,
AssetModelHierarchyDefinition -> Text
childAssetModelId :: Prelude.Text
}
deriving (AssetModelHierarchyDefinition
-> AssetModelHierarchyDefinition -> Bool
(AssetModelHierarchyDefinition
-> AssetModelHierarchyDefinition -> Bool)
-> (AssetModelHierarchyDefinition
-> AssetModelHierarchyDefinition -> Bool)
-> Eq AssetModelHierarchyDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetModelHierarchyDefinition
-> AssetModelHierarchyDefinition -> Bool
$c/= :: AssetModelHierarchyDefinition
-> AssetModelHierarchyDefinition -> Bool
== :: AssetModelHierarchyDefinition
-> AssetModelHierarchyDefinition -> Bool
$c== :: AssetModelHierarchyDefinition
-> AssetModelHierarchyDefinition -> Bool
Prelude.Eq, ReadPrec [AssetModelHierarchyDefinition]
ReadPrec AssetModelHierarchyDefinition
Int -> ReadS AssetModelHierarchyDefinition
ReadS [AssetModelHierarchyDefinition]
(Int -> ReadS AssetModelHierarchyDefinition)
-> ReadS [AssetModelHierarchyDefinition]
-> ReadPrec AssetModelHierarchyDefinition
-> ReadPrec [AssetModelHierarchyDefinition]
-> Read AssetModelHierarchyDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssetModelHierarchyDefinition]
$creadListPrec :: ReadPrec [AssetModelHierarchyDefinition]
readPrec :: ReadPrec AssetModelHierarchyDefinition
$creadPrec :: ReadPrec AssetModelHierarchyDefinition
readList :: ReadS [AssetModelHierarchyDefinition]
$creadList :: ReadS [AssetModelHierarchyDefinition]
readsPrec :: Int -> ReadS AssetModelHierarchyDefinition
$creadsPrec :: Int -> ReadS AssetModelHierarchyDefinition
Prelude.Read, Int -> AssetModelHierarchyDefinition -> ShowS
[AssetModelHierarchyDefinition] -> ShowS
AssetModelHierarchyDefinition -> String
(Int -> AssetModelHierarchyDefinition -> ShowS)
-> (AssetModelHierarchyDefinition -> String)
-> ([AssetModelHierarchyDefinition] -> ShowS)
-> Show AssetModelHierarchyDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetModelHierarchyDefinition] -> ShowS
$cshowList :: [AssetModelHierarchyDefinition] -> ShowS
show :: AssetModelHierarchyDefinition -> String
$cshow :: AssetModelHierarchyDefinition -> String
showsPrec :: Int -> AssetModelHierarchyDefinition -> ShowS
$cshowsPrec :: Int -> AssetModelHierarchyDefinition -> ShowS
Prelude.Show, (forall x.
AssetModelHierarchyDefinition
-> Rep AssetModelHierarchyDefinition x)
-> (forall x.
Rep AssetModelHierarchyDefinition x
-> AssetModelHierarchyDefinition)
-> Generic AssetModelHierarchyDefinition
forall x.
Rep AssetModelHierarchyDefinition x
-> AssetModelHierarchyDefinition
forall x.
AssetModelHierarchyDefinition
-> Rep AssetModelHierarchyDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssetModelHierarchyDefinition x
-> AssetModelHierarchyDefinition
$cfrom :: forall x.
AssetModelHierarchyDefinition
-> Rep AssetModelHierarchyDefinition x
Prelude.Generic)
newAssetModelHierarchyDefinition ::
Prelude.Text ->
Prelude.Text ->
AssetModelHierarchyDefinition
newAssetModelHierarchyDefinition :: Text -> Text -> AssetModelHierarchyDefinition
newAssetModelHierarchyDefinition
Text
pName_
Text
pChildAssetModelId_ =
AssetModelHierarchyDefinition' :: Text -> Text -> AssetModelHierarchyDefinition
AssetModelHierarchyDefinition'
{ $sel:name:AssetModelHierarchyDefinition' :: Text
name = Text
pName_,
$sel:childAssetModelId:AssetModelHierarchyDefinition' :: Text
childAssetModelId = Text
pChildAssetModelId_
}
assetModelHierarchyDefinition_name :: Lens.Lens' AssetModelHierarchyDefinition Prelude.Text
assetModelHierarchyDefinition_name :: (Text -> f Text)
-> AssetModelHierarchyDefinition -> f AssetModelHierarchyDefinition
assetModelHierarchyDefinition_name = (AssetModelHierarchyDefinition -> Text)
-> (AssetModelHierarchyDefinition
-> Text -> AssetModelHierarchyDefinition)
-> Lens
AssetModelHierarchyDefinition
AssetModelHierarchyDefinition
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetModelHierarchyDefinition' {Text
name :: Text
$sel:name:AssetModelHierarchyDefinition' :: AssetModelHierarchyDefinition -> Text
name} -> Text
name) (\s :: AssetModelHierarchyDefinition
s@AssetModelHierarchyDefinition' {} Text
a -> AssetModelHierarchyDefinition
s {$sel:name:AssetModelHierarchyDefinition' :: Text
name = Text
a} :: AssetModelHierarchyDefinition)
assetModelHierarchyDefinition_childAssetModelId :: Lens.Lens' AssetModelHierarchyDefinition Prelude.Text
assetModelHierarchyDefinition_childAssetModelId :: (Text -> f Text)
-> AssetModelHierarchyDefinition -> f AssetModelHierarchyDefinition
assetModelHierarchyDefinition_childAssetModelId = (AssetModelHierarchyDefinition -> Text)
-> (AssetModelHierarchyDefinition
-> Text -> AssetModelHierarchyDefinition)
-> Lens
AssetModelHierarchyDefinition
AssetModelHierarchyDefinition
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetModelHierarchyDefinition' {Text
childAssetModelId :: Text
$sel:childAssetModelId:AssetModelHierarchyDefinition' :: AssetModelHierarchyDefinition -> Text
childAssetModelId} -> Text
childAssetModelId) (\s :: AssetModelHierarchyDefinition
s@AssetModelHierarchyDefinition' {} Text
a -> AssetModelHierarchyDefinition
s {$sel:childAssetModelId:AssetModelHierarchyDefinition' :: Text
childAssetModelId = Text
a} :: AssetModelHierarchyDefinition)
instance
Prelude.Hashable
AssetModelHierarchyDefinition
instance Prelude.NFData AssetModelHierarchyDefinition
instance Core.ToJSON AssetModelHierarchyDefinition where
toJSON :: AssetModelHierarchyDefinition -> Value
toJSON AssetModelHierarchyDefinition' {Text
childAssetModelId :: Text
name :: Text
$sel:childAssetModelId:AssetModelHierarchyDefinition' :: AssetModelHierarchyDefinition -> Text
$sel:name:AssetModelHierarchyDefinition' :: AssetModelHierarchyDefinition -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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
"childAssetModelId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
childAssetModelId)
]
)