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

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

-- | Hyperledger Fabric configuration properties for the network.
--
-- /See:/ 'newNetworkFabricConfiguration' smart constructor.
data NetworkFabricConfiguration = NetworkFabricConfiguration'
  { -- | The edition of Amazon Managed Blockchain that the network uses. For more
    -- information, see
    -- <http://aws.amazon.com/managed-blockchain/pricing/ Amazon Managed Blockchain Pricing>.
    NetworkFabricConfiguration -> Edition
edition :: Edition
  }
  deriving (NetworkFabricConfiguration -> NetworkFabricConfiguration -> Bool
(NetworkFabricConfiguration -> NetworkFabricConfiguration -> Bool)
-> (NetworkFabricConfiguration
    -> NetworkFabricConfiguration -> Bool)
-> Eq NetworkFabricConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkFabricConfiguration -> NetworkFabricConfiguration -> Bool
$c/= :: NetworkFabricConfiguration -> NetworkFabricConfiguration -> Bool
== :: NetworkFabricConfiguration -> NetworkFabricConfiguration -> Bool
$c== :: NetworkFabricConfiguration -> NetworkFabricConfiguration -> Bool
Prelude.Eq, ReadPrec [NetworkFabricConfiguration]
ReadPrec NetworkFabricConfiguration
Int -> ReadS NetworkFabricConfiguration
ReadS [NetworkFabricConfiguration]
(Int -> ReadS NetworkFabricConfiguration)
-> ReadS [NetworkFabricConfiguration]
-> ReadPrec NetworkFabricConfiguration
-> ReadPrec [NetworkFabricConfiguration]
-> Read NetworkFabricConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkFabricConfiguration]
$creadListPrec :: ReadPrec [NetworkFabricConfiguration]
readPrec :: ReadPrec NetworkFabricConfiguration
$creadPrec :: ReadPrec NetworkFabricConfiguration
readList :: ReadS [NetworkFabricConfiguration]
$creadList :: ReadS [NetworkFabricConfiguration]
readsPrec :: Int -> ReadS NetworkFabricConfiguration
$creadsPrec :: Int -> ReadS NetworkFabricConfiguration
Prelude.Read, Int -> NetworkFabricConfiguration -> ShowS
[NetworkFabricConfiguration] -> ShowS
NetworkFabricConfiguration -> String
(Int -> NetworkFabricConfiguration -> ShowS)
-> (NetworkFabricConfiguration -> String)
-> ([NetworkFabricConfiguration] -> ShowS)
-> Show NetworkFabricConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkFabricConfiguration] -> ShowS
$cshowList :: [NetworkFabricConfiguration] -> ShowS
show :: NetworkFabricConfiguration -> String
$cshow :: NetworkFabricConfiguration -> String
showsPrec :: Int -> NetworkFabricConfiguration -> ShowS
$cshowsPrec :: Int -> NetworkFabricConfiguration -> ShowS
Prelude.Show, (forall x.
 NetworkFabricConfiguration -> Rep NetworkFabricConfiguration x)
-> (forall x.
    Rep NetworkFabricConfiguration x -> NetworkFabricConfiguration)
-> Generic NetworkFabricConfiguration
forall x.
Rep NetworkFabricConfiguration x -> NetworkFabricConfiguration
forall x.
NetworkFabricConfiguration -> Rep NetworkFabricConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NetworkFabricConfiguration x -> NetworkFabricConfiguration
$cfrom :: forall x.
NetworkFabricConfiguration -> Rep NetworkFabricConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'NetworkFabricConfiguration' 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:
--
-- 'edition', 'networkFabricConfiguration_edition' - The edition of Amazon Managed Blockchain that the network uses. For more
-- information, see
-- <http://aws.amazon.com/managed-blockchain/pricing/ Amazon Managed Blockchain Pricing>.
newNetworkFabricConfiguration ::
  -- | 'edition'
  Edition ->
  NetworkFabricConfiguration
newNetworkFabricConfiguration :: Edition -> NetworkFabricConfiguration
newNetworkFabricConfiguration Edition
pEdition_ =
  NetworkFabricConfiguration' :: Edition -> NetworkFabricConfiguration
NetworkFabricConfiguration' {$sel:edition:NetworkFabricConfiguration' :: Edition
edition = Edition
pEdition_}

-- | The edition of Amazon Managed Blockchain that the network uses. For more
-- information, see
-- <http://aws.amazon.com/managed-blockchain/pricing/ Amazon Managed Blockchain Pricing>.
networkFabricConfiguration_edition :: Lens.Lens' NetworkFabricConfiguration Edition
networkFabricConfiguration_edition :: (Edition -> f Edition)
-> NetworkFabricConfiguration -> f NetworkFabricConfiguration
networkFabricConfiguration_edition = (NetworkFabricConfiguration -> Edition)
-> (NetworkFabricConfiguration
    -> Edition -> NetworkFabricConfiguration)
-> Lens
     NetworkFabricConfiguration
     NetworkFabricConfiguration
     Edition
     Edition
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkFabricConfiguration' {Edition
edition :: Edition
$sel:edition:NetworkFabricConfiguration' :: NetworkFabricConfiguration -> Edition
edition} -> Edition
edition) (\s :: NetworkFabricConfiguration
s@NetworkFabricConfiguration' {} Edition
a -> NetworkFabricConfiguration
s {$sel:edition:NetworkFabricConfiguration' :: Edition
edition = Edition
a} :: NetworkFabricConfiguration)

instance Prelude.Hashable NetworkFabricConfiguration

instance Prelude.NFData NetworkFabricConfiguration

instance Core.ToJSON NetworkFabricConfiguration where
  toJSON :: NetworkFabricConfiguration -> Value
toJSON NetworkFabricConfiguration' {Edition
edition :: Edition
$sel:edition:NetworkFabricConfiguration' :: NetworkFabricConfiguration -> Edition
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Edition" Text -> Edition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Edition
edition)]
      )