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