{-# 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.Panorama.Types.Node where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Panorama.Types.NodeCategory
import qualified Amazonka.Prelude as Prelude
data Node = Node'
{
Node -> Maybe Text
packageArn :: Prelude.Maybe Prelude.Text,
Node -> Maybe Text
ownerAccount :: Prelude.Maybe Prelude.Text,
Node -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
Node -> Text
nodeId :: Prelude.Text,
Node -> Text
name :: Prelude.Text,
Node -> NodeCategory
category :: NodeCategory,
Node -> Text
packageName :: Prelude.Text,
Node -> Text
packageId :: Prelude.Text,
Node -> Text
packageVersion :: Prelude.Text,
Node -> Text
patchVersion :: Prelude.Text,
Node -> POSIX
createdTime :: Core.POSIX
}
deriving (Node -> Node -> Bool
(Node -> Node -> Bool) -> (Node -> Node -> Bool) -> Eq Node
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Node -> Node -> Bool
$c/= :: Node -> Node -> Bool
== :: Node -> Node -> Bool
$c== :: Node -> Node -> Bool
Prelude.Eq, ReadPrec [Node]
ReadPrec Node
Int -> ReadS Node
ReadS [Node]
(Int -> ReadS Node)
-> ReadS [Node] -> ReadPrec Node -> ReadPrec [Node] -> Read Node
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Node]
$creadListPrec :: ReadPrec [Node]
readPrec :: ReadPrec Node
$creadPrec :: ReadPrec Node
readList :: ReadS [Node]
$creadList :: ReadS [Node]
readsPrec :: Int -> ReadS Node
$creadsPrec :: Int -> ReadS Node
Prelude.Read, Int -> Node -> ShowS
[Node] -> ShowS
Node -> String
(Int -> Node -> ShowS)
-> (Node -> String) -> ([Node] -> ShowS) -> Show Node
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Node] -> ShowS
$cshowList :: [Node] -> ShowS
show :: Node -> String
$cshow :: Node -> String
showsPrec :: Int -> Node -> ShowS
$cshowsPrec :: Int -> Node -> ShowS
Prelude.Show, (forall x. Node -> Rep Node x)
-> (forall x. Rep Node x -> Node) -> Generic Node
forall x. Rep Node x -> Node
forall x. Node -> Rep Node x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Node x -> Node
$cfrom :: forall x. Node -> Rep Node x
Prelude.Generic)
newNode ::
Prelude.Text ->
Prelude.Text ->
NodeCategory ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Node
newNode :: Text
-> Text
-> NodeCategory
-> Text
-> Text
-> Text
-> Text
-> UTCTime
-> Node
newNode
Text
pNodeId_
Text
pName_
NodeCategory
pCategory_
Text
pPackageName_
Text
pPackageId_
Text
pPackageVersion_
Text
pPatchVersion_
UTCTime
pCreatedTime_ =
Node' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> NodeCategory
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> Node
Node'
{ $sel:packageArn:Node' :: Maybe Text
packageArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ownerAccount:Node' :: Maybe Text
ownerAccount = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:Node' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nodeId:Node' :: Text
nodeId = Text
pNodeId_,
$sel:name:Node' :: Text
name = Text
pName_,
$sel:category:Node' :: NodeCategory
category = NodeCategory
pCategory_,
$sel:packageName:Node' :: Text
packageName = Text
pPackageName_,
$sel:packageId:Node' :: Text
packageId = Text
pPackageId_,
$sel:packageVersion:Node' :: Text
packageVersion = Text
pPackageVersion_,
$sel:patchVersion:Node' :: Text
patchVersion = Text
pPatchVersion_,
$sel:createdTime:Node' :: POSIX
createdTime = 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
pCreatedTime_
}
node_packageArn :: Lens.Lens' Node (Prelude.Maybe Prelude.Text)
node_packageArn :: (Maybe Text -> f (Maybe Text)) -> Node -> f Node
node_packageArn = (Node -> Maybe Text)
-> (Node -> Maybe Text -> Node)
-> Lens Node Node (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe Text
packageArn :: Maybe Text
$sel:packageArn:Node' :: Node -> Maybe Text
packageArn} -> Maybe Text
packageArn) (\s :: Node
s@Node' {} Maybe Text
a -> Node
s {$sel:packageArn:Node' :: Maybe Text
packageArn = Maybe Text
a} :: Node)
node_ownerAccount :: Lens.Lens' Node (Prelude.Maybe Prelude.Text)
node_ownerAccount :: (Maybe Text -> f (Maybe Text)) -> Node -> f Node
node_ownerAccount = (Node -> Maybe Text)
-> (Node -> Maybe Text -> Node)
-> Lens Node Node (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe Text
ownerAccount :: Maybe Text
$sel:ownerAccount:Node' :: Node -> Maybe Text
ownerAccount} -> Maybe Text
ownerAccount) (\s :: Node
s@Node' {} Maybe Text
a -> Node
s {$sel:ownerAccount:Node' :: Maybe Text
ownerAccount = Maybe Text
a} :: Node)
node_description :: Lens.Lens' Node (Prelude.Maybe Prelude.Text)
node_description :: (Maybe Text -> f (Maybe Text)) -> Node -> f Node
node_description = (Node -> Maybe Text)
-> (Node -> Maybe Text -> Node)
-> Lens Node Node (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe Text
description :: Maybe Text
$sel:description:Node' :: Node -> Maybe Text
description} -> Maybe Text
description) (\s :: Node
s@Node' {} Maybe Text
a -> Node
s {$sel:description:Node' :: Maybe Text
description = Maybe Text
a} :: Node)
node_nodeId :: Lens.Lens' Node Prelude.Text
node_nodeId :: (Text -> f Text) -> Node -> f Node
node_nodeId = (Node -> Text)
-> (Node -> Text -> Node) -> Lens Node Node Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Text
nodeId :: Text
$sel:nodeId:Node' :: Node -> Text
nodeId} -> Text
nodeId) (\s :: Node
s@Node' {} Text
a -> Node
s {$sel:nodeId:Node' :: Text
nodeId = Text
a} :: Node)
node_name :: Lens.Lens' Node Prelude.Text
node_name :: (Text -> f Text) -> Node -> f Node
node_name = (Node -> Text)
-> (Node -> Text -> Node) -> Lens Node Node Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Text
name :: Text
$sel:name:Node' :: Node -> Text
name} -> Text
name) (\s :: Node
s@Node' {} Text
a -> Node
s {$sel:name:Node' :: Text
name = Text
a} :: Node)
node_category :: Lens.Lens' Node NodeCategory
node_category :: (NodeCategory -> f NodeCategory) -> Node -> f Node
node_category = (Node -> NodeCategory)
-> (Node -> NodeCategory -> Node)
-> Lens Node Node NodeCategory NodeCategory
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {NodeCategory
category :: NodeCategory
$sel:category:Node' :: Node -> NodeCategory
category} -> NodeCategory
category) (\s :: Node
s@Node' {} NodeCategory
a -> Node
s {$sel:category:Node' :: NodeCategory
category = NodeCategory
a} :: Node)
node_packageName :: Lens.Lens' Node Prelude.Text
node_packageName :: (Text -> f Text) -> Node -> f Node
node_packageName = (Node -> Text)
-> (Node -> Text -> Node) -> Lens Node Node Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Text
packageName :: Text
$sel:packageName:Node' :: Node -> Text
packageName} -> Text
packageName) (\s :: Node
s@Node' {} Text
a -> Node
s {$sel:packageName:Node' :: Text
packageName = Text
a} :: Node)
node_packageId :: Lens.Lens' Node Prelude.Text
node_packageId :: (Text -> f Text) -> Node -> f Node
node_packageId = (Node -> Text)
-> (Node -> Text -> Node) -> Lens Node Node Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Text
packageId :: Text
$sel:packageId:Node' :: Node -> Text
packageId} -> Text
packageId) (\s :: Node
s@Node' {} Text
a -> Node
s {$sel:packageId:Node' :: Text
packageId = Text
a} :: Node)
node_packageVersion :: Lens.Lens' Node Prelude.Text
node_packageVersion :: (Text -> f Text) -> Node -> f Node
node_packageVersion = (Node -> Text)
-> (Node -> Text -> Node) -> Lens Node Node Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Text
packageVersion :: Text
$sel:packageVersion:Node' :: Node -> Text
packageVersion} -> Text
packageVersion) (\s :: Node
s@Node' {} Text
a -> Node
s {$sel:packageVersion:Node' :: Text
packageVersion = Text
a} :: Node)
node_patchVersion :: Lens.Lens' Node Prelude.Text
node_patchVersion :: (Text -> f Text) -> Node -> f Node
node_patchVersion = (Node -> Text)
-> (Node -> Text -> Node) -> Lens Node Node Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Text
patchVersion :: Text
$sel:patchVersion:Node' :: Node -> Text
patchVersion} -> Text
patchVersion) (\s :: Node
s@Node' {} Text
a -> Node
s {$sel:patchVersion:Node' :: Text
patchVersion = Text
a} :: Node)
node_createdTime :: Lens.Lens' Node Prelude.UTCTime
node_createdTime :: (UTCTime -> f UTCTime) -> Node -> f Node
node_createdTime = (Node -> POSIX)
-> (Node -> POSIX -> Node) -> Lens Node Node POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {POSIX
createdTime :: POSIX
$sel:createdTime:Node' :: Node -> POSIX
createdTime} -> POSIX
createdTime) (\s :: Node
s@Node' {} POSIX
a -> Node
s {$sel:createdTime:Node' :: POSIX
createdTime = POSIX
a} :: Node) ((POSIX -> f POSIX) -> Node -> f Node)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Node
-> f Node
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
instance Core.FromJSON Node where
parseJSON :: Value -> Parser Node
parseJSON =
String -> (Object -> Parser Node) -> Value -> Parser Node
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Node"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> NodeCategory
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> Node
Node'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> NodeCategory
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> Node)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Text
-> Text
-> NodeCategory
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> Node)
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
"PackageArn")
Parser
(Maybe Text
-> Maybe Text
-> Text
-> Text
-> NodeCategory
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> Node)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Text
-> Text
-> NodeCategory
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> Node)
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
"OwnerAccount")
Parser
(Maybe Text
-> Text
-> Text
-> NodeCategory
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> Node)
-> Parser (Maybe Text)
-> Parser
(Text
-> Text
-> NodeCategory
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> Node)
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
"Description")
Parser
(Text
-> Text
-> NodeCategory
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> Node)
-> Parser Text
-> Parser
(Text
-> NodeCategory -> Text -> Text -> Text -> Text -> POSIX -> Node)
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
"NodeId")
Parser
(Text
-> NodeCategory -> Text -> Text -> Text -> Text -> POSIX -> Node)
-> Parser Text
-> Parser
(NodeCategory -> Text -> Text -> Text -> Text -> POSIX -> Node)
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
(NodeCategory -> Text -> Text -> Text -> Text -> POSIX -> Node)
-> Parser NodeCategory
-> Parser (Text -> Text -> Text -> Text -> POSIX -> Node)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser NodeCategory
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Category")
Parser (Text -> Text -> Text -> Text -> POSIX -> Node)
-> Parser Text -> Parser (Text -> Text -> Text -> POSIX -> Node)
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
"PackageName")
Parser (Text -> Text -> Text -> POSIX -> Node)
-> Parser Text -> Parser (Text -> Text -> POSIX -> Node)
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
"PackageId")
Parser (Text -> Text -> POSIX -> Node)
-> Parser Text -> Parser (Text -> POSIX -> Node)
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
"PackageVersion")
Parser (Text -> POSIX -> Node)
-> Parser Text -> Parser (POSIX -> Node)
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
"PatchVersion")
Parser (POSIX -> Node) -> Parser POSIX -> Parser Node
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
"CreatedTime")
)
instance Prelude.Hashable Node
instance Prelude.NFData Node