{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ManagedBlockChain.Types.NodeSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ManagedBlockChain.Types.NodeSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ManagedBlockChain.Types.NodeStatus
import qualified Amazonka.Prelude as Prelude

-- | A summary of configuration properties for a node.
--
-- /See:/ 'newNodeSummary' smart constructor.
data NodeSummary = NodeSummary'
  { -- | The Amazon Resource Name (ARN) of the node. For more information about
    -- ARNs and their format, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
    -- in the /Amazon Web Services General Reference/.
    NodeSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The Availability Zone in which the node exists.
    NodeSummary -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the node was created.
    NodeSummary -> Maybe ISO8601
creationDate :: Prelude.Maybe Data.ISO8601,
    -- | The unique identifier of the node.
    NodeSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The EC2 instance type for the node.
    NodeSummary -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
    -- | The status of the node.
    NodeSummary -> Maybe NodeStatus
status :: Prelude.Maybe NodeStatus
  }
  deriving (NodeSummary -> NodeSummary -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'NodeSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'arn', 'nodeSummary_arn' - The Amazon Resource Name (ARN) of the node. For more information about
-- ARNs and their format, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /Amazon Web Services General Reference/.
--
-- 'availabilityZone', 'nodeSummary_availabilityZone' - The Availability Zone in which the node exists.
--
-- 'creationDate', 'nodeSummary_creationDate' - The date and time that the node was created.
--
-- 'id', 'nodeSummary_id' - The unique identifier of the node.
--
-- 'instanceType', 'nodeSummary_instanceType' - The EC2 instance type for the node.
--
-- 'status', 'nodeSummary_status' - The status of the node.
newNodeSummary ::
  NodeSummary
newNodeSummary :: NodeSummary
newNodeSummary =
  NodeSummary'
    { $sel:arn:NodeSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZone:NodeSummary' :: Maybe Text
availabilityZone = forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:NodeSummary' :: Maybe ISO8601
creationDate = forall a. Maybe a
Prelude.Nothing,
      $sel:id:NodeSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:NodeSummary' :: Maybe Text
instanceType = forall a. Maybe a
Prelude.Nothing,
      $sel:status:NodeSummary' :: Maybe NodeStatus
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the node. For more information about
-- ARNs and their format, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /Amazon Web Services General Reference/.
nodeSummary_arn :: Lens.Lens' NodeSummary (Prelude.Maybe Prelude.Text)
nodeSummary_arn :: Lens' NodeSummary (Maybe Text)
nodeSummary_arn = 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)

-- | The Availability Zone in which the node exists.
nodeSummary_availabilityZone :: Lens.Lens' NodeSummary (Prelude.Maybe Prelude.Text)
nodeSummary_availabilityZone :: Lens' NodeSummary (Maybe Text)
nodeSummary_availabilityZone = 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)

-- | The date and time that the node was created.
nodeSummary_creationDate :: Lens.Lens' NodeSummary (Prelude.Maybe Prelude.UTCTime)
nodeSummary_creationDate :: Lens' NodeSummary (Maybe UTCTime)
nodeSummary_creationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeSummary' {Maybe ISO8601
creationDate :: Maybe ISO8601
$sel:creationDate:NodeSummary' :: NodeSummary -> Maybe ISO8601
creationDate} -> Maybe ISO8601
creationDate) (\s :: NodeSummary
s@NodeSummary' {} Maybe ISO8601
a -> NodeSummary
s {$sel:creationDate:NodeSummary' :: Maybe ISO8601
creationDate = Maybe ISO8601
a} :: NodeSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The unique identifier of the node.
nodeSummary_id :: Lens.Lens' NodeSummary (Prelude.Maybe Prelude.Text)
nodeSummary_id :: Lens' NodeSummary (Maybe Text)
nodeSummary_id = 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)

-- | The EC2 instance type for the node.
nodeSummary_instanceType :: Lens.Lens' NodeSummary (Prelude.Maybe Prelude.Text)
nodeSummary_instanceType :: Lens' NodeSummary (Maybe Text)
nodeSummary_instanceType = 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)

-- | The status of the node.
nodeSummary_status :: Lens.Lens' NodeSummary (Prelude.Maybe NodeStatus)
nodeSummary_status :: Lens' NodeSummary (Maybe NodeStatus)
nodeSummary_status = 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)

instance Data.FromJSON NodeSummary where
  parseJSON :: Value -> Parser NodeSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"NodeSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe NodeStatus
-> NodeSummary
NodeSummary'
            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
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AvailabilityZone")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreationDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"InstanceType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
      )

instance Prelude.Hashable NodeSummary where
  hashWithSalt :: Int -> NodeSummary -> Int
hashWithSalt Int
_salt NodeSummary' {Maybe Text
Maybe ISO8601
Maybe NodeStatus
status :: Maybe NodeStatus
instanceType :: Maybe Text
id :: Maybe Text
creationDate :: Maybe ISO8601
availabilityZone :: Maybe Text
arn :: Maybe Text
$sel:status:NodeSummary' :: NodeSummary -> Maybe NodeStatus
$sel:instanceType:NodeSummary' :: NodeSummary -> Maybe Text
$sel:id:NodeSummary' :: NodeSummary -> Maybe Text
$sel:creationDate:NodeSummary' :: NodeSummary -> Maybe ISO8601
$sel:availabilityZone:NodeSummary' :: NodeSummary -> Maybe Text
$sel:arn:NodeSummary' :: NodeSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
availabilityZone
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
creationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NodeStatus
status

instance Prelude.NFData NodeSummary where
  rnf :: NodeSummary -> ()
rnf NodeSummary' {Maybe Text
Maybe ISO8601
Maybe NodeStatus
status :: Maybe NodeStatus
instanceType :: Maybe Text
id :: Maybe Text
creationDate :: Maybe ISO8601
availabilityZone :: Maybe Text
arn :: Maybe Text
$sel:status:NodeSummary' :: NodeSummary -> Maybe NodeStatus
$sel:instanceType:NodeSummary' :: NodeSummary -> Maybe Text
$sel:id:NodeSummary' :: NodeSummary -> Maybe Text
$sel:creationDate:NodeSummary' :: NodeSummary -> Maybe ISO8601
$sel:availabilityZone:NodeSummary' :: NodeSummary -> Maybe Text
$sel:arn:NodeSummary' :: NodeSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
availabilityZone
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
creationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NodeStatus
status