{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ManagedBlockChain.Types.NodeLogPublishingConfiguration
import Amazonka.ManagedBlockChain.Types.StateDBType
import qualified Amazonka.Prelude as Prelude
data NodeConfiguration = NodeConfiguration'
{
NodeConfiguration -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
NodeConfiguration -> Maybe NodeLogPublishingConfiguration
logPublishingConfiguration :: Prelude.Maybe NodeLogPublishingConfiguration,
NodeConfiguration -> Maybe StateDBType
stateDB :: Prelude.Maybe StateDBType,
NodeConfiguration -> Text
instanceType :: Prelude.Text
}
deriving (NodeConfiguration -> NodeConfiguration -> Bool
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]
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
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. 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'
{ $sel:availabilityZone:NodeConfiguration' :: Maybe Text
availabilityZone =
forall a. Maybe a
Prelude.Nothing,
$sel:logPublishingConfiguration:NodeConfiguration' :: Maybe NodeLogPublishingConfiguration
logPublishingConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:stateDB:NodeConfiguration' :: Maybe StateDBType
stateDB = forall a. Maybe a
Prelude.Nothing,
$sel:instanceType:NodeConfiguration' :: Text
instanceType = Text
pInstanceType_
}
nodeConfiguration_availabilityZone :: Lens.Lens' NodeConfiguration (Prelude.Maybe Prelude.Text)
nodeConfiguration_availabilityZone :: Lens' NodeConfiguration (Maybe Text)
nodeConfiguration_availabilityZone = 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_logPublishingConfiguration :: Lens.Lens' NodeConfiguration (Prelude.Maybe NodeLogPublishingConfiguration)
nodeConfiguration_logPublishingConfiguration :: Lens' NodeConfiguration (Maybe NodeLogPublishingConfiguration)
nodeConfiguration_logPublishingConfiguration = 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 :: Lens' NodeConfiguration (Maybe StateDBType)
nodeConfiguration_stateDB = 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_instanceType :: Lens.Lens' NodeConfiguration Prelude.Text
nodeConfiguration_instanceType :: Lens' NodeConfiguration Text
nodeConfiguration_instanceType = 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 where
hashWithSalt :: Int -> NodeConfiguration -> Int
hashWithSalt Int
_salt NodeConfiguration' {Maybe Text
Maybe NodeLogPublishingConfiguration
Maybe StateDBType
Text
instanceType :: Text
stateDB :: Maybe StateDBType
logPublishingConfiguration :: Maybe NodeLogPublishingConfiguration
availabilityZone :: Maybe Text
$sel:instanceType:NodeConfiguration' :: NodeConfiguration -> Text
$sel:stateDB:NodeConfiguration' :: NodeConfiguration -> Maybe StateDBType
$sel:logPublishingConfiguration:NodeConfiguration' :: NodeConfiguration -> Maybe NodeLogPublishingConfiguration
$sel:availabilityZone:NodeConfiguration' :: NodeConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
availabilityZone
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NodeLogPublishingConfiguration
logPublishingConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StateDBType
stateDB
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceType
instance Prelude.NFData NodeConfiguration where
rnf :: NodeConfiguration -> ()
rnf NodeConfiguration' {Maybe Text
Maybe NodeLogPublishingConfiguration
Maybe StateDBType
Text
instanceType :: Text
stateDB :: Maybe StateDBType
logPublishingConfiguration :: Maybe NodeLogPublishingConfiguration
availabilityZone :: Maybe Text
$sel:instanceType:NodeConfiguration' :: NodeConfiguration -> Text
$sel:stateDB:NodeConfiguration' :: NodeConfiguration -> Maybe StateDBType
$sel:logPublishingConfiguration:NodeConfiguration' :: NodeConfiguration -> Maybe NodeLogPublishingConfiguration
$sel:availabilityZone:NodeConfiguration' :: NodeConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
availabilityZone
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NodeLogPublishingConfiguration
logPublishingConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StateDBType
stateDB
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
instanceType
instance Data.ToJSON NodeConfiguration where
toJSON :: NodeConfiguration -> Value
toJSON NodeConfiguration' {Maybe Text
Maybe NodeLogPublishingConfiguration
Maybe StateDBType
Text
instanceType :: Text
stateDB :: Maybe StateDBType
logPublishingConfiguration :: Maybe NodeLogPublishingConfiguration
availabilityZone :: Maybe Text
$sel:instanceType:NodeConfiguration' :: NodeConfiguration -> Text
$sel:stateDB:NodeConfiguration' :: NodeConfiguration -> Maybe StateDBType
$sel:logPublishingConfiguration:NodeConfiguration' :: NodeConfiguration -> Maybe NodeLogPublishingConfiguration
$sel:availabilityZone:NodeConfiguration' :: NodeConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AvailabilityZone" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
availabilityZone,
(Key
"LogPublishingConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NodeLogPublishingConfiguration
logPublishingConfiguration,
(Key
"StateDB" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StateDBType
stateDB,
forall a. a -> Maybe a
Prelude.Just (Key
"InstanceType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
instanceType)
]
)