{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTSiteWise.Types.AssetHierarchyInfo
import Amazonka.IoTSiteWise.Types.AssetRelationshipType
import qualified Amazonka.Prelude as Prelude
data AssetRelationshipSummary = AssetRelationshipSummary'
{
AssetRelationshipSummary -> Maybe AssetHierarchyInfo
hierarchyInfo :: Prelude.Maybe AssetHierarchyInfo,
AssetRelationshipSummary -> AssetRelationshipType
relationshipType :: AssetRelationshipType
}
deriving (AssetRelationshipSummary -> AssetRelationshipSummary -> Bool
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]
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
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.
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'
{ $sel:hierarchyInfo:AssetRelationshipSummary' :: Maybe AssetHierarchyInfo
hierarchyInfo =
forall a. Maybe a
Prelude.Nothing,
$sel:relationshipType:AssetRelationshipSummary' :: AssetRelationshipType
relationshipType = AssetRelationshipType
pRelationshipType_
}
assetRelationshipSummary_hierarchyInfo :: Lens.Lens' AssetRelationshipSummary (Prelude.Maybe AssetHierarchyInfo)
assetRelationshipSummary_hierarchyInfo :: Lens' AssetRelationshipSummary (Maybe AssetHierarchyInfo)
assetRelationshipSummary_hierarchyInfo = 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 :: Lens' AssetRelationshipSummary AssetRelationshipType
assetRelationshipSummary_relationshipType = 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 Data.FromJSON AssetRelationshipSummary where
parseJSON :: Value -> Parser AssetRelationshipSummary
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AssetRelationshipSummary"
( \Object
x ->
Maybe AssetHierarchyInfo
-> AssetRelationshipType -> AssetRelationshipSummary
AssetRelationshipSummary'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"hierarchyInfo")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"relationshipType")
)
instance Prelude.Hashable AssetRelationshipSummary where
hashWithSalt :: Int -> AssetRelationshipSummary -> Int
hashWithSalt Int
_salt AssetRelationshipSummary' {Maybe AssetHierarchyInfo
AssetRelationshipType
relationshipType :: AssetRelationshipType
hierarchyInfo :: Maybe AssetHierarchyInfo
$sel:relationshipType:AssetRelationshipSummary' :: AssetRelationshipSummary -> AssetRelationshipType
$sel:hierarchyInfo:AssetRelationshipSummary' :: AssetRelationshipSummary -> Maybe AssetHierarchyInfo
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AssetHierarchyInfo
hierarchyInfo
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AssetRelationshipType
relationshipType
instance Prelude.NFData AssetRelationshipSummary where
rnf :: AssetRelationshipSummary -> ()
rnf AssetRelationshipSummary' {Maybe AssetHierarchyInfo
AssetRelationshipType
relationshipType :: AssetRelationshipType
hierarchyInfo :: Maybe AssetHierarchyInfo
$sel:relationshipType:AssetRelationshipSummary' :: AssetRelationshipSummary -> AssetRelationshipType
$sel:hierarchyInfo:AssetRelationshipSummary' :: AssetRelationshipSummary -> Maybe AssetHierarchyInfo
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AssetHierarchyInfo
hierarchyInfo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AssetRelationshipType
relationshipType