{-# 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 #-}
module Amazonka.ManagedBlockChain.Types.NodeFabricLogPublishingConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.ManagedBlockChain.Types.LogConfigurations
import qualified Amazonka.Prelude as Prelude
data NodeFabricLogPublishingConfiguration = NodeFabricLogPublishingConfiguration'
{
NodeFabricLogPublishingConfiguration -> Maybe LogConfigurations
chaincodeLogs :: Prelude.Maybe LogConfigurations,
NodeFabricLogPublishingConfiguration -> Maybe LogConfigurations
peerLogs :: Prelude.Maybe LogConfigurations
}
deriving (NodeFabricLogPublishingConfiguration
-> NodeFabricLogPublishingConfiguration -> Bool
(NodeFabricLogPublishingConfiguration
-> NodeFabricLogPublishingConfiguration -> Bool)
-> (NodeFabricLogPublishingConfiguration
-> NodeFabricLogPublishingConfiguration -> Bool)
-> Eq NodeFabricLogPublishingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NodeFabricLogPublishingConfiguration
-> NodeFabricLogPublishingConfiguration -> Bool
$c/= :: NodeFabricLogPublishingConfiguration
-> NodeFabricLogPublishingConfiguration -> Bool
== :: NodeFabricLogPublishingConfiguration
-> NodeFabricLogPublishingConfiguration -> Bool
$c== :: NodeFabricLogPublishingConfiguration
-> NodeFabricLogPublishingConfiguration -> Bool
Prelude.Eq, ReadPrec [NodeFabricLogPublishingConfiguration]
ReadPrec NodeFabricLogPublishingConfiguration
Int -> ReadS NodeFabricLogPublishingConfiguration
ReadS [NodeFabricLogPublishingConfiguration]
(Int -> ReadS NodeFabricLogPublishingConfiguration)
-> ReadS [NodeFabricLogPublishingConfiguration]
-> ReadPrec NodeFabricLogPublishingConfiguration
-> ReadPrec [NodeFabricLogPublishingConfiguration]
-> Read NodeFabricLogPublishingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NodeFabricLogPublishingConfiguration]
$creadListPrec :: ReadPrec [NodeFabricLogPublishingConfiguration]
readPrec :: ReadPrec NodeFabricLogPublishingConfiguration
$creadPrec :: ReadPrec NodeFabricLogPublishingConfiguration
readList :: ReadS [NodeFabricLogPublishingConfiguration]
$creadList :: ReadS [NodeFabricLogPublishingConfiguration]
readsPrec :: Int -> ReadS NodeFabricLogPublishingConfiguration
$creadsPrec :: Int -> ReadS NodeFabricLogPublishingConfiguration
Prelude.Read, Int -> NodeFabricLogPublishingConfiguration -> ShowS
[NodeFabricLogPublishingConfiguration] -> ShowS
NodeFabricLogPublishingConfiguration -> String
(Int -> NodeFabricLogPublishingConfiguration -> ShowS)
-> (NodeFabricLogPublishingConfiguration -> String)
-> ([NodeFabricLogPublishingConfiguration] -> ShowS)
-> Show NodeFabricLogPublishingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NodeFabricLogPublishingConfiguration] -> ShowS
$cshowList :: [NodeFabricLogPublishingConfiguration] -> ShowS
show :: NodeFabricLogPublishingConfiguration -> String
$cshow :: NodeFabricLogPublishingConfiguration -> String
showsPrec :: Int -> NodeFabricLogPublishingConfiguration -> ShowS
$cshowsPrec :: Int -> NodeFabricLogPublishingConfiguration -> ShowS
Prelude.Show, (forall x.
NodeFabricLogPublishingConfiguration
-> Rep NodeFabricLogPublishingConfiguration x)
-> (forall x.
Rep NodeFabricLogPublishingConfiguration x
-> NodeFabricLogPublishingConfiguration)
-> Generic NodeFabricLogPublishingConfiguration
forall x.
Rep NodeFabricLogPublishingConfiguration x
-> NodeFabricLogPublishingConfiguration
forall x.
NodeFabricLogPublishingConfiguration
-> Rep NodeFabricLogPublishingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NodeFabricLogPublishingConfiguration x
-> NodeFabricLogPublishingConfiguration
$cfrom :: forall x.
NodeFabricLogPublishingConfiguration
-> Rep NodeFabricLogPublishingConfiguration x
Prelude.Generic)
newNodeFabricLogPublishingConfiguration ::
NodeFabricLogPublishingConfiguration
newNodeFabricLogPublishingConfiguration :: NodeFabricLogPublishingConfiguration
newNodeFabricLogPublishingConfiguration =
NodeFabricLogPublishingConfiguration' :: Maybe LogConfigurations
-> Maybe LogConfigurations -> NodeFabricLogPublishingConfiguration
NodeFabricLogPublishingConfiguration'
{ $sel:chaincodeLogs:NodeFabricLogPublishingConfiguration' :: Maybe LogConfigurations
chaincodeLogs =
Maybe LogConfigurations
forall a. Maybe a
Prelude.Nothing,
$sel:peerLogs:NodeFabricLogPublishingConfiguration' :: Maybe LogConfigurations
peerLogs = Maybe LogConfigurations
forall a. Maybe a
Prelude.Nothing
}
nodeFabricLogPublishingConfiguration_chaincodeLogs :: Lens.Lens' NodeFabricLogPublishingConfiguration (Prelude.Maybe LogConfigurations)
nodeFabricLogPublishingConfiguration_chaincodeLogs :: (Maybe LogConfigurations -> f (Maybe LogConfigurations))
-> NodeFabricLogPublishingConfiguration
-> f NodeFabricLogPublishingConfiguration
nodeFabricLogPublishingConfiguration_chaincodeLogs = (NodeFabricLogPublishingConfiguration -> Maybe LogConfigurations)
-> (NodeFabricLogPublishingConfiguration
-> Maybe LogConfigurations -> NodeFabricLogPublishingConfiguration)
-> Lens
NodeFabricLogPublishingConfiguration
NodeFabricLogPublishingConfiguration
(Maybe LogConfigurations)
(Maybe LogConfigurations)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeFabricLogPublishingConfiguration' {Maybe LogConfigurations
chaincodeLogs :: Maybe LogConfigurations
$sel:chaincodeLogs:NodeFabricLogPublishingConfiguration' :: NodeFabricLogPublishingConfiguration -> Maybe LogConfigurations
chaincodeLogs} -> Maybe LogConfigurations
chaincodeLogs) (\s :: NodeFabricLogPublishingConfiguration
s@NodeFabricLogPublishingConfiguration' {} Maybe LogConfigurations
a -> NodeFabricLogPublishingConfiguration
s {$sel:chaincodeLogs:NodeFabricLogPublishingConfiguration' :: Maybe LogConfigurations
chaincodeLogs = Maybe LogConfigurations
a} :: NodeFabricLogPublishingConfiguration)
nodeFabricLogPublishingConfiguration_peerLogs :: Lens.Lens' NodeFabricLogPublishingConfiguration (Prelude.Maybe LogConfigurations)
nodeFabricLogPublishingConfiguration_peerLogs :: (Maybe LogConfigurations -> f (Maybe LogConfigurations))
-> NodeFabricLogPublishingConfiguration
-> f NodeFabricLogPublishingConfiguration
nodeFabricLogPublishingConfiguration_peerLogs = (NodeFabricLogPublishingConfiguration -> Maybe LogConfigurations)
-> (NodeFabricLogPublishingConfiguration
-> Maybe LogConfigurations -> NodeFabricLogPublishingConfiguration)
-> Lens
NodeFabricLogPublishingConfiguration
NodeFabricLogPublishingConfiguration
(Maybe LogConfigurations)
(Maybe LogConfigurations)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeFabricLogPublishingConfiguration' {Maybe LogConfigurations
peerLogs :: Maybe LogConfigurations
$sel:peerLogs:NodeFabricLogPublishingConfiguration' :: NodeFabricLogPublishingConfiguration -> Maybe LogConfigurations
peerLogs} -> Maybe LogConfigurations
peerLogs) (\s :: NodeFabricLogPublishingConfiguration
s@NodeFabricLogPublishingConfiguration' {} Maybe LogConfigurations
a -> NodeFabricLogPublishingConfiguration
s {$sel:peerLogs:NodeFabricLogPublishingConfiguration' :: Maybe LogConfigurations
peerLogs = Maybe LogConfigurations
a} :: NodeFabricLogPublishingConfiguration)
instance
Core.FromJSON
NodeFabricLogPublishingConfiguration
where
parseJSON :: Value -> Parser NodeFabricLogPublishingConfiguration
parseJSON =
String
-> (Object -> Parser NodeFabricLogPublishingConfiguration)
-> Value
-> Parser NodeFabricLogPublishingConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NodeFabricLogPublishingConfiguration"
( \Object
x ->
Maybe LogConfigurations
-> Maybe LogConfigurations -> NodeFabricLogPublishingConfiguration
NodeFabricLogPublishingConfiguration'
(Maybe LogConfigurations
-> Maybe LogConfigurations -> NodeFabricLogPublishingConfiguration)
-> Parser (Maybe LogConfigurations)
-> Parser
(Maybe LogConfigurations -> NodeFabricLogPublishingConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe LogConfigurations)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ChaincodeLogs")
Parser
(Maybe LogConfigurations -> NodeFabricLogPublishingConfiguration)
-> Parser (Maybe LogConfigurations)
-> Parser NodeFabricLogPublishingConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LogConfigurations)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PeerLogs")
)
instance
Prelude.Hashable
NodeFabricLogPublishingConfiguration
instance
Prelude.NFData
NodeFabricLogPublishingConfiguration
instance
Core.ToJSON
NodeFabricLogPublishingConfiguration
where
toJSON :: NodeFabricLogPublishingConfiguration -> Value
toJSON NodeFabricLogPublishingConfiguration' {Maybe LogConfigurations
peerLogs :: Maybe LogConfigurations
chaincodeLogs :: Maybe LogConfigurations
$sel:peerLogs:NodeFabricLogPublishingConfiguration' :: NodeFabricLogPublishingConfiguration -> Maybe LogConfigurations
$sel:chaincodeLogs:NodeFabricLogPublishingConfiguration' :: NodeFabricLogPublishingConfiguration -> Maybe LogConfigurations
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ChaincodeLogs" Text -> LogConfigurations -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LogConfigurations -> Pair)
-> Maybe LogConfigurations -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LogConfigurations
chaincodeLogs,
(Text
"PeerLogs" Text -> LogConfigurations -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LogConfigurations -> Pair)
-> Maybe LogConfigurations -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LogConfigurations
peerLogs
]
)