{-# 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.NodeConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.ManagedBlockChain.Types.NodeLogPublishingConfiguration
import Amazonka.ManagedBlockChain.Types.StateDBType
import qualified Amazonka.Prelude as Prelude
data NodeConfiguration = NodeConfiguration'
{
NodeConfiguration -> Maybe NodeLogPublishingConfiguration
logPublishingConfiguration :: Prelude.Maybe NodeLogPublishingConfiguration,
NodeConfiguration -> Maybe StateDBType
stateDB :: Prelude.Maybe StateDBType,
NodeConfiguration -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
NodeConfiguration -> Text
instanceType :: Prelude.Text
}
deriving (NodeConfiguration -> NodeConfiguration -> Bool
(NodeConfiguration -> NodeConfiguration -> Bool)
-> (NodeConfiguration -> NodeConfiguration -> Bool)
-> Eq NodeConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NodeConfiguration -> NodeConfiguration -> Bool
$c/= :: NodeConfiguration -> NodeConfiguration -> Bool
== :: NodeConfiguration -> NodeConfiguration -> Bool
$c== :: NodeConfiguration -> NodeConfiguration -> Bool
Prelude.Eq, ReadPrec [NodeConfiguration]
ReadPrec NodeConfiguration
Int -> ReadS NodeConfiguration
ReadS [NodeConfiguration]
(Int -> ReadS NodeConfiguration)
-> ReadS [NodeConfiguration]
-> ReadPrec NodeConfiguration
-> ReadPrec [NodeConfiguration]
-> Read NodeConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NodeConfiguration]
$creadListPrec :: ReadPrec [NodeConfiguration]
readPrec :: ReadPrec NodeConfiguration
$creadPrec :: ReadPrec NodeConfiguration
readList :: ReadS [NodeConfiguration]
$creadList :: ReadS [NodeConfiguration]
readsPrec :: Int -> ReadS NodeConfiguration
$creadsPrec :: Int -> ReadS NodeConfiguration
Prelude.Read, Int -> NodeConfiguration -> ShowS
[NodeConfiguration] -> ShowS
NodeConfiguration -> String
(Int -> NodeConfiguration -> ShowS)
-> (NodeConfiguration -> String)
-> ([NodeConfiguration] -> ShowS)
-> Show NodeConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NodeConfiguration] -> ShowS
$cshowList :: [NodeConfiguration] -> ShowS
show :: NodeConfiguration -> String
$cshow :: NodeConfiguration -> String
showsPrec :: Int -> NodeConfiguration -> ShowS
$cshowsPrec :: Int -> NodeConfiguration -> ShowS
Prelude.Show, (forall x. NodeConfiguration -> Rep NodeConfiguration x)
-> (forall x. Rep NodeConfiguration x -> NodeConfiguration)
-> Generic NodeConfiguration
forall x. Rep NodeConfiguration x -> NodeConfiguration
forall x. NodeConfiguration -> Rep NodeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NodeConfiguration x -> NodeConfiguration
$cfrom :: forall x. NodeConfiguration -> Rep NodeConfiguration x
Prelude.Generic)
newNodeConfiguration ::
Prelude.Text ->
NodeConfiguration
newNodeConfiguration :: Text -> NodeConfiguration
newNodeConfiguration Text
pInstanceType_ =
NodeConfiguration' :: Maybe NodeLogPublishingConfiguration
-> Maybe StateDBType -> Maybe Text -> Text -> NodeConfiguration
NodeConfiguration'
{ $sel:logPublishingConfiguration:NodeConfiguration' :: Maybe NodeLogPublishingConfiguration
logPublishingConfiguration =
Maybe NodeLogPublishingConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:stateDB:NodeConfiguration' :: Maybe StateDBType
stateDB = Maybe StateDBType
forall a. Maybe a
Prelude.Nothing,
$sel:availabilityZone:NodeConfiguration' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceType:NodeConfiguration' :: Text
instanceType = Text
pInstanceType_
}
nodeConfiguration_logPublishingConfiguration :: Lens.Lens' NodeConfiguration (Prelude.Maybe NodeLogPublishingConfiguration)
nodeConfiguration_logPublishingConfiguration :: (Maybe NodeLogPublishingConfiguration
-> f (Maybe NodeLogPublishingConfiguration))
-> NodeConfiguration -> f NodeConfiguration
nodeConfiguration_logPublishingConfiguration = (NodeConfiguration -> Maybe NodeLogPublishingConfiguration)
-> (NodeConfiguration
-> Maybe NodeLogPublishingConfiguration -> NodeConfiguration)
-> Lens
NodeConfiguration
NodeConfiguration
(Maybe NodeLogPublishingConfiguration)
(Maybe NodeLogPublishingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeConfiguration' {Maybe NodeLogPublishingConfiguration
logPublishingConfiguration :: Maybe NodeLogPublishingConfiguration
$sel:logPublishingConfiguration:NodeConfiguration' :: NodeConfiguration -> Maybe NodeLogPublishingConfiguration
logPublishingConfiguration} -> Maybe NodeLogPublishingConfiguration
logPublishingConfiguration) (\s :: NodeConfiguration
s@NodeConfiguration' {} Maybe NodeLogPublishingConfiguration
a -> NodeConfiguration
s {$sel:logPublishingConfiguration:NodeConfiguration' :: Maybe NodeLogPublishingConfiguration
logPublishingConfiguration = Maybe NodeLogPublishingConfiguration
a} :: NodeConfiguration)
nodeConfiguration_stateDB :: Lens.Lens' NodeConfiguration (Prelude.Maybe StateDBType)
nodeConfiguration_stateDB :: (Maybe StateDBType -> f (Maybe StateDBType))
-> NodeConfiguration -> f NodeConfiguration
nodeConfiguration_stateDB = (NodeConfiguration -> Maybe StateDBType)
-> (NodeConfiguration -> Maybe StateDBType -> NodeConfiguration)
-> Lens
NodeConfiguration
NodeConfiguration
(Maybe StateDBType)
(Maybe StateDBType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeConfiguration' {Maybe StateDBType
stateDB :: Maybe StateDBType
$sel:stateDB:NodeConfiguration' :: NodeConfiguration -> Maybe StateDBType
stateDB} -> Maybe StateDBType
stateDB) (\s :: NodeConfiguration
s@NodeConfiguration' {} Maybe StateDBType
a -> NodeConfiguration
s {$sel:stateDB:NodeConfiguration' :: Maybe StateDBType
stateDB = Maybe StateDBType
a} :: NodeConfiguration)
nodeConfiguration_availabilityZone :: Lens.Lens' NodeConfiguration (Prelude.Maybe Prelude.Text)
nodeConfiguration_availabilityZone :: (Maybe Text -> f (Maybe Text))
-> NodeConfiguration -> f NodeConfiguration
nodeConfiguration_availabilityZone = (NodeConfiguration -> Maybe Text)
-> (NodeConfiguration -> Maybe Text -> NodeConfiguration)
-> Lens
NodeConfiguration NodeConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeConfiguration' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:NodeConfiguration' :: NodeConfiguration -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: NodeConfiguration
s@NodeConfiguration' {} Maybe Text
a -> NodeConfiguration
s {$sel:availabilityZone:NodeConfiguration' :: Maybe Text
availabilityZone = Maybe Text
a} :: NodeConfiguration)
nodeConfiguration_instanceType :: Lens.Lens' NodeConfiguration Prelude.Text
nodeConfiguration_instanceType :: (Text -> f Text) -> NodeConfiguration -> f NodeConfiguration
nodeConfiguration_instanceType = (NodeConfiguration -> Text)
-> (NodeConfiguration -> Text -> NodeConfiguration)
-> Lens NodeConfiguration NodeConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeConfiguration' {Text
instanceType :: Text
$sel:instanceType:NodeConfiguration' :: NodeConfiguration -> Text
instanceType} -> Text
instanceType) (\s :: NodeConfiguration
s@NodeConfiguration' {} Text
a -> NodeConfiguration
s {$sel:instanceType:NodeConfiguration' :: Text
instanceType = Text
a} :: NodeConfiguration)
instance Prelude.Hashable NodeConfiguration
instance Prelude.NFData NodeConfiguration
instance Core.ToJSON NodeConfiguration where
toJSON :: NodeConfiguration -> Value
toJSON NodeConfiguration' {Maybe Text
Maybe NodeLogPublishingConfiguration
Maybe StateDBType
Text
instanceType :: Text
availabilityZone :: Maybe Text
stateDB :: Maybe StateDBType
logPublishingConfiguration :: Maybe NodeLogPublishingConfiguration
$sel:instanceType:NodeConfiguration' :: NodeConfiguration -> Text
$sel:availabilityZone:NodeConfiguration' :: NodeConfiguration -> Maybe Text
$sel:stateDB:NodeConfiguration' :: NodeConfiguration -> Maybe StateDBType
$sel:logPublishingConfiguration:NodeConfiguration' :: NodeConfiguration -> Maybe NodeLogPublishingConfiguration
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"LogPublishingConfiguration" Text -> NodeLogPublishingConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NodeLogPublishingConfiguration -> Pair)
-> Maybe NodeLogPublishingConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NodeLogPublishingConfiguration
logPublishingConfiguration,
(Text
"StateDB" Text -> StateDBType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (StateDBType -> Pair) -> Maybe StateDBType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StateDBType
stateDB,
(Text
"AvailabilityZone" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
availabilityZone,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceType)
]
)