{-# 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.AssetSummary 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 AssetSummary = AssetSummary'
{
AssetSummary -> Text
id :: Prelude.Text,
AssetSummary -> Text
arn :: Prelude.Text,
AssetSummary -> Text
name :: Prelude.Text,
AssetSummary -> Text
assetModelId :: Prelude.Text,
AssetSummary -> POSIX
creationDate :: Core.POSIX,
AssetSummary -> POSIX
lastUpdateDate :: Core.POSIX,
AssetSummary -> AssetStatus
status :: AssetStatus,
AssetSummary -> [AssetHierarchy]
hierarchies :: [AssetHierarchy]
}
deriving (AssetSummary -> AssetSummary -> Bool
(AssetSummary -> AssetSummary -> Bool)
-> (AssetSummary -> AssetSummary -> Bool) -> Eq AssetSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetSummary -> AssetSummary -> Bool
$c/= :: AssetSummary -> AssetSummary -> Bool
== :: AssetSummary -> AssetSummary -> Bool
$c== :: AssetSummary -> AssetSummary -> Bool
Prelude.Eq, ReadPrec [AssetSummary]
ReadPrec AssetSummary
Int -> ReadS AssetSummary
ReadS [AssetSummary]
(Int -> ReadS AssetSummary)
-> ReadS [AssetSummary]
-> ReadPrec AssetSummary
-> ReadPrec [AssetSummary]
-> Read AssetSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssetSummary]
$creadListPrec :: ReadPrec [AssetSummary]
readPrec :: ReadPrec AssetSummary
$creadPrec :: ReadPrec AssetSummary
readList :: ReadS [AssetSummary]
$creadList :: ReadS [AssetSummary]
readsPrec :: Int -> ReadS AssetSummary
$creadsPrec :: Int -> ReadS AssetSummary
Prelude.Read, Int -> AssetSummary -> ShowS
[AssetSummary] -> ShowS
AssetSummary -> String
(Int -> AssetSummary -> ShowS)
-> (AssetSummary -> String)
-> ([AssetSummary] -> ShowS)
-> Show AssetSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetSummary] -> ShowS
$cshowList :: [AssetSummary] -> ShowS
show :: AssetSummary -> String
$cshow :: AssetSummary -> String
showsPrec :: Int -> AssetSummary -> ShowS
$cshowsPrec :: Int -> AssetSummary -> ShowS
Prelude.Show, (forall x. AssetSummary -> Rep AssetSummary x)
-> (forall x. Rep AssetSummary x -> AssetSummary)
-> Generic AssetSummary
forall x. Rep AssetSummary x -> AssetSummary
forall x. AssetSummary -> Rep AssetSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetSummary x -> AssetSummary
$cfrom :: forall x. AssetSummary -> Rep AssetSummary x
Prelude.Generic)
newAssetSummary ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Prelude.UTCTime ->
AssetStatus ->
AssetSummary
newAssetSummary :: Text
-> Text
-> Text
-> Text
-> UTCTime
-> UTCTime
-> AssetStatus
-> AssetSummary
newAssetSummary
Text
pId_
Text
pArn_
Text
pName_
Text
pAssetModelId_
UTCTime
pCreationDate_
UTCTime
pLastUpdateDate_
AssetStatus
pStatus_ =
AssetSummary' :: Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssetSummary
AssetSummary'
{ $sel:id:AssetSummary' :: Text
id = Text
pId_,
$sel:arn:AssetSummary' :: Text
arn = Text
pArn_,
$sel:name:AssetSummary' :: Text
name = Text
pName_,
$sel:assetModelId:AssetSummary' :: Text
assetModelId = Text
pAssetModelId_,
$sel:creationDate:AssetSummary' :: 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:AssetSummary' :: 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:AssetSummary' :: AssetStatus
status = AssetStatus
pStatus_,
$sel:hierarchies:AssetSummary' :: [AssetHierarchy]
hierarchies = [AssetHierarchy]
forall a. Monoid a => a
Prelude.mempty
}
assetSummary_id :: Lens.Lens' AssetSummary Prelude.Text
assetSummary_id :: (Text -> f Text) -> AssetSummary -> f AssetSummary
assetSummary_id = (AssetSummary -> Text)
-> (AssetSummary -> Text -> AssetSummary)
-> Lens AssetSummary AssetSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetSummary' {Text
id :: Text
$sel:id:AssetSummary' :: AssetSummary -> Text
id} -> Text
id) (\s :: AssetSummary
s@AssetSummary' {} Text
a -> AssetSummary
s {$sel:id:AssetSummary' :: Text
id = Text
a} :: AssetSummary)
assetSummary_arn :: Lens.Lens' AssetSummary Prelude.Text
assetSummary_arn :: (Text -> f Text) -> AssetSummary -> f AssetSummary
assetSummary_arn = (AssetSummary -> Text)
-> (AssetSummary -> Text -> AssetSummary)
-> Lens AssetSummary AssetSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetSummary' {Text
arn :: Text
$sel:arn:AssetSummary' :: AssetSummary -> Text
arn} -> Text
arn) (\s :: AssetSummary
s@AssetSummary' {} Text
a -> AssetSummary
s {$sel:arn:AssetSummary' :: Text
arn = Text
a} :: AssetSummary)
assetSummary_name :: Lens.Lens' AssetSummary Prelude.Text
assetSummary_name :: (Text -> f Text) -> AssetSummary -> f AssetSummary
assetSummary_name = (AssetSummary -> Text)
-> (AssetSummary -> Text -> AssetSummary)
-> Lens AssetSummary AssetSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetSummary' {Text
name :: Text
$sel:name:AssetSummary' :: AssetSummary -> Text
name} -> Text
name) (\s :: AssetSummary
s@AssetSummary' {} Text
a -> AssetSummary
s {$sel:name:AssetSummary' :: Text
name = Text
a} :: AssetSummary)
assetSummary_assetModelId :: Lens.Lens' AssetSummary Prelude.Text
assetSummary_assetModelId :: (Text -> f Text) -> AssetSummary -> f AssetSummary
assetSummary_assetModelId = (AssetSummary -> Text)
-> (AssetSummary -> Text -> AssetSummary)
-> Lens AssetSummary AssetSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetSummary' {Text
assetModelId :: Text
$sel:assetModelId:AssetSummary' :: AssetSummary -> Text
assetModelId} -> Text
assetModelId) (\s :: AssetSummary
s@AssetSummary' {} Text
a -> AssetSummary
s {$sel:assetModelId:AssetSummary' :: Text
assetModelId = Text
a} :: AssetSummary)
assetSummary_creationDate :: Lens.Lens' AssetSummary Prelude.UTCTime
assetSummary_creationDate :: (UTCTime -> f UTCTime) -> AssetSummary -> f AssetSummary
assetSummary_creationDate = (AssetSummary -> POSIX)
-> (AssetSummary -> POSIX -> AssetSummary)
-> Lens AssetSummary AssetSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetSummary' {POSIX
creationDate :: POSIX
$sel:creationDate:AssetSummary' :: AssetSummary -> POSIX
creationDate} -> POSIX
creationDate) (\s :: AssetSummary
s@AssetSummary' {} POSIX
a -> AssetSummary
s {$sel:creationDate:AssetSummary' :: POSIX
creationDate = POSIX
a} :: AssetSummary) ((POSIX -> f POSIX) -> AssetSummary -> f AssetSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AssetSummary
-> f AssetSummary
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
assetSummary_lastUpdateDate :: Lens.Lens' AssetSummary Prelude.UTCTime
assetSummary_lastUpdateDate :: (UTCTime -> f UTCTime) -> AssetSummary -> f AssetSummary
assetSummary_lastUpdateDate = (AssetSummary -> POSIX)
-> (AssetSummary -> POSIX -> AssetSummary)
-> Lens AssetSummary AssetSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetSummary' {POSIX
lastUpdateDate :: POSIX
$sel:lastUpdateDate:AssetSummary' :: AssetSummary -> POSIX
lastUpdateDate} -> POSIX
lastUpdateDate) (\s :: AssetSummary
s@AssetSummary' {} POSIX
a -> AssetSummary
s {$sel:lastUpdateDate:AssetSummary' :: POSIX
lastUpdateDate = POSIX
a} :: AssetSummary) ((POSIX -> f POSIX) -> AssetSummary -> f AssetSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AssetSummary
-> f AssetSummary
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
assetSummary_status :: Lens.Lens' AssetSummary AssetStatus
assetSummary_status :: (AssetStatus -> f AssetStatus) -> AssetSummary -> f AssetSummary
assetSummary_status = (AssetSummary -> AssetStatus)
-> (AssetSummary -> AssetStatus -> AssetSummary)
-> Lens AssetSummary AssetSummary AssetStatus AssetStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetSummary' {AssetStatus
status :: AssetStatus
$sel:status:AssetSummary' :: AssetSummary -> AssetStatus
status} -> AssetStatus
status) (\s :: AssetSummary
s@AssetSummary' {} AssetStatus
a -> AssetSummary
s {$sel:status:AssetSummary' :: AssetStatus
status = AssetStatus
a} :: AssetSummary)
assetSummary_hierarchies :: Lens.Lens' AssetSummary [AssetHierarchy]
assetSummary_hierarchies :: ([AssetHierarchy] -> f [AssetHierarchy])
-> AssetSummary -> f AssetSummary
assetSummary_hierarchies = (AssetSummary -> [AssetHierarchy])
-> (AssetSummary -> [AssetHierarchy] -> AssetSummary)
-> Lens AssetSummary AssetSummary [AssetHierarchy] [AssetHierarchy]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetSummary' {[AssetHierarchy]
hierarchies :: [AssetHierarchy]
$sel:hierarchies:AssetSummary' :: AssetSummary -> [AssetHierarchy]
hierarchies} -> [AssetHierarchy]
hierarchies) (\s :: AssetSummary
s@AssetSummary' {} [AssetHierarchy]
a -> AssetSummary
s {$sel:hierarchies:AssetSummary' :: [AssetHierarchy]
hierarchies = [AssetHierarchy]
a} :: AssetSummary) (([AssetHierarchy] -> f [AssetHierarchy])
-> AssetSummary -> f AssetSummary)
-> (([AssetHierarchy] -> f [AssetHierarchy])
-> [AssetHierarchy] -> f [AssetHierarchy])
-> ([AssetHierarchy] -> f [AssetHierarchy])
-> AssetSummary
-> f AssetSummary
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 AssetSummary where
parseJSON :: Value -> Parser AssetSummary
parseJSON =
String
-> (Object -> Parser AssetSummary) -> Value -> Parser AssetSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AssetSummary"
( \Object
x ->
Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssetSummary
AssetSummary'
(Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssetSummary)
-> Parser Text
-> Parser
(Text
-> Text
-> Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssetSummary)
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]
-> AssetSummary)
-> Parser Text
-> Parser
(Text
-> Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssetSummary)
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]
-> AssetSummary)
-> Parser Text
-> Parser
(Text
-> POSIX
-> POSIX
-> AssetStatus
-> [AssetHierarchy]
-> AssetSummary)
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]
-> AssetSummary)
-> Parser Text
-> Parser
(POSIX -> POSIX -> AssetStatus -> [AssetHierarchy] -> AssetSummary)
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] -> AssetSummary)
-> Parser POSIX
-> Parser
(POSIX -> AssetStatus -> [AssetHierarchy] -> AssetSummary)
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] -> AssetSummary)
-> Parser POSIX
-> Parser (AssetStatus -> [AssetHierarchy] -> AssetSummary)
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] -> AssetSummary)
-> Parser AssetStatus -> Parser ([AssetHierarchy] -> AssetSummary)
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] -> AssetSummary)
-> Parser [AssetHierarchy] -> Parser AssetSummary
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 AssetSummary
instance Prelude.NFData AssetSummary