{-# 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.AssetHierarchyInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssetHierarchyInfo = AssetHierarchyInfo'
{
AssetHierarchyInfo -> Maybe Text
childAssetId :: Prelude.Maybe Prelude.Text,
AssetHierarchyInfo -> Maybe Text
parentAssetId :: Prelude.Maybe Prelude.Text
}
deriving (AssetHierarchyInfo -> AssetHierarchyInfo -> Bool
(AssetHierarchyInfo -> AssetHierarchyInfo -> Bool)
-> (AssetHierarchyInfo -> AssetHierarchyInfo -> Bool)
-> Eq AssetHierarchyInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetHierarchyInfo -> AssetHierarchyInfo -> Bool
$c/= :: AssetHierarchyInfo -> AssetHierarchyInfo -> Bool
== :: AssetHierarchyInfo -> AssetHierarchyInfo -> Bool
$c== :: AssetHierarchyInfo -> AssetHierarchyInfo -> Bool
Prelude.Eq, ReadPrec [AssetHierarchyInfo]
ReadPrec AssetHierarchyInfo
Int -> ReadS AssetHierarchyInfo
ReadS [AssetHierarchyInfo]
(Int -> ReadS AssetHierarchyInfo)
-> ReadS [AssetHierarchyInfo]
-> ReadPrec AssetHierarchyInfo
-> ReadPrec [AssetHierarchyInfo]
-> Read AssetHierarchyInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssetHierarchyInfo]
$creadListPrec :: ReadPrec [AssetHierarchyInfo]
readPrec :: ReadPrec AssetHierarchyInfo
$creadPrec :: ReadPrec AssetHierarchyInfo
readList :: ReadS [AssetHierarchyInfo]
$creadList :: ReadS [AssetHierarchyInfo]
readsPrec :: Int -> ReadS AssetHierarchyInfo
$creadsPrec :: Int -> ReadS AssetHierarchyInfo
Prelude.Read, Int -> AssetHierarchyInfo -> ShowS
[AssetHierarchyInfo] -> ShowS
AssetHierarchyInfo -> String
(Int -> AssetHierarchyInfo -> ShowS)
-> (AssetHierarchyInfo -> String)
-> ([AssetHierarchyInfo] -> ShowS)
-> Show AssetHierarchyInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetHierarchyInfo] -> ShowS
$cshowList :: [AssetHierarchyInfo] -> ShowS
show :: AssetHierarchyInfo -> String
$cshow :: AssetHierarchyInfo -> String
showsPrec :: Int -> AssetHierarchyInfo -> ShowS
$cshowsPrec :: Int -> AssetHierarchyInfo -> ShowS
Prelude.Show, (forall x. AssetHierarchyInfo -> Rep AssetHierarchyInfo x)
-> (forall x. Rep AssetHierarchyInfo x -> AssetHierarchyInfo)
-> Generic AssetHierarchyInfo
forall x. Rep AssetHierarchyInfo x -> AssetHierarchyInfo
forall x. AssetHierarchyInfo -> Rep AssetHierarchyInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetHierarchyInfo x -> AssetHierarchyInfo
$cfrom :: forall x. AssetHierarchyInfo -> Rep AssetHierarchyInfo x
Prelude.Generic)
newAssetHierarchyInfo ::
AssetHierarchyInfo
newAssetHierarchyInfo :: AssetHierarchyInfo
newAssetHierarchyInfo =
AssetHierarchyInfo' :: Maybe Text -> Maybe Text -> AssetHierarchyInfo
AssetHierarchyInfo'
{ $sel:childAssetId:AssetHierarchyInfo' :: Maybe Text
childAssetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parentAssetId:AssetHierarchyInfo' :: Maybe Text
parentAssetId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
assetHierarchyInfo_childAssetId :: Lens.Lens' AssetHierarchyInfo (Prelude.Maybe Prelude.Text)
assetHierarchyInfo_childAssetId :: (Maybe Text -> f (Maybe Text))
-> AssetHierarchyInfo -> f AssetHierarchyInfo
assetHierarchyInfo_childAssetId = (AssetHierarchyInfo -> Maybe Text)
-> (AssetHierarchyInfo -> Maybe Text -> AssetHierarchyInfo)
-> Lens
AssetHierarchyInfo AssetHierarchyInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetHierarchyInfo' {Maybe Text
childAssetId :: Maybe Text
$sel:childAssetId:AssetHierarchyInfo' :: AssetHierarchyInfo -> Maybe Text
childAssetId} -> Maybe Text
childAssetId) (\s :: AssetHierarchyInfo
s@AssetHierarchyInfo' {} Maybe Text
a -> AssetHierarchyInfo
s {$sel:childAssetId:AssetHierarchyInfo' :: Maybe Text
childAssetId = Maybe Text
a} :: AssetHierarchyInfo)
assetHierarchyInfo_parentAssetId :: Lens.Lens' AssetHierarchyInfo (Prelude.Maybe Prelude.Text)
assetHierarchyInfo_parentAssetId :: (Maybe Text -> f (Maybe Text))
-> AssetHierarchyInfo -> f AssetHierarchyInfo
assetHierarchyInfo_parentAssetId = (AssetHierarchyInfo -> Maybe Text)
-> (AssetHierarchyInfo -> Maybe Text -> AssetHierarchyInfo)
-> Lens
AssetHierarchyInfo AssetHierarchyInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetHierarchyInfo' {Maybe Text
parentAssetId :: Maybe Text
$sel:parentAssetId:AssetHierarchyInfo' :: AssetHierarchyInfo -> Maybe Text
parentAssetId} -> Maybe Text
parentAssetId) (\s :: AssetHierarchyInfo
s@AssetHierarchyInfo' {} Maybe Text
a -> AssetHierarchyInfo
s {$sel:parentAssetId:AssetHierarchyInfo' :: Maybe Text
parentAssetId = Maybe Text
a} :: AssetHierarchyInfo)
instance Core.FromJSON AssetHierarchyInfo where
parseJSON :: Value -> Parser AssetHierarchyInfo
parseJSON =
String
-> (Object -> Parser AssetHierarchyInfo)
-> Value
-> Parser AssetHierarchyInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AssetHierarchyInfo"
( \Object
x ->
Maybe Text -> Maybe Text -> AssetHierarchyInfo
AssetHierarchyInfo'
(Maybe Text -> Maybe Text -> AssetHierarchyInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AssetHierarchyInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"childAssetId")
Parser (Maybe Text -> AssetHierarchyInfo)
-> Parser (Maybe Text) -> Parser AssetHierarchyInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"parentAssetId")
)
instance Prelude.Hashable AssetHierarchyInfo
instance Prelude.NFData AssetHierarchyInfo