{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateNode
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a node on the specified blockchain network.
--
-- Applies to Hyperledger Fabric and Ethereum.
module Amazonka.ManagedBlockChain.CreateNode
  ( -- * Creating a Request
    CreateNode (..),
    newCreateNode,

    -- * Request Lenses
    createNode_memberId,
    createNode_tags,
    createNode_clientRequestToken,
    createNode_networkId,
    createNode_nodeConfiguration,

    -- * Destructuring the Response
    CreateNodeResponse (..),
    newCreateNodeResponse,

    -- * Response Lenses
    createNodeResponse_nodeId,
    createNodeResponse_httpStatus,
  )
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateNode' smart constructor.
data CreateNode = CreateNode'
  { -- | The unique identifier of the member that owns this node.
    --
    -- Applies only to Hyperledger Fabric.
    CreateNode -> Maybe Text
memberId :: Prelude.Maybe Prelude.Text,
    -- | Tags to assign to the node. Each tag consists of a key and optional
    -- value.
    --
    -- When specifying tags during creation, you can specify multiple key-value
    -- pairs in a single request, with an overall maximum of 50 tags added to
    -- each resource.
    --
    -- 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/.
    CreateNode -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the operation. An idempotent operation completes no more
    -- than one time. This identifier is required only if you make a service
    -- request directly using an HTTP client. It is generated automatically if
    -- you use an Amazon Web Services SDK or the CLI.
    CreateNode -> Text
clientRequestToken :: Prelude.Text,
    -- | The unique identifier of the network for the node.
    --
    -- Ethereum public networks have the following @NetworkId@s:
    --
    -- -   @n-ethereum-mainnet@
    --
    -- -   @n-ethereum-goerli@
    --
    -- -   @n-ethereum-rinkeby@
    --
    -- -   @n-ethereum-ropsten@
    CreateNode -> Text
networkId :: Prelude.Text,
    -- | The properties of a node configuration.
    CreateNode -> NodeConfiguration
nodeConfiguration :: NodeConfiguration
  }
  deriving (CreateNode -> CreateNode -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNode -> CreateNode -> Bool
$c/= :: CreateNode -> CreateNode -> Bool
== :: CreateNode -> CreateNode -> Bool
$c== :: CreateNode -> CreateNode -> Bool
Prelude.Eq, ReadPrec [CreateNode]
ReadPrec CreateNode
Int -> ReadS CreateNode
ReadS [CreateNode]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateNode]
$creadListPrec :: ReadPrec [CreateNode]
readPrec :: ReadPrec CreateNode
$creadPrec :: ReadPrec CreateNode
readList :: ReadS [CreateNode]
$creadList :: ReadS [CreateNode]
readsPrec :: Int -> ReadS CreateNode
$creadsPrec :: Int -> ReadS CreateNode
Prelude.Read, Int -> CreateNode -> ShowS
[CreateNode] -> ShowS
CreateNode -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNode] -> ShowS
$cshowList :: [CreateNode] -> ShowS
show :: CreateNode -> String
$cshow :: CreateNode -> String
showsPrec :: Int -> CreateNode -> ShowS
$cshowsPrec :: Int -> CreateNode -> ShowS
Prelude.Show, forall x. Rep CreateNode x -> CreateNode
forall x. CreateNode -> Rep CreateNode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateNode x -> CreateNode
$cfrom :: forall x. CreateNode -> Rep CreateNode x
Prelude.Generic)

-- |
-- Create a value of 'CreateNode' 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:
--
-- 'memberId', 'createNode_memberId' - The unique identifier of the member that owns this node.
--
-- Applies only to Hyperledger Fabric.
--
-- 'tags', 'createNode_tags' - Tags to assign to the node. Each tag consists of a key and optional
-- value.
--
-- When specifying tags during creation, you can specify multiple key-value
-- pairs in a single request, with an overall maximum of 50 tags added to
-- each resource.
--
-- 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/.
--
-- 'clientRequestToken', 'createNode_clientRequestToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the operation. An idempotent operation completes no more
-- than one time. This identifier is required only if you make a service
-- request directly using an HTTP client. It is generated automatically if
-- you use an Amazon Web Services SDK or the CLI.
--
-- 'networkId', 'createNode_networkId' - The unique identifier of the network for the node.
--
-- Ethereum public networks have the following @NetworkId@s:
--
-- -   @n-ethereum-mainnet@
--
-- -   @n-ethereum-goerli@
--
-- -   @n-ethereum-rinkeby@
--
-- -   @n-ethereum-ropsten@
--
-- 'nodeConfiguration', 'createNode_nodeConfiguration' - The properties of a node configuration.
newCreateNode ::
  -- | 'clientRequestToken'
  Prelude.Text ->
  -- | 'networkId'
  Prelude.Text ->
  -- | 'nodeConfiguration'
  NodeConfiguration ->
  CreateNode
newCreateNode :: Text -> Text -> NodeConfiguration -> CreateNode
newCreateNode
  Text
pClientRequestToken_
  Text
pNetworkId_
  NodeConfiguration
pNodeConfiguration_ =
    CreateNode'
      { $sel:memberId:CreateNode' :: Maybe Text
memberId = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateNode' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:clientRequestToken:CreateNode' :: Text
clientRequestToken = Text
pClientRequestToken_,
        $sel:networkId:CreateNode' :: Text
networkId = Text
pNetworkId_,
        $sel:nodeConfiguration:CreateNode' :: NodeConfiguration
nodeConfiguration = NodeConfiguration
pNodeConfiguration_
      }

-- | The unique identifier of the member that owns this node.
--
-- Applies only to Hyperledger Fabric.
createNode_memberId :: Lens.Lens' CreateNode (Prelude.Maybe Prelude.Text)
createNode_memberId :: Lens' CreateNode (Maybe Text)
createNode_memberId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNode' {Maybe Text
memberId :: Maybe Text
$sel:memberId:CreateNode' :: CreateNode -> Maybe Text
memberId} -> Maybe Text
memberId) (\s :: CreateNode
s@CreateNode' {} Maybe Text
a -> CreateNode
s {$sel:memberId:CreateNode' :: Maybe Text
memberId = Maybe Text
a} :: CreateNode)

-- | Tags to assign to the node. Each tag consists of a key and optional
-- value.
--
-- When specifying tags during creation, you can specify multiple key-value
-- pairs in a single request, with an overall maximum of 50 tags added to
-- each resource.
--
-- 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/.
createNode_tags :: Lens.Lens' CreateNode (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createNode_tags :: Lens' CreateNode (Maybe (HashMap Text Text))
createNode_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNode' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateNode' :: CreateNode -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateNode
s@CreateNode' {} Maybe (HashMap Text Text)
a -> CreateNode
s {$sel:tags:CreateNode' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateNode) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the operation. An idempotent operation completes no more
-- than one time. This identifier is required only if you make a service
-- request directly using an HTTP client. It is generated automatically if
-- you use an Amazon Web Services SDK or the CLI.
createNode_clientRequestToken :: Lens.Lens' CreateNode Prelude.Text
createNode_clientRequestToken :: Lens' CreateNode Text
createNode_clientRequestToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNode' {Text
clientRequestToken :: Text
$sel:clientRequestToken:CreateNode' :: CreateNode -> Text
clientRequestToken} -> Text
clientRequestToken) (\s :: CreateNode
s@CreateNode' {} Text
a -> CreateNode
s {$sel:clientRequestToken:CreateNode' :: Text
clientRequestToken = Text
a} :: CreateNode)

-- | The unique identifier of the network for the node.
--
-- Ethereum public networks have the following @NetworkId@s:
--
-- -   @n-ethereum-mainnet@
--
-- -   @n-ethereum-goerli@
--
-- -   @n-ethereum-rinkeby@
--
-- -   @n-ethereum-ropsten@
createNode_networkId :: Lens.Lens' CreateNode Prelude.Text
createNode_networkId :: Lens' CreateNode Text
createNode_networkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNode' {Text
networkId :: Text
$sel:networkId:CreateNode' :: CreateNode -> Text
networkId} -> Text
networkId) (\s :: CreateNode
s@CreateNode' {} Text
a -> CreateNode
s {$sel:networkId:CreateNode' :: Text
networkId = Text
a} :: CreateNode)

-- | The properties of a node configuration.
createNode_nodeConfiguration :: Lens.Lens' CreateNode NodeConfiguration
createNode_nodeConfiguration :: Lens' CreateNode NodeConfiguration
createNode_nodeConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNode' {NodeConfiguration
nodeConfiguration :: NodeConfiguration
$sel:nodeConfiguration:CreateNode' :: CreateNode -> NodeConfiguration
nodeConfiguration} -> NodeConfiguration
nodeConfiguration) (\s :: CreateNode
s@CreateNode' {} NodeConfiguration
a -> CreateNode
s {$sel:nodeConfiguration:CreateNode' :: NodeConfiguration
nodeConfiguration = NodeConfiguration
a} :: CreateNode)

instance Core.AWSRequest CreateNode where
  type AWSResponse CreateNode = CreateNodeResponse
  request :: (Service -> Service) -> CreateNode -> Request CreateNode
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateNode
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateNode)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateNodeResponse
CreateNodeResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NodeId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateNode where
  hashWithSalt :: Int -> CreateNode -> Int
hashWithSalt Int
_salt CreateNode' {Maybe Text
Maybe (HashMap Text Text)
Text
NodeConfiguration
nodeConfiguration :: NodeConfiguration
networkId :: Text
clientRequestToken :: Text
tags :: Maybe (HashMap Text Text)
memberId :: Maybe Text
$sel:nodeConfiguration:CreateNode' :: CreateNode -> NodeConfiguration
$sel:networkId:CreateNode' :: CreateNode -> Text
$sel:clientRequestToken:CreateNode' :: CreateNode -> Text
$sel:tags:CreateNode' :: CreateNode -> Maybe (HashMap Text Text)
$sel:memberId:CreateNode' :: CreateNode -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
memberId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientRequestToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
networkId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NodeConfiguration
nodeConfiguration

instance Prelude.NFData CreateNode where
  rnf :: CreateNode -> ()
rnf CreateNode' {Maybe Text
Maybe (HashMap Text Text)
Text
NodeConfiguration
nodeConfiguration :: NodeConfiguration
networkId :: Text
clientRequestToken :: Text
tags :: Maybe (HashMap Text Text)
memberId :: Maybe Text
$sel:nodeConfiguration:CreateNode' :: CreateNode -> NodeConfiguration
$sel:networkId:CreateNode' :: CreateNode -> Text
$sel:clientRequestToken:CreateNode' :: CreateNode -> Text
$sel:tags:CreateNode' :: CreateNode -> Maybe (HashMap Text Text)
$sel:memberId:CreateNode' :: CreateNode -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
memberId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientRequestToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
networkId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NodeConfiguration
nodeConfiguration

instance Data.ToHeaders CreateNode where
  toHeaders :: CreateNode -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateNode where
  toJSON :: CreateNode -> Value
toJSON CreateNode' {Maybe Text
Maybe (HashMap Text Text)
Text
NodeConfiguration
nodeConfiguration :: NodeConfiguration
networkId :: Text
clientRequestToken :: Text
tags :: Maybe (HashMap Text Text)
memberId :: Maybe Text
$sel:nodeConfiguration:CreateNode' :: CreateNode -> NodeConfiguration
$sel:networkId:CreateNode' :: CreateNode -> Text
$sel:clientRequestToken:CreateNode' :: CreateNode -> Text
$sel:tags:CreateNode' :: CreateNode -> Maybe (HashMap Text Text)
$sel:memberId:CreateNode' :: CreateNode -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MemberId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
memberId,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ClientRequestToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clientRequestToken),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"NodeConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NodeConfiguration
nodeConfiguration)
          ]
      )

instance Data.ToPath CreateNode where
  toPath :: CreateNode -> ByteString
toPath CreateNode' {Maybe Text
Maybe (HashMap Text Text)
Text
NodeConfiguration
nodeConfiguration :: NodeConfiguration
networkId :: Text
clientRequestToken :: Text
tags :: Maybe (HashMap Text Text)
memberId :: Maybe Text
$sel:nodeConfiguration:CreateNode' :: CreateNode -> NodeConfiguration
$sel:networkId:CreateNode' :: CreateNode -> Text
$sel:clientRequestToken:CreateNode' :: CreateNode -> Text
$sel:tags:CreateNode' :: CreateNode -> Maybe (HashMap Text Text)
$sel:memberId:CreateNode' :: CreateNode -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/networks/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
networkId, ByteString
"/nodes"]

instance Data.ToQuery CreateNode where
  toQuery :: CreateNode -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateNodeResponse' smart constructor.
data CreateNodeResponse = CreateNodeResponse'
  { -- | The unique identifier of the node.
    CreateNodeResponse -> Maybe Text
nodeId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateNodeResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateNodeResponse -> CreateNodeResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNodeResponse -> CreateNodeResponse -> Bool
$c/= :: CreateNodeResponse -> CreateNodeResponse -> Bool
== :: CreateNodeResponse -> CreateNodeResponse -> Bool
$c== :: CreateNodeResponse -> CreateNodeResponse -> Bool
Prelude.Eq, ReadPrec [CreateNodeResponse]
ReadPrec CreateNodeResponse
Int -> ReadS CreateNodeResponse
ReadS [CreateNodeResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateNodeResponse]
$creadListPrec :: ReadPrec [CreateNodeResponse]
readPrec :: ReadPrec CreateNodeResponse
$creadPrec :: ReadPrec CreateNodeResponse
readList :: ReadS [CreateNodeResponse]
$creadList :: ReadS [CreateNodeResponse]
readsPrec :: Int -> ReadS CreateNodeResponse
$creadsPrec :: Int -> ReadS CreateNodeResponse
Prelude.Read, Int -> CreateNodeResponse -> ShowS
[CreateNodeResponse] -> ShowS
CreateNodeResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNodeResponse] -> ShowS
$cshowList :: [CreateNodeResponse] -> ShowS
show :: CreateNodeResponse -> String
$cshow :: CreateNodeResponse -> String
showsPrec :: Int -> CreateNodeResponse -> ShowS
$cshowsPrec :: Int -> CreateNodeResponse -> ShowS
Prelude.Show, forall x. Rep CreateNodeResponse x -> CreateNodeResponse
forall x. CreateNodeResponse -> Rep CreateNodeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateNodeResponse x -> CreateNodeResponse
$cfrom :: forall x. CreateNodeResponse -> Rep CreateNodeResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateNodeResponse' 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:
--
-- 'nodeId', 'createNodeResponse_nodeId' - The unique identifier of the node.
--
-- 'httpStatus', 'createNodeResponse_httpStatus' - The response's http status code.
newCreateNodeResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateNodeResponse
newCreateNodeResponse :: Int -> CreateNodeResponse
newCreateNodeResponse Int
pHttpStatus_ =
  CreateNodeResponse'
    { $sel:nodeId:CreateNodeResponse' :: Maybe Text
nodeId = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateNodeResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The unique identifier of the node.
createNodeResponse_nodeId :: Lens.Lens' CreateNodeResponse (Prelude.Maybe Prelude.Text)
createNodeResponse_nodeId :: Lens' CreateNodeResponse (Maybe Text)
createNodeResponse_nodeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNodeResponse' {Maybe Text
nodeId :: Maybe Text
$sel:nodeId:CreateNodeResponse' :: CreateNodeResponse -> Maybe Text
nodeId} -> Maybe Text
nodeId) (\s :: CreateNodeResponse
s@CreateNodeResponse' {} Maybe Text
a -> CreateNodeResponse
s {$sel:nodeId:CreateNodeResponse' :: Maybe Text
nodeId = Maybe Text
a} :: CreateNodeResponse)

-- | The response's http status code.
createNodeResponse_httpStatus :: Lens.Lens' CreateNodeResponse Prelude.Int
createNodeResponse_httpStatus :: Lens' CreateNodeResponse Int
createNodeResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNodeResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateNodeResponse' :: CreateNodeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateNodeResponse
s@CreateNodeResponse' {} Int
a -> CreateNodeResponse
s {$sel:httpStatus:CreateNodeResponse' :: Int
httpStatus = Int
a} :: CreateNodeResponse)

instance Prelude.NFData CreateNodeResponse where
  rnf :: CreateNodeResponse -> ()
rnf CreateNodeResponse' {Int
Maybe Text
httpStatus :: Int
nodeId :: Maybe Text
$sel:httpStatus:CreateNodeResponse' :: CreateNodeResponse -> Int
$sel:nodeId:CreateNodeResponse' :: CreateNodeResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nodeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus