{-# 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.Node
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ManagedBlockChain.Types.Node where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.ManagedBlockChain.Types.NodeFrameworkAttributes
import Amazonka.ManagedBlockChain.Types.NodeLogPublishingConfiguration
import Amazonka.ManagedBlockChain.Types.NodeStatus
import Amazonka.ManagedBlockChain.Types.StateDBType
import qualified Amazonka.Prelude as Prelude

-- | Configuration properties of a node.
--
-- /See:/ 'newNode' smart constructor.
data Node = Node'
  { -- | The status of the node.
    --
    -- -   @CREATING@ - The AWS account is in the process of creating a node.
    --
    -- -   @AVAILABLE@ - The node has been created and can participate in the
    --     network.
    --
    -- -   @UNHEALTHY@ - The node is impaired and might not function as
    --     expected. Amazon Managed Blockchain automatically finds nodes in
    --     this state and tries to recover them. If a node is recoverable, it
    --     returns to @AVAILABLE@. Otherwise, it moves to @FAILED@ status.
    --
    -- -   @CREATE_FAILED@ - The AWS account attempted to create a node and
    --     creation failed.
    --
    -- -   @UPDATING@ - The node is in the process of being updated.
    --
    -- -   @DELETING@ - The node is in the process of being deleted.
    --
    -- -   @DELETED@ - The node can no longer participate on the network.
    --
    -- -   @FAILED@ - The node is no longer functional, cannot be recovered,
    --     and must be deleted.
    --
    -- -   @INACCESSIBLE_ENCRYPTION_KEY@ - The node is impaired and might not
    --     function as expected because it cannot access the specified customer
    --     managed key in AWS KMS for encryption at rest. Either the KMS key
    --     was disabled or deleted, or the grants on the key were revoked.
    --
    --     The effect of disabling or deleting a key, or revoking a grant is
    --     not immediate. The node resource might take some time to find that
    --     the key is inaccessible. When a resource is in this state, we
    --     recommend deleting and recreating the resource.
    Node -> Maybe NodeStatus
status :: Prelude.Maybe NodeStatus,
    -- | The Amazon Resource Name (ARN) of the customer managed key in AWS Key
    -- Management Service (AWS KMS) that the node uses for encryption at rest.
    -- If the value of this parameter is @\"AWS Owned KMS Key\"@, the node uses
    -- an AWS owned KMS key for encryption. The node inherits this parameter
    -- from the member that it belongs to.
    --
    -- Applies only to Hyperledger Fabric.
    Node -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
    -- | Configuration properties for logging events associated with a peer node
    -- on a Hyperledger Fabric network on Managed Blockchain.
    Node -> Maybe NodeLogPublishingConfiguration
logPublishingConfiguration :: Prelude.Maybe NodeLogPublishingConfiguration,
    -- | The unique identifier of the member to which the node belongs.
    --
    -- Applies only to Hyperledger Fabric.
    Node -> Maybe Text
memberId :: Prelude.Maybe Prelude.Text,
    -- | 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 /AWS General Reference/.
    Node -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the network that the node is on.
    Node -> Maybe Text
networkId :: Prelude.Maybe Prelude.Text,
    -- | The instance type of the node.
    Node -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
    -- | The state database that the node uses. Values are @LevelDB@ or
    -- @CouchDB@.
    --
    -- Applies only to Hyperledger Fabric.
    Node -> Maybe StateDBType
stateDB :: Prelude.Maybe StateDBType,
    -- | The Availability Zone in which the node exists. Required for Ethereum
    -- nodes.
    Node -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the node.
    Node -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the node was created.
    Node -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | Attributes of the blockchain framework being used.
    Node -> Maybe NodeFrameworkAttributes
frameworkAttributes :: Prelude.Maybe NodeFrameworkAttributes,
    -- | Tags assigned to the node. Each tag consists of a key and optional
    -- value.
    --
    -- For more information about tags, see
    -- <https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html Tagging Resources>
    -- in the /Amazon Managed Blockchain Ethereum Developer Guide/, or
    -- <https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html Tagging Resources>
    -- in the /Amazon Managed Blockchain Hyperledger Fabric Developer Guide/.
    Node -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  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)

-- |
-- Create a value of 'Node' 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:
--
-- 'status', 'node_status' - The status of the node.
--
-- -   @CREATING@ - The AWS account is in the process of creating a node.
--
-- -   @AVAILABLE@ - The node has been created and can participate in the
--     network.
--
-- -   @UNHEALTHY@ - The node is impaired and might not function as
--     expected. Amazon Managed Blockchain automatically finds nodes in
--     this state and tries to recover them. If a node is recoverable, it
--     returns to @AVAILABLE@. Otherwise, it moves to @FAILED@ status.
--
-- -   @CREATE_FAILED@ - The AWS account attempted to create a node and
--     creation failed.
--
-- -   @UPDATING@ - The node is in the process of being updated.
--
-- -   @DELETING@ - The node is in the process of being deleted.
--
-- -   @DELETED@ - The node can no longer participate on the network.
--
-- -   @FAILED@ - The node is no longer functional, cannot be recovered,
--     and must be deleted.
--
-- -   @INACCESSIBLE_ENCRYPTION_KEY@ - The node is impaired and might not
--     function as expected because it cannot access the specified customer
--     managed key in AWS KMS for encryption at rest. Either the KMS key
--     was disabled or deleted, or the grants on the key were revoked.
--
--     The effect of disabling or deleting a key, or revoking a grant is
--     not immediate. The node resource might take some time to find that
--     the key is inaccessible. When a resource is in this state, we
--     recommend deleting and recreating the resource.
--
-- 'kmsKeyArn', 'node_kmsKeyArn' - The Amazon Resource Name (ARN) of the customer managed key in AWS Key
-- Management Service (AWS KMS) that the node uses for encryption at rest.
-- If the value of this parameter is @\"AWS Owned KMS Key\"@, the node uses
-- an AWS owned KMS key for encryption. The node inherits this parameter
-- from the member that it belongs to.
--
-- Applies only to Hyperledger Fabric.
--
-- 'logPublishingConfiguration', 'node_logPublishingConfiguration' - Configuration properties for logging events associated with a peer node
-- on a Hyperledger Fabric network on Managed Blockchain.
--
-- 'memberId', 'node_memberId' - The unique identifier of the member to which the node belongs.
--
-- Applies only to Hyperledger Fabric.
--
-- 'arn', 'node_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 /AWS General Reference/.
--
-- 'networkId', 'node_networkId' - The unique identifier of the network that the node is on.
--
-- 'instanceType', 'node_instanceType' - The instance type of the node.
--
-- 'stateDB', 'node_stateDB' - The state database that the node uses. Values are @LevelDB@ or
-- @CouchDB@.
--
-- Applies only to Hyperledger Fabric.
--
-- 'availabilityZone', 'node_availabilityZone' - The Availability Zone in which the node exists. Required for Ethereum
-- nodes.
--
-- 'id', 'node_id' - The unique identifier of the node.
--
-- 'creationDate', 'node_creationDate' - The date and time that the node was created.
--
-- 'frameworkAttributes', 'node_frameworkAttributes' - Attributes of the blockchain framework being used.
--
-- 'tags', 'node_tags' - Tags assigned to the node. Each tag consists of a key and optional
-- value.
--
-- For more information about tags, see
-- <https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html Tagging Resources>
-- in the /Amazon Managed Blockchain Ethereum Developer Guide/, or
-- <https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html Tagging Resources>
-- in the /Amazon Managed Blockchain Hyperledger Fabric Developer Guide/.
newNode ::
  Node
newNode :: Node
newNode =
  Node' :: Maybe NodeStatus
-> Maybe Text
-> Maybe NodeLogPublishingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe StateDBType
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe NodeFrameworkAttributes
-> Maybe (HashMap Text Text)
-> Node
Node'
    { $sel:status:Node' :: Maybe NodeStatus
status = Maybe NodeStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyArn:Node' :: Maybe Text
kmsKeyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:logPublishingConfiguration:Node' :: Maybe NodeLogPublishingConfiguration
logPublishingConfiguration = Maybe NodeLogPublishingConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:memberId:Node' :: Maybe Text
memberId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Node' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:networkId:Node' :: Maybe Text
networkId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:Node' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stateDB:Node' :: Maybe StateDBType
stateDB = Maybe StateDBType
forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZone:Node' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:Node' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:Node' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:frameworkAttributes:Node' :: Maybe NodeFrameworkAttributes
frameworkAttributes = Maybe NodeFrameworkAttributes
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Node' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the node.
--
-- -   @CREATING@ - The AWS account is in the process of creating a node.
--
-- -   @AVAILABLE@ - The node has been created and can participate in the
--     network.
--
-- -   @UNHEALTHY@ - The node is impaired and might not function as
--     expected. Amazon Managed Blockchain automatically finds nodes in
--     this state and tries to recover them. If a node is recoverable, it
--     returns to @AVAILABLE@. Otherwise, it moves to @FAILED@ status.
--
-- -   @CREATE_FAILED@ - The AWS account attempted to create a node and
--     creation failed.
--
-- -   @UPDATING@ - The node is in the process of being updated.
--
-- -   @DELETING@ - The node is in the process of being deleted.
--
-- -   @DELETED@ - The node can no longer participate on the network.
--
-- -   @FAILED@ - The node is no longer functional, cannot be recovered,
--     and must be deleted.
--
-- -   @INACCESSIBLE_ENCRYPTION_KEY@ - The node is impaired and might not
--     function as expected because it cannot access the specified customer
--     managed key in AWS KMS for encryption at rest. Either the KMS key
--     was disabled or deleted, or the grants on the key were revoked.
--
--     The effect of disabling or deleting a key, or revoking a grant is
--     not immediate. The node resource might take some time to find that
--     the key is inaccessible. When a resource is in this state, we
--     recommend deleting and recreating the resource.
node_status :: Lens.Lens' Node (Prelude.Maybe NodeStatus)
node_status :: (Maybe NodeStatus -> f (Maybe NodeStatus)) -> Node -> f Node
node_status = (Node -> Maybe NodeStatus)
-> (Node -> Maybe NodeStatus -> Node)
-> Lens Node Node (Maybe NodeStatus) (Maybe NodeStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe NodeStatus
status :: Maybe NodeStatus
$sel:status:Node' :: Node -> Maybe NodeStatus
status} -> Maybe NodeStatus
status) (\s :: Node
s@Node' {} Maybe NodeStatus
a -> Node
s {$sel:status:Node' :: Maybe NodeStatus
status = Maybe NodeStatus
a} :: Node)

-- | The Amazon Resource Name (ARN) of the customer managed key in AWS Key
-- Management Service (AWS KMS) that the node uses for encryption at rest.
-- If the value of this parameter is @\"AWS Owned KMS Key\"@, the node uses
-- an AWS owned KMS key for encryption. The node inherits this parameter
-- from the member that it belongs to.
--
-- Applies only to Hyperledger Fabric.
node_kmsKeyArn :: Lens.Lens' Node (Prelude.Maybe Prelude.Text)
node_kmsKeyArn :: (Maybe Text -> f (Maybe Text)) -> Node -> f Node
node_kmsKeyArn = (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
kmsKeyArn :: Maybe Text
$sel:kmsKeyArn:Node' :: Node -> Maybe Text
kmsKeyArn} -> Maybe Text
kmsKeyArn) (\s :: Node
s@Node' {} Maybe Text
a -> Node
s {$sel:kmsKeyArn:Node' :: Maybe Text
kmsKeyArn = Maybe Text
a} :: Node)

-- | Configuration properties for logging events associated with a peer node
-- on a Hyperledger Fabric network on Managed Blockchain.
node_logPublishingConfiguration :: Lens.Lens' Node (Prelude.Maybe NodeLogPublishingConfiguration)
node_logPublishingConfiguration :: (Maybe NodeLogPublishingConfiguration
 -> f (Maybe NodeLogPublishingConfiguration))
-> Node -> f Node
node_logPublishingConfiguration = (Node -> Maybe NodeLogPublishingConfiguration)
-> (Node -> Maybe NodeLogPublishingConfiguration -> Node)
-> Lens
     Node
     Node
     (Maybe NodeLogPublishingConfiguration)
     (Maybe NodeLogPublishingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe NodeLogPublishingConfiguration
logPublishingConfiguration :: Maybe NodeLogPublishingConfiguration
$sel:logPublishingConfiguration:Node' :: Node -> Maybe NodeLogPublishingConfiguration
logPublishingConfiguration} -> Maybe NodeLogPublishingConfiguration
logPublishingConfiguration) (\s :: Node
s@Node' {} Maybe NodeLogPublishingConfiguration
a -> Node
s {$sel:logPublishingConfiguration:Node' :: Maybe NodeLogPublishingConfiguration
logPublishingConfiguration = Maybe NodeLogPublishingConfiguration
a} :: Node)

-- | The unique identifier of the member to which the node belongs.
--
-- Applies only to Hyperledger Fabric.
node_memberId :: Lens.Lens' Node (Prelude.Maybe Prelude.Text)
node_memberId :: (Maybe Text -> f (Maybe Text)) -> Node -> f Node
node_memberId = (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
memberId :: Maybe Text
$sel:memberId:Node' :: Node -> Maybe Text
memberId} -> Maybe Text
memberId) (\s :: Node
s@Node' {} Maybe Text
a -> Node
s {$sel:memberId:Node' :: Maybe Text
memberId = Maybe Text
a} :: Node)

-- | 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 /AWS General Reference/.
node_arn :: Lens.Lens' Node (Prelude.Maybe Prelude.Text)
node_arn :: (Maybe Text -> f (Maybe Text)) -> Node -> f Node
node_arn = (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
arn :: Maybe Text
$sel:arn:Node' :: Node -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Node
s@Node' {} Maybe Text
a -> Node
s {$sel:arn:Node' :: Maybe Text
arn = Maybe Text
a} :: Node)

-- | The unique identifier of the network that the node is on.
node_networkId :: Lens.Lens' Node (Prelude.Maybe Prelude.Text)
node_networkId :: (Maybe Text -> f (Maybe Text)) -> Node -> f Node
node_networkId = (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
networkId :: Maybe Text
$sel:networkId:Node' :: Node -> Maybe Text
networkId} -> Maybe Text
networkId) (\s :: Node
s@Node' {} Maybe Text
a -> Node
s {$sel:networkId:Node' :: Maybe Text
networkId = Maybe Text
a} :: Node)

-- | The instance type of the node.
node_instanceType :: Lens.Lens' Node (Prelude.Maybe Prelude.Text)
node_instanceType :: (Maybe Text -> f (Maybe Text)) -> Node -> f Node
node_instanceType = (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
instanceType :: Maybe Text
$sel:instanceType:Node' :: Node -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: Node
s@Node' {} Maybe Text
a -> Node
s {$sel:instanceType:Node' :: Maybe Text
instanceType = Maybe Text
a} :: Node)

-- | The state database that the node uses. Values are @LevelDB@ or
-- @CouchDB@.
--
-- Applies only to Hyperledger Fabric.
node_stateDB :: Lens.Lens' Node (Prelude.Maybe StateDBType)
node_stateDB :: (Maybe StateDBType -> f (Maybe StateDBType)) -> Node -> f Node
node_stateDB = (Node -> Maybe StateDBType)
-> (Node -> Maybe StateDBType -> Node)
-> Lens Node Node (Maybe StateDBType) (Maybe StateDBType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe StateDBType
stateDB :: Maybe StateDBType
$sel:stateDB:Node' :: Node -> Maybe StateDBType
stateDB} -> Maybe StateDBType
stateDB) (\s :: Node
s@Node' {} Maybe StateDBType
a -> Node
s {$sel:stateDB:Node' :: Maybe StateDBType
stateDB = Maybe StateDBType
a} :: Node)

-- | The Availability Zone in which the node exists. Required for Ethereum
-- nodes.
node_availabilityZone :: Lens.Lens' Node (Prelude.Maybe Prelude.Text)
node_availabilityZone :: (Maybe Text -> f (Maybe Text)) -> Node -> f Node
node_availabilityZone = (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
availabilityZone :: Maybe Text
$sel:availabilityZone:Node' :: Node -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: Node
s@Node' {} Maybe Text
a -> Node
s {$sel:availabilityZone:Node' :: Maybe Text
availabilityZone = Maybe Text
a} :: Node)

-- | The unique identifier of the node.
node_id :: Lens.Lens' Node (Prelude.Maybe Prelude.Text)
node_id :: (Maybe Text -> f (Maybe Text)) -> Node -> f Node
node_id = (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
id :: Maybe Text
$sel:id:Node' :: Node -> Maybe Text
id} -> Maybe Text
id) (\s :: Node
s@Node' {} Maybe Text
a -> Node
s {$sel:id:Node' :: Maybe Text
id = Maybe Text
a} :: Node)

-- | The date and time that the node was created.
node_creationDate :: Lens.Lens' Node (Prelude.Maybe Prelude.UTCTime)
node_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Node -> f Node
node_creationDate = (Node -> Maybe POSIX)
-> (Node -> Maybe POSIX -> Node)
-> Lens Node Node (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:Node' :: Node -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: Node
s@Node' {} Maybe POSIX
a -> Node
s {$sel:creationDate:Node' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: Node) ((Maybe POSIX -> f (Maybe POSIX)) -> Node -> f Node)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Node
-> f Node
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

-- | Attributes of the blockchain framework being used.
node_frameworkAttributes :: Lens.Lens' Node (Prelude.Maybe NodeFrameworkAttributes)
node_frameworkAttributes :: (Maybe NodeFrameworkAttributes
 -> f (Maybe NodeFrameworkAttributes))
-> Node -> f Node
node_frameworkAttributes = (Node -> Maybe NodeFrameworkAttributes)
-> (Node -> Maybe NodeFrameworkAttributes -> Node)
-> Lens
     Node
     Node
     (Maybe NodeFrameworkAttributes)
     (Maybe NodeFrameworkAttributes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe NodeFrameworkAttributes
frameworkAttributes :: Maybe NodeFrameworkAttributes
$sel:frameworkAttributes:Node' :: Node -> Maybe NodeFrameworkAttributes
frameworkAttributes} -> Maybe NodeFrameworkAttributes
frameworkAttributes) (\s :: Node
s@Node' {} Maybe NodeFrameworkAttributes
a -> Node
s {$sel:frameworkAttributes:Node' :: Maybe NodeFrameworkAttributes
frameworkAttributes = Maybe NodeFrameworkAttributes
a} :: Node)

-- | Tags assigned to the node. Each tag consists of a key and optional
-- value.
--
-- For more information about tags, see
-- <https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html Tagging Resources>
-- in the /Amazon Managed Blockchain Ethereum Developer Guide/, or
-- <https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html Tagging Resources>
-- in the /Amazon Managed Blockchain Hyperledger Fabric Developer Guide/.
node_tags :: Lens.Lens' Node (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
node_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Node -> f Node
node_tags = (Node -> Maybe (HashMap Text Text))
-> (Node -> Maybe (HashMap Text Text) -> Node)
-> Lens
     Node Node (Maybe (HashMap Text Text)) (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Node' :: Node -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Node
s@Node' {} Maybe (HashMap Text Text)
a -> Node
s {$sel:tags:Node' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Node) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> Node -> f Node)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Node
-> f Node
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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 NodeStatus
-> Maybe Text
-> Maybe NodeLogPublishingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe StateDBType
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe NodeFrameworkAttributes
-> Maybe (HashMap Text Text)
-> Node
Node'
            (Maybe NodeStatus
 -> Maybe Text
 -> Maybe NodeLogPublishingConfiguration
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe StateDBType
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe NodeFrameworkAttributes
 -> Maybe (HashMap Text Text)
 -> Node)
-> Parser (Maybe NodeStatus)
-> Parser
     (Maybe Text
      -> Maybe NodeLogPublishingConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StateDBType
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe NodeFrameworkAttributes
      -> Maybe (HashMap Text Text)
      -> Node)
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 NodeLogPublishingConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StateDBType
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe NodeFrameworkAttributes
   -> Maybe (HashMap Text Text)
   -> Node)
-> Parser (Maybe Text)
-> Parser
     (Maybe NodeLogPublishingConfiguration
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StateDBType
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe NodeFrameworkAttributes
      -> Maybe (HashMap Text Text)
      -> 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
"KmsKeyArn")
            Parser
  (Maybe NodeLogPublishingConfiguration
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StateDBType
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe NodeFrameworkAttributes
   -> Maybe (HashMap Text Text)
   -> Node)
-> Parser (Maybe NodeLogPublishingConfiguration)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StateDBType
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe NodeFrameworkAttributes
      -> Maybe (HashMap Text Text)
      -> Node)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NodeLogPublishingConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LogPublishingConfiguration")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StateDBType
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe NodeFrameworkAttributes
   -> Maybe (HashMap Text Text)
   -> Node)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe StateDBType
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe NodeFrameworkAttributes
      -> Maybe (HashMap Text Text)
      -> 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
"MemberId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe StateDBType
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe NodeFrameworkAttributes
   -> Maybe (HashMap Text Text)
   -> Node)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe StateDBType
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe NodeFrameworkAttributes
      -> Maybe (HashMap Text Text)
      -> 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
"Arn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe StateDBType
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe NodeFrameworkAttributes
   -> Maybe (HashMap Text Text)
   -> Node)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe StateDBType
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe NodeFrameworkAttributes
      -> Maybe (HashMap Text Text)
      -> 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
"NetworkId")
            Parser
  (Maybe Text
   -> Maybe StateDBType
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe NodeFrameworkAttributes
   -> Maybe (HashMap Text Text)
   -> Node)
-> Parser (Maybe Text)
-> Parser
     (Maybe StateDBType
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe NodeFrameworkAttributes
      -> Maybe (HashMap Text Text)
      -> 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
"InstanceType")
            Parser
  (Maybe StateDBType
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe NodeFrameworkAttributes
   -> Maybe (HashMap Text Text)
   -> Node)
-> Parser (Maybe StateDBType)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe NodeFrameworkAttributes
      -> Maybe (HashMap Text Text)
      -> Node)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StateDBType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StateDB")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe NodeFrameworkAttributes
   -> Maybe (HashMap Text Text)
   -> Node)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe NodeFrameworkAttributes
      -> Maybe (HashMap Text Text)
      -> 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
"AvailabilityZone")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe NodeFrameworkAttributes
   -> Maybe (HashMap Text Text)
   -> Node)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe NodeFrameworkAttributes
      -> Maybe (HashMap Text Text)
      -> 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
"Id")
            Parser
  (Maybe POSIX
   -> Maybe NodeFrameworkAttributes
   -> Maybe (HashMap Text Text)
   -> Node)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe NodeFrameworkAttributes
      -> Maybe (HashMap Text Text) -> Node)
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")
            Parser
  (Maybe NodeFrameworkAttributes
   -> Maybe (HashMap Text Text) -> Node)
-> Parser (Maybe NodeFrameworkAttributes)
-> Parser (Maybe (HashMap Text Text) -> Node)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NodeFrameworkAttributes)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FrameworkAttributes")
            Parser (Maybe (HashMap Text Text) -> Node)
-> Parser (Maybe (HashMap Text Text)) -> Parser Node
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable Node

instance Prelude.NFData Node