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

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

-- | Configuration properties relevant to a member for the blockchain
-- framework that the Managed Blockchain network uses.
--
-- /See:/ 'newMemberFrameworkConfiguration' smart constructor.
data MemberFrameworkConfiguration = MemberFrameworkConfiguration'
  { -- | Attributes of Hyperledger Fabric for a member on a Managed Blockchain
    -- network that uses Hyperledger Fabric.
    MemberFrameworkConfiguration -> Maybe MemberFabricConfiguration
fabric :: Prelude.Maybe MemberFabricConfiguration
  }
  deriving (MemberFrameworkConfiguration
-> MemberFrameworkConfiguration -> Bool
(MemberFrameworkConfiguration
 -> MemberFrameworkConfiguration -> Bool)
-> (MemberFrameworkConfiguration
    -> MemberFrameworkConfiguration -> Bool)
-> Eq MemberFrameworkConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MemberFrameworkConfiguration
-> MemberFrameworkConfiguration -> Bool
$c/= :: MemberFrameworkConfiguration
-> MemberFrameworkConfiguration -> Bool
== :: MemberFrameworkConfiguration
-> MemberFrameworkConfiguration -> Bool
$c== :: MemberFrameworkConfiguration
-> MemberFrameworkConfiguration -> Bool
Prelude.Eq, Int -> MemberFrameworkConfiguration -> ShowS
[MemberFrameworkConfiguration] -> ShowS
MemberFrameworkConfiguration -> String
(Int -> MemberFrameworkConfiguration -> ShowS)
-> (MemberFrameworkConfiguration -> String)
-> ([MemberFrameworkConfiguration] -> ShowS)
-> Show MemberFrameworkConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MemberFrameworkConfiguration] -> ShowS
$cshowList :: [MemberFrameworkConfiguration] -> ShowS
show :: MemberFrameworkConfiguration -> String
$cshow :: MemberFrameworkConfiguration -> String
showsPrec :: Int -> MemberFrameworkConfiguration -> ShowS
$cshowsPrec :: Int -> MemberFrameworkConfiguration -> ShowS
Prelude.Show, (forall x.
 MemberFrameworkConfiguration -> Rep MemberFrameworkConfiguration x)
-> (forall x.
    Rep MemberFrameworkConfiguration x -> MemberFrameworkConfiguration)
-> Generic MemberFrameworkConfiguration
forall x.
Rep MemberFrameworkConfiguration x -> MemberFrameworkConfiguration
forall x.
MemberFrameworkConfiguration -> Rep MemberFrameworkConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MemberFrameworkConfiguration x -> MemberFrameworkConfiguration
$cfrom :: forall x.
MemberFrameworkConfiguration -> Rep MemberFrameworkConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'MemberFrameworkConfiguration' 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', 'memberFrameworkConfiguration_fabric' - Attributes of Hyperledger Fabric for a member on a Managed Blockchain
-- network that uses Hyperledger Fabric.
newMemberFrameworkConfiguration ::
  MemberFrameworkConfiguration
newMemberFrameworkConfiguration :: MemberFrameworkConfiguration
newMemberFrameworkConfiguration =
  MemberFrameworkConfiguration' :: Maybe MemberFabricConfiguration -> MemberFrameworkConfiguration
MemberFrameworkConfiguration'
    { $sel:fabric:MemberFrameworkConfiguration' :: Maybe MemberFabricConfiguration
fabric =
        Maybe MemberFabricConfiguration
forall a. Maybe a
Prelude.Nothing
    }

-- | Attributes of Hyperledger Fabric for a member on a Managed Blockchain
-- network that uses Hyperledger Fabric.
memberFrameworkConfiguration_fabric :: Lens.Lens' MemberFrameworkConfiguration (Prelude.Maybe MemberFabricConfiguration)
memberFrameworkConfiguration_fabric :: (Maybe MemberFabricConfiguration
 -> f (Maybe MemberFabricConfiguration))
-> MemberFrameworkConfiguration -> f MemberFrameworkConfiguration
memberFrameworkConfiguration_fabric = (MemberFrameworkConfiguration -> Maybe MemberFabricConfiguration)
-> (MemberFrameworkConfiguration
    -> Maybe MemberFabricConfiguration -> MemberFrameworkConfiguration)
-> Lens
     MemberFrameworkConfiguration
     MemberFrameworkConfiguration
     (Maybe MemberFabricConfiguration)
     (Maybe MemberFabricConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberFrameworkConfiguration' {Maybe MemberFabricConfiguration
fabric :: Maybe MemberFabricConfiguration
$sel:fabric:MemberFrameworkConfiguration' :: MemberFrameworkConfiguration -> Maybe MemberFabricConfiguration
fabric} -> Maybe MemberFabricConfiguration
fabric) (\s :: MemberFrameworkConfiguration
s@MemberFrameworkConfiguration' {} Maybe MemberFabricConfiguration
a -> MemberFrameworkConfiguration
s {$sel:fabric:MemberFrameworkConfiguration' :: Maybe MemberFabricConfiguration
fabric = Maybe MemberFabricConfiguration
a} :: MemberFrameworkConfiguration)

instance
  Prelude.Hashable
    MemberFrameworkConfiguration

instance Prelude.NFData MemberFrameworkConfiguration

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