{-# 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.ManagedBlockChain.Types.NodeSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.ManagedBlockChain.Types.NodeStatus
import qualified Amazonka.Prelude as Prelude
data NodeSummary = NodeSummary'
{
NodeSummary -> Maybe NodeStatus
status :: Prelude.Maybe NodeStatus,
NodeSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
NodeSummary -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
NodeSummary -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
NodeSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
NodeSummary -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX
}
deriving (NodeSummary -> NodeSummary -> Bool
(NodeSummary -> NodeSummary -> Bool)
-> (NodeSummary -> NodeSummary -> Bool) -> Eq NodeSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NodeSummary -> NodeSummary -> Bool
$c/= :: NodeSummary -> NodeSummary -> Bool
== :: NodeSummary -> NodeSummary -> Bool
$c== :: NodeSummary -> NodeSummary -> Bool
Prelude.Eq, ReadPrec [NodeSummary]
ReadPrec NodeSummary
Int -> ReadS NodeSummary
ReadS [NodeSummary]
(Int -> ReadS NodeSummary)
-> ReadS [NodeSummary]
-> ReadPrec NodeSummary
-> ReadPrec [NodeSummary]
-> Read NodeSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NodeSummary]
$creadListPrec :: ReadPrec [NodeSummary]
readPrec :: ReadPrec NodeSummary
$creadPrec :: ReadPrec NodeSummary
readList :: ReadS [NodeSummary]
$creadList :: ReadS [NodeSummary]
readsPrec :: Int -> ReadS NodeSummary
$creadsPrec :: Int -> ReadS NodeSummary
Prelude.Read, Int -> NodeSummary -> ShowS
[NodeSummary] -> ShowS
NodeSummary -> String
(Int -> NodeSummary -> ShowS)
-> (NodeSummary -> String)
-> ([NodeSummary] -> ShowS)
-> Show NodeSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NodeSummary] -> ShowS
$cshowList :: [NodeSummary] -> ShowS
show :: NodeSummary -> String
$cshow :: NodeSummary -> String
showsPrec :: Int -> NodeSummary -> ShowS
$cshowsPrec :: Int -> NodeSummary -> ShowS
Prelude.Show, (forall x. NodeSummary -> Rep NodeSummary x)
-> (forall x. Rep NodeSummary x -> NodeSummary)
-> Generic NodeSummary
forall x. Rep NodeSummary x -> NodeSummary
forall x. NodeSummary -> Rep NodeSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NodeSummary x -> NodeSummary
$cfrom :: forall x. NodeSummary -> Rep NodeSummary x
Prelude.Generic)
newNodeSummary ::
NodeSummary
newNodeSummary :: NodeSummary
newNodeSummary =
NodeSummary' :: Maybe NodeStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> NodeSummary
NodeSummary'
{ $sel:status:NodeSummary' :: Maybe NodeStatus
status = Maybe NodeStatus
forall a. Maybe a
Prelude.Nothing,
$sel:arn:NodeSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceType:NodeSummary' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:availabilityZone:NodeSummary' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:NodeSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationDate:NodeSummary' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
nodeSummary_status :: Lens.Lens' NodeSummary (Prelude.Maybe NodeStatus)
nodeSummary_status :: (Maybe NodeStatus -> f (Maybe NodeStatus))
-> NodeSummary -> f NodeSummary
nodeSummary_status = (NodeSummary -> Maybe NodeStatus)
-> (NodeSummary -> Maybe NodeStatus -> NodeSummary)
-> Lens
NodeSummary NodeSummary (Maybe NodeStatus) (Maybe NodeStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeSummary' {Maybe NodeStatus
status :: Maybe NodeStatus
$sel:status:NodeSummary' :: NodeSummary -> Maybe NodeStatus
status} -> Maybe NodeStatus
status) (\s :: NodeSummary
s@NodeSummary' {} Maybe NodeStatus
a -> NodeSummary
s {$sel:status:NodeSummary' :: Maybe NodeStatus
status = Maybe NodeStatus
a} :: NodeSummary)
nodeSummary_arn :: Lens.Lens' NodeSummary (Prelude.Maybe Prelude.Text)
nodeSummary_arn :: (Maybe Text -> f (Maybe Text)) -> NodeSummary -> f NodeSummary
nodeSummary_arn = (NodeSummary -> Maybe Text)
-> (NodeSummary -> Maybe Text -> NodeSummary)
-> Lens NodeSummary NodeSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:NodeSummary' :: NodeSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: NodeSummary
s@NodeSummary' {} Maybe Text
a -> NodeSummary
s {$sel:arn:NodeSummary' :: Maybe Text
arn = Maybe Text
a} :: NodeSummary)
nodeSummary_instanceType :: Lens.Lens' NodeSummary (Prelude.Maybe Prelude.Text)
nodeSummary_instanceType :: (Maybe Text -> f (Maybe Text)) -> NodeSummary -> f NodeSummary
nodeSummary_instanceType = (NodeSummary -> Maybe Text)
-> (NodeSummary -> Maybe Text -> NodeSummary)
-> Lens NodeSummary NodeSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeSummary' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:NodeSummary' :: NodeSummary -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: NodeSummary
s@NodeSummary' {} Maybe Text
a -> NodeSummary
s {$sel:instanceType:NodeSummary' :: Maybe Text
instanceType = Maybe Text
a} :: NodeSummary)
nodeSummary_availabilityZone :: Lens.Lens' NodeSummary (Prelude.Maybe Prelude.Text)
nodeSummary_availabilityZone :: (Maybe Text -> f (Maybe Text)) -> NodeSummary -> f NodeSummary
nodeSummary_availabilityZone = (NodeSummary -> Maybe Text)
-> (NodeSummary -> Maybe Text -> NodeSummary)
-> Lens NodeSummary NodeSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeSummary' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:NodeSummary' :: NodeSummary -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: NodeSummary
s@NodeSummary' {} Maybe Text
a -> NodeSummary
s {$sel:availabilityZone:NodeSummary' :: Maybe Text
availabilityZone = Maybe Text
a} :: NodeSummary)
nodeSummary_id :: Lens.Lens' NodeSummary (Prelude.Maybe Prelude.Text)
nodeSummary_id :: (Maybe Text -> f (Maybe Text)) -> NodeSummary -> f NodeSummary
nodeSummary_id = (NodeSummary -> Maybe Text)
-> (NodeSummary -> Maybe Text -> NodeSummary)
-> Lens NodeSummary NodeSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeSummary' {Maybe Text
id :: Maybe Text
$sel:id:NodeSummary' :: NodeSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: NodeSummary
s@NodeSummary' {} Maybe Text
a -> NodeSummary
s {$sel:id:NodeSummary' :: Maybe Text
id = Maybe Text
a} :: NodeSummary)
nodeSummary_creationDate :: Lens.Lens' NodeSummary (Prelude.Maybe Prelude.UTCTime)
nodeSummary_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> NodeSummary -> f NodeSummary
nodeSummary_creationDate = (NodeSummary -> Maybe POSIX)
-> (NodeSummary -> Maybe POSIX -> NodeSummary)
-> Lens NodeSummary NodeSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeSummary' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:NodeSummary' :: NodeSummary -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: NodeSummary
s@NodeSummary' {} Maybe POSIX
a -> NodeSummary
s {$sel:creationDate:NodeSummary' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: NodeSummary) ((Maybe POSIX -> f (Maybe POSIX)) -> NodeSummary -> f NodeSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> NodeSummary
-> f NodeSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON NodeSummary where
parseJSON :: Value -> Parser NodeSummary
parseJSON =
String
-> (Object -> Parser NodeSummary) -> Value -> Parser NodeSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NodeSummary"
( \Object
x ->
Maybe NodeStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> NodeSummary
NodeSummary'
(Maybe NodeStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> NodeSummary)
-> Parser (Maybe NodeStatus)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> NodeSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe NodeStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> NodeSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe POSIX -> NodeSummary)
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
"Arn")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe POSIX -> NodeSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> NodeSummary)
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
"InstanceType")
Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> NodeSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> NodeSummary)
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
"AvailabilityZone")
Parser (Maybe Text -> Maybe POSIX -> NodeSummary)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> NodeSummary)
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
"Id")
Parser (Maybe POSIX -> NodeSummary)
-> Parser (Maybe POSIX) -> Parser NodeSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationDate")
)
instance Prelude.Hashable NodeSummary
instance Prelude.NFData NodeSummary