{-# 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.AssociatedAssetsSummary where
import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.Types.AssetHierarchy
import Amazonka.IoTSiteWise.Types.AssetStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssociatedAssetsSummary = AssociatedAssetsSummary'
{
AssociatedAssetsSummary -> Text
id :: Prelude.Text,
AssociatedAssetsSummary -> Text
arn :: Prelude.Text,
AssociatedAssetsSummary -> Text
name :: Prelude.Text,
AssociatedAssetsSummary -> Text
assetModelId :: Prelude.Text,
AssociatedAssetsSummary -> POSIX
creationDate :: Core.POSIX,
AssociatedAssetsSummary -> POSIX
lastUpdateDate :: Core.POSIX,
AssociatedAssetsSummary -> AssetStatus
status :: AssetStatus,
AssociatedAssetsSummary -> [AssetHierarchy]
hierarchies :: [AssetHierarchy]
}
deriving (AssociatedAssetsSummary -> AssociatedAssetsSummary -> Bool
(AssociatedAssetsSummary -> AssociatedAssetsSummary -> Bool)
-> (AssociatedAssetsSummary -> AssociatedAssetsSummary -> Bool)
-> Eq AssociatedAssetsSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociatedAssetsSummary -> AssociatedAssetsSummary -> Bool
$c/= :: AssociatedAssetsSummary -> AssociatedAssetsSummary -> Bool
== :: AssociatedAssetsSummary -> AssociatedAssetsSummary -> Bool
$c== :: AssociatedAssetsSummary -> AssociatedAssetsSummary -> Bool
Prelude.Eq, ReadPrec [AssociatedAssetsSummary]
ReadPrec AssociatedAssetsSummary
Int -> ReadS AssociatedAssetsSummary
ReadS [AssociatedAssetsSummary]
(Int -> ReadS AssociatedAssetsSummary)
-> ReadS [AssociatedAssetsSummary]
-> ReadPrec AssociatedAssetsSummary
-> ReadPrec [AssociatedAssetsSummary]
-> Read AssociatedAssetsSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociatedAssetsSummary]
$creadListPrec :: ReadPrec [AssociatedAssetsSummary]
readPrec :: ReadPrec AssociatedAssetsSummary
$creadPrec :: ReadPrec AssociatedAssetsSummary
readList :: ReadS [AssociatedAssetsSummary]
$creadList :: ReadS [AssociatedAssetsSummary]
readsPrec :: Int -> ReadS AssociatedAssetsSummary
$creadsPrec :: Int -> ReadS AssociatedAssetsSummary
Prelude.Read, Int -> AssociatedAssetsSummary -> ShowS
[AssociatedAssetsSummary] -> ShowS
AssociatedAssetsSummary -> String
(Int -> AssociatedAssetsSummary -> ShowS)
-> (AssociatedAssetsSummary -> String)
-> ([AssociatedAssetsSummary] -> ShowS)
-> Show AssociatedAssetsSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociatedAssetsSummary] -> ShowS
$cshowList :: [AssociatedAssetsSummary] -> ShowS
show :: AssociatedAssetsSummary -> String
$cshow :: AssociatedAssetsSummary -> String
showsPrec :: Int -> AssociatedAssetsSummary -> ShowS
$cshowsPrec :: Int -> AssociatedAssetsSummary -> ShowS
Prelude.Show, (forall x.
AssociatedAssetsSummary -> Rep AssociatedAssetsSummary x)
-> (forall x.
Rep AssociatedAssetsSummary x -> AssociatedAssetsSummary)
-> Generic AssociatedAssetsSummary
forall x. Rep AssociatedAssetsSummary x -> AssociatedAssetsSummary
forall x. AssociatedAssetsSummary -> Rep AssociatedAssetsSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssociatedAssetsSummary x -> AssociatedAssetsSummary
$cfrom :: forall x. AssociatedAssetsSummary -> Rep AssociatedAssetsSummary x
Prelude.Generic)
newAssociatedAssetsSummary ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Prelude.UTCTime ->
AssetStatus ->
AssociatedAssetsSummary
newAssociatedAssetsSummary :: Text
-> Text
-> Text
-> Text
-> UTCTime
-> UTCTime
-> AssetStatus
-> AssociatedAssetsSummary
newAssociatedAssetsSummary
Text
pId_
Text
pArn_
Text
pName_
Text
pAssetModelId_
UTCTime
pCreationDate_
UTCTime
pLastUpdateDate_
AssetStatus
pStatus_ =
AssociatedAssetsSummary' :: Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssociatedAssetsSummary
AssociatedAssetsSummary'
{ $sel:id:AssociatedAssetsSummary' :: Text
id = Text
pId_,
$sel:arn:AssociatedAssetsSummary' :: Text
arn = Text
pArn_,
$sel:name:AssociatedAssetsSummary' :: Text
name = Text
pName_,
$sel:assetModelId:AssociatedAssetsSummary' :: Text
assetModelId = Text
pAssetModelId_,
$sel:creationDate:AssociatedAssetsSummary' :: POSIX
creationDate = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationDate_,
$sel:lastUpdateDate:AssociatedAssetsSummary' :: POSIX
lastUpdateDate =
Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastUpdateDate_,
$sel:status:AssociatedAssetsSummary' :: AssetStatus
status = AssetStatus
pStatus_,
$sel:hierarchies:AssociatedAssetsSummary' :: [AssetHierarchy]
hierarchies = [AssetHierarchy]
forall a. Monoid a => a
Prelude.mempty
}
associatedAssetsSummary_id :: Lens.Lens' AssociatedAssetsSummary Prelude.Text
associatedAssetsSummary_id :: (Text -> f Text)
-> AssociatedAssetsSummary -> f AssociatedAssetsSummary
associatedAssetsSummary_id = (AssociatedAssetsSummary -> Text)
-> (AssociatedAssetsSummary -> Text -> AssociatedAssetsSummary)
-> Lens AssociatedAssetsSummary AssociatedAssetsSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatedAssetsSummary' {Text
id :: Text
$sel:id:AssociatedAssetsSummary' :: AssociatedAssetsSummary -> Text
id} -> Text
id) (\s :: AssociatedAssetsSummary
s@AssociatedAssetsSummary' {} Text
a -> AssociatedAssetsSummary
s {$sel:id:AssociatedAssetsSummary' :: Text
id = Text
a} :: AssociatedAssetsSummary)
associatedAssetsSummary_arn :: Lens.Lens' AssociatedAssetsSummary Prelude.Text
associatedAssetsSummary_arn :: (Text -> f Text)
-> AssociatedAssetsSummary -> f AssociatedAssetsSummary
associatedAssetsSummary_arn = (AssociatedAssetsSummary -> Text)
-> (AssociatedAssetsSummary -> Text -> AssociatedAssetsSummary)
-> Lens AssociatedAssetsSummary AssociatedAssetsSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatedAssetsSummary' {Text
arn :: Text
$sel:arn:AssociatedAssetsSummary' :: AssociatedAssetsSummary -> Text
arn} -> Text
arn) (\s :: AssociatedAssetsSummary
s@AssociatedAssetsSummary' {} Text
a -> AssociatedAssetsSummary
s {$sel:arn:AssociatedAssetsSummary' :: Text
arn = Text
a} :: AssociatedAssetsSummary)
associatedAssetsSummary_name :: Lens.Lens' AssociatedAssetsSummary Prelude.Text
associatedAssetsSummary_name :: (Text -> f Text)
-> AssociatedAssetsSummary -> f AssociatedAssetsSummary
associatedAssetsSummary_name = (AssociatedAssetsSummary -> Text)
-> (AssociatedAssetsSummary -> Text -> AssociatedAssetsSummary)
-> Lens AssociatedAssetsSummary AssociatedAssetsSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatedAssetsSummary' {Text
name :: Text
$sel:name:AssociatedAssetsSummary' :: AssociatedAssetsSummary -> Text
name} -> Text
name) (\s :: AssociatedAssetsSummary
s@AssociatedAssetsSummary' {} Text
a -> AssociatedAssetsSummary
s {$sel:name:AssociatedAssetsSummary' :: Text
name = Text
a} :: AssociatedAssetsSummary)
associatedAssetsSummary_assetModelId :: Lens.Lens' AssociatedAssetsSummary Prelude.Text
associatedAssetsSummary_assetModelId :: (Text -> f Text)
-> AssociatedAssetsSummary -> f AssociatedAssetsSummary
associatedAssetsSummary_assetModelId = (AssociatedAssetsSummary -> Text)
-> (AssociatedAssetsSummary -> Text -> AssociatedAssetsSummary)
-> Lens AssociatedAssetsSummary AssociatedAssetsSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatedAssetsSummary' {Text
assetModelId :: Text
$sel:assetModelId:AssociatedAssetsSummary' :: AssociatedAssetsSummary -> Text
assetModelId} -> Text
assetModelId) (\s :: AssociatedAssetsSummary
s@AssociatedAssetsSummary' {} Text
a -> AssociatedAssetsSummary
s {$sel:assetModelId:AssociatedAssetsSummary' :: Text
assetModelId = Text
a} :: AssociatedAssetsSummary)
associatedAssetsSummary_creationDate :: Lens.Lens' AssociatedAssetsSummary Prelude.UTCTime
associatedAssetsSummary_creationDate :: (UTCTime -> f UTCTime)
-> AssociatedAssetsSummary -> f AssociatedAssetsSummary
associatedAssetsSummary_creationDate = (AssociatedAssetsSummary -> POSIX)
-> (AssociatedAssetsSummary -> POSIX -> AssociatedAssetsSummary)
-> Lens AssociatedAssetsSummary AssociatedAssetsSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatedAssetsSummary' {POSIX
creationDate :: POSIX
$sel:creationDate:AssociatedAssetsSummary' :: AssociatedAssetsSummary -> POSIX
creationDate} -> POSIX
creationDate) (\s :: AssociatedAssetsSummary
s@AssociatedAssetsSummary' {} POSIX
a -> AssociatedAssetsSummary
s {$sel:creationDate:AssociatedAssetsSummary' :: POSIX
creationDate = POSIX
a} :: AssociatedAssetsSummary) ((POSIX -> f POSIX)
-> AssociatedAssetsSummary -> f AssociatedAssetsSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AssociatedAssetsSummary
-> f AssociatedAssetsSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
associatedAssetsSummary_lastUpdateDate :: Lens.Lens' AssociatedAssetsSummary Prelude.UTCTime
associatedAssetsSummary_lastUpdateDate :: (UTCTime -> f UTCTime)
-> AssociatedAssetsSummary -> f AssociatedAssetsSummary
associatedAssetsSummary_lastUpdateDate = (AssociatedAssetsSummary -> POSIX)
-> (AssociatedAssetsSummary -> POSIX -> AssociatedAssetsSummary)
-> Lens AssociatedAssetsSummary AssociatedAssetsSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatedAssetsSummary' {POSIX
lastUpdateDate :: POSIX
$sel:lastUpdateDate:AssociatedAssetsSummary' :: AssociatedAssetsSummary -> POSIX
lastUpdateDate} -> POSIX
lastUpdateDate) (\s :: AssociatedAssetsSummary
s@AssociatedAssetsSummary' {} POSIX
a -> AssociatedAssetsSummary
s {$sel:lastUpdateDate:AssociatedAssetsSummary' :: POSIX
lastUpdateDate = POSIX
a} :: AssociatedAssetsSummary) ((POSIX -> f POSIX)
-> AssociatedAssetsSummary -> f AssociatedAssetsSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AssociatedAssetsSummary
-> f AssociatedAssetsSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
associatedAssetsSummary_status :: Lens.Lens' AssociatedAssetsSummary AssetStatus
associatedAssetsSummary_status :: (AssetStatus -> f AssetStatus)
-> AssociatedAssetsSummary -> f AssociatedAssetsSummary
associatedAssetsSummary_status = (AssociatedAssetsSummary -> AssetStatus)
-> (AssociatedAssetsSummary
-> AssetStatus -> AssociatedAssetsSummary)
-> Lens
AssociatedAssetsSummary
AssociatedAssetsSummary
AssetStatus
AssetStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatedAssetsSummary' {AssetStatus
status :: AssetStatus
$sel:status:AssociatedAssetsSummary' :: AssociatedAssetsSummary -> AssetStatus
status} -> AssetStatus
status) (\s :: AssociatedAssetsSummary
s@AssociatedAssetsSummary' {} AssetStatus
a -> AssociatedAssetsSummary
s {$sel:status:AssociatedAssetsSummary' :: AssetStatus
status = AssetStatus
a} :: AssociatedAssetsSummary)
associatedAssetsSummary_hierarchies :: Lens.Lens' AssociatedAssetsSummary [AssetHierarchy]
associatedAssetsSummary_hierarchies :: ([AssetHierarchy] -> f [AssetHierarchy])
-> AssociatedAssetsSummary -> f AssociatedAssetsSummary
associatedAssetsSummary_hierarchies = (AssociatedAssetsSummary -> [AssetHierarchy])
-> (AssociatedAssetsSummary
-> [AssetHierarchy] -> AssociatedAssetsSummary)
-> Lens
AssociatedAssetsSummary
AssociatedAssetsSummary
[AssetHierarchy]
[AssetHierarchy]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatedAssetsSummary' {[AssetHierarchy]
hierarchies :: [AssetHierarchy]
$sel:hierarchies:AssociatedAssetsSummary' :: AssociatedAssetsSummary -> [AssetHierarchy]
hierarchies} -> [AssetHierarchy]
hierarchies) (\s :: AssociatedAssetsSummary
s@AssociatedAssetsSummary' {} [AssetHierarchy]
a -> AssociatedAssetsSummary
s {$sel:hierarchies:AssociatedAssetsSummary' :: [AssetHierarchy]
hierarchies = [AssetHierarchy]
a} :: AssociatedAssetsSummary) (([AssetHierarchy] -> f [AssetHierarchy])
-> AssociatedAssetsSummary -> f AssociatedAssetsSummary)
-> (([AssetHierarchy] -> f [AssetHierarchy])
-> [AssetHierarchy] -> f [AssetHierarchy])
-> ([AssetHierarchy] -> f [AssetHierarchy])
-> AssociatedAssetsSummary
-> f AssociatedAssetsSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AssetHierarchy] -> f [AssetHierarchy])
-> [AssetHierarchy] -> f [AssetHierarchy]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON AssociatedAssetsSummary where
parseJSON :: Value -> Parser AssociatedAssetsSummary
parseJSON =
String
-> (Object -> Parser AssociatedAssetsSummary)
-> Value
-> Parser AssociatedAssetsSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AssociatedAssetsSummary"
( \Object
x ->
Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssociatedAssetsSummary
AssociatedAssetsSummary'
(Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssociatedAssetsSummary)
-> Parser Text
-> Parser
(Text
-> Text
-> Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssociatedAssetsSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"id")
Parser
(Text
-> Text
-> Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssociatedAssetsSummary)
-> Parser Text
-> Parser
(Text
-> Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssociatedAssetsSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"arn")
Parser
(Text
-> Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssociatedAssetsSummary)
-> Parser Text
-> Parser
(Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssociatedAssetsSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
Parser
(Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssociatedAssetsSummary)
-> Parser Text
-> Parser
(POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssociatedAssetsSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"assetModelId")
Parser
(POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssociatedAssetsSummary)
-> Parser POSIX
-> Parser
(POSIX
-> AssetStatus -> [AssetHierarchy] -> AssociatedAssetsSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"creationDate")
Parser
(POSIX
-> AssetStatus -> [AssetHierarchy] -> AssociatedAssetsSummary)
-> Parser POSIX
-> Parser
(AssetStatus -> [AssetHierarchy] -> AssociatedAssetsSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"lastUpdateDate")
Parser (AssetStatus -> [AssetHierarchy] -> AssociatedAssetsSummary)
-> Parser AssetStatus
-> Parser ([AssetHierarchy] -> AssociatedAssetsSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AssetStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
Parser ([AssetHierarchy] -> AssociatedAssetsSummary)
-> Parser [AssetHierarchy] -> Parser AssociatedAssetsSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [AssetHierarchy])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hierarchies" Parser (Maybe [AssetHierarchy])
-> [AssetHierarchy] -> Parser [AssetHierarchy]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [AssetHierarchy]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable AssociatedAssetsSummary
instance Prelude.NFData AssociatedAssetsSummary