{-# 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.NetworkFrameworkConfiguration
-- 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.NetworkFrameworkConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.ManagedBlockChain.Types.NetworkFabricConfiguration
import qualified Amazonka.Prelude as Prelude

-- | Configuration properties relevant to the network for the blockchain
-- framework that the network uses.
--
-- /See:/ 'newNetworkFrameworkConfiguration' smart constructor.
data NetworkFrameworkConfiguration = NetworkFrameworkConfiguration'
  { -- | Hyperledger Fabric configuration properties for a Managed Blockchain
    -- network that uses Hyperledger Fabric.
    NetworkFrameworkConfiguration -> Maybe NetworkFabricConfiguration
fabric :: Prelude.Maybe NetworkFabricConfiguration
  }
  deriving (NetworkFrameworkConfiguration
-> NetworkFrameworkConfiguration -> Bool
(NetworkFrameworkConfiguration
 -> NetworkFrameworkConfiguration -> Bool)
-> (NetworkFrameworkConfiguration
    -> NetworkFrameworkConfiguration -> Bool)
-> Eq NetworkFrameworkConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkFrameworkConfiguration
-> NetworkFrameworkConfiguration -> Bool
$c/= :: NetworkFrameworkConfiguration
-> NetworkFrameworkConfiguration -> Bool
== :: NetworkFrameworkConfiguration
-> NetworkFrameworkConfiguration -> Bool
$c== :: NetworkFrameworkConfiguration
-> NetworkFrameworkConfiguration -> Bool
Prelude.Eq, ReadPrec [NetworkFrameworkConfiguration]
ReadPrec NetworkFrameworkConfiguration
Int -> ReadS NetworkFrameworkConfiguration
ReadS [NetworkFrameworkConfiguration]
(Int -> ReadS NetworkFrameworkConfiguration)
-> ReadS [NetworkFrameworkConfiguration]
-> ReadPrec NetworkFrameworkConfiguration
-> ReadPrec [NetworkFrameworkConfiguration]
-> Read NetworkFrameworkConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkFrameworkConfiguration]
$creadListPrec :: ReadPrec [NetworkFrameworkConfiguration]
readPrec :: ReadPrec NetworkFrameworkConfiguration
$creadPrec :: ReadPrec NetworkFrameworkConfiguration
readList :: ReadS [NetworkFrameworkConfiguration]
$creadList :: ReadS [NetworkFrameworkConfiguration]
readsPrec :: Int -> ReadS NetworkFrameworkConfiguration
$creadsPrec :: Int -> ReadS NetworkFrameworkConfiguration
Prelude.Read, Int -> NetworkFrameworkConfiguration -> ShowS
[NetworkFrameworkConfiguration] -> ShowS
NetworkFrameworkConfiguration -> String
(Int -> NetworkFrameworkConfiguration -> ShowS)
-> (NetworkFrameworkConfiguration -> String)
-> ([NetworkFrameworkConfiguration] -> ShowS)
-> Show NetworkFrameworkConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkFrameworkConfiguration] -> ShowS
$cshowList :: [NetworkFrameworkConfiguration] -> ShowS
show :: NetworkFrameworkConfiguration -> String
$cshow :: NetworkFrameworkConfiguration -> String
showsPrec :: Int -> NetworkFrameworkConfiguration -> ShowS
$cshowsPrec :: Int -> NetworkFrameworkConfiguration -> ShowS
Prelude.Show, (forall x.
 NetworkFrameworkConfiguration
 -> Rep NetworkFrameworkConfiguration x)
-> (forall x.
    Rep NetworkFrameworkConfiguration x
    -> NetworkFrameworkConfiguration)
-> Generic NetworkFrameworkConfiguration
forall x.
Rep NetworkFrameworkConfiguration x
-> NetworkFrameworkConfiguration
forall x.
NetworkFrameworkConfiguration
-> Rep NetworkFrameworkConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NetworkFrameworkConfiguration x
-> NetworkFrameworkConfiguration
$cfrom :: forall x.
NetworkFrameworkConfiguration
-> Rep NetworkFrameworkConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'NetworkFrameworkConfiguration' 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:
--
-- 'fabric', 'networkFrameworkConfiguration_fabric' - Hyperledger Fabric configuration properties for a Managed Blockchain
-- network that uses Hyperledger Fabric.
newNetworkFrameworkConfiguration ::
  NetworkFrameworkConfiguration
newNetworkFrameworkConfiguration :: NetworkFrameworkConfiguration
newNetworkFrameworkConfiguration =
  NetworkFrameworkConfiguration' :: Maybe NetworkFabricConfiguration -> NetworkFrameworkConfiguration
NetworkFrameworkConfiguration'
    { $sel:fabric:NetworkFrameworkConfiguration' :: Maybe NetworkFabricConfiguration
fabric =
        Maybe NetworkFabricConfiguration
forall a. Maybe a
Prelude.Nothing
    }

-- | Hyperledger Fabric configuration properties for a Managed Blockchain
-- network that uses Hyperledger Fabric.
networkFrameworkConfiguration_fabric :: Lens.Lens' NetworkFrameworkConfiguration (Prelude.Maybe NetworkFabricConfiguration)
networkFrameworkConfiguration_fabric :: (Maybe NetworkFabricConfiguration
 -> f (Maybe NetworkFabricConfiguration))
-> NetworkFrameworkConfiguration -> f NetworkFrameworkConfiguration
networkFrameworkConfiguration_fabric = (NetworkFrameworkConfiguration -> Maybe NetworkFabricConfiguration)
-> (NetworkFrameworkConfiguration
    -> Maybe NetworkFabricConfiguration
    -> NetworkFrameworkConfiguration)
-> Lens
     NetworkFrameworkConfiguration
     NetworkFrameworkConfiguration
     (Maybe NetworkFabricConfiguration)
     (Maybe NetworkFabricConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkFrameworkConfiguration' {Maybe NetworkFabricConfiguration
fabric :: Maybe NetworkFabricConfiguration
$sel:fabric:NetworkFrameworkConfiguration' :: NetworkFrameworkConfiguration -> Maybe NetworkFabricConfiguration
fabric} -> Maybe NetworkFabricConfiguration
fabric) (\s :: NetworkFrameworkConfiguration
s@NetworkFrameworkConfiguration' {} Maybe NetworkFabricConfiguration
a -> NetworkFrameworkConfiguration
s {$sel:fabric:NetworkFrameworkConfiguration' :: Maybe NetworkFabricConfiguration
fabric = Maybe NetworkFabricConfiguration
a} :: NetworkFrameworkConfiguration)

instance
  Prelude.Hashable
    NetworkFrameworkConfiguration

instance Prelude.NFData NetworkFrameworkConfiguration

instance Core.ToJSON NetworkFrameworkConfiguration where
  toJSON :: NetworkFrameworkConfiguration -> Value
toJSON NetworkFrameworkConfiguration' {Maybe NetworkFabricConfiguration
fabric :: Maybe NetworkFabricConfiguration
$sel:fabric:NetworkFrameworkConfiguration' :: NetworkFrameworkConfiguration -> Maybe NetworkFabricConfiguration
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"Fabric" Text -> NetworkFabricConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NetworkFabricConfiguration -> Pair)
-> Maybe NetworkFabricConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NetworkFabricConfiguration
fabric]
      )