{-# 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.MemberConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.ManagedBlockChain.Types.MemberFrameworkConfiguration
import Amazonka.ManagedBlockChain.Types.MemberLogPublishingConfiguration
import qualified Amazonka.Prelude as Prelude
data MemberConfiguration = MemberConfiguration'
{
MemberConfiguration -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
MemberConfiguration -> Maybe MemberLogPublishingConfiguration
logPublishingConfiguration :: Prelude.Maybe MemberLogPublishingConfiguration,
MemberConfiguration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
MemberConfiguration -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
MemberConfiguration -> Text
name :: Prelude.Text,
MemberConfiguration -> MemberFrameworkConfiguration
frameworkConfiguration :: MemberFrameworkConfiguration
}
deriving (MemberConfiguration -> MemberConfiguration -> Bool
(MemberConfiguration -> MemberConfiguration -> Bool)
-> (MemberConfiguration -> MemberConfiguration -> Bool)
-> Eq MemberConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MemberConfiguration -> MemberConfiguration -> Bool
$c/= :: MemberConfiguration -> MemberConfiguration -> Bool
== :: MemberConfiguration -> MemberConfiguration -> Bool
$c== :: MemberConfiguration -> MemberConfiguration -> Bool
Prelude.Eq, Int -> MemberConfiguration -> ShowS
[MemberConfiguration] -> ShowS
MemberConfiguration -> String
(Int -> MemberConfiguration -> ShowS)
-> (MemberConfiguration -> String)
-> ([MemberConfiguration] -> ShowS)
-> Show MemberConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MemberConfiguration] -> ShowS
$cshowList :: [MemberConfiguration] -> ShowS
show :: MemberConfiguration -> String
$cshow :: MemberConfiguration -> String
showsPrec :: Int -> MemberConfiguration -> ShowS
$cshowsPrec :: Int -> MemberConfiguration -> ShowS
Prelude.Show, (forall x. MemberConfiguration -> Rep MemberConfiguration x)
-> (forall x. Rep MemberConfiguration x -> MemberConfiguration)
-> Generic MemberConfiguration
forall x. Rep MemberConfiguration x -> MemberConfiguration
forall x. MemberConfiguration -> Rep MemberConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MemberConfiguration x -> MemberConfiguration
$cfrom :: forall x. MemberConfiguration -> Rep MemberConfiguration x
Prelude.Generic)
newMemberConfiguration ::
Prelude.Text ->
MemberFrameworkConfiguration ->
MemberConfiguration
newMemberConfiguration :: Text -> MemberFrameworkConfiguration -> MemberConfiguration
newMemberConfiguration
Text
pName_
MemberFrameworkConfiguration
pFrameworkConfiguration_ =
MemberConfiguration' :: Maybe Text
-> Maybe MemberLogPublishingConfiguration
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> MemberFrameworkConfiguration
-> MemberConfiguration
MemberConfiguration'
{ $sel:kmsKeyArn:MemberConfiguration' :: Maybe Text
kmsKeyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:logPublishingConfiguration:MemberConfiguration' :: Maybe MemberLogPublishingConfiguration
logPublishingConfiguration = Maybe MemberLogPublishingConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:description:MemberConfiguration' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:MemberConfiguration' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:name:MemberConfiguration' :: Text
name = Text
pName_,
$sel:frameworkConfiguration:MemberConfiguration' :: MemberFrameworkConfiguration
frameworkConfiguration = MemberFrameworkConfiguration
pFrameworkConfiguration_
}
memberConfiguration_kmsKeyArn :: Lens.Lens' MemberConfiguration (Prelude.Maybe Prelude.Text)
memberConfiguration_kmsKeyArn :: (Maybe Text -> f (Maybe Text))
-> MemberConfiguration -> f MemberConfiguration
memberConfiguration_kmsKeyArn = (MemberConfiguration -> Maybe Text)
-> (MemberConfiguration -> Maybe Text -> MemberConfiguration)
-> Lens
MemberConfiguration MemberConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberConfiguration' {Maybe Text
kmsKeyArn :: Maybe Text
$sel:kmsKeyArn:MemberConfiguration' :: MemberConfiguration -> Maybe Text
kmsKeyArn} -> Maybe Text
kmsKeyArn) (\s :: MemberConfiguration
s@MemberConfiguration' {} Maybe Text
a -> MemberConfiguration
s {$sel:kmsKeyArn:MemberConfiguration' :: Maybe Text
kmsKeyArn = Maybe Text
a} :: MemberConfiguration)
memberConfiguration_logPublishingConfiguration :: Lens.Lens' MemberConfiguration (Prelude.Maybe MemberLogPublishingConfiguration)
memberConfiguration_logPublishingConfiguration :: (Maybe MemberLogPublishingConfiguration
-> f (Maybe MemberLogPublishingConfiguration))
-> MemberConfiguration -> f MemberConfiguration
memberConfiguration_logPublishingConfiguration = (MemberConfiguration -> Maybe MemberLogPublishingConfiguration)
-> (MemberConfiguration
-> Maybe MemberLogPublishingConfiguration -> MemberConfiguration)
-> Lens
MemberConfiguration
MemberConfiguration
(Maybe MemberLogPublishingConfiguration)
(Maybe MemberLogPublishingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberConfiguration' {Maybe MemberLogPublishingConfiguration
logPublishingConfiguration :: Maybe MemberLogPublishingConfiguration
$sel:logPublishingConfiguration:MemberConfiguration' :: MemberConfiguration -> Maybe MemberLogPublishingConfiguration
logPublishingConfiguration} -> Maybe MemberLogPublishingConfiguration
logPublishingConfiguration) (\s :: MemberConfiguration
s@MemberConfiguration' {} Maybe MemberLogPublishingConfiguration
a -> MemberConfiguration
s {$sel:logPublishingConfiguration:MemberConfiguration' :: Maybe MemberLogPublishingConfiguration
logPublishingConfiguration = Maybe MemberLogPublishingConfiguration
a} :: MemberConfiguration)
memberConfiguration_description :: Lens.Lens' MemberConfiguration (Prelude.Maybe Prelude.Text)
memberConfiguration_description :: (Maybe Text -> f (Maybe Text))
-> MemberConfiguration -> f MemberConfiguration
memberConfiguration_description = (MemberConfiguration -> Maybe Text)
-> (MemberConfiguration -> Maybe Text -> MemberConfiguration)
-> Lens
MemberConfiguration MemberConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberConfiguration' {Maybe Text
description :: Maybe Text
$sel:description:MemberConfiguration' :: MemberConfiguration -> Maybe Text
description} -> Maybe Text
description) (\s :: MemberConfiguration
s@MemberConfiguration' {} Maybe Text
a -> MemberConfiguration
s {$sel:description:MemberConfiguration' :: Maybe Text
description = Maybe Text
a} :: MemberConfiguration)
memberConfiguration_tags :: Lens.Lens' MemberConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
memberConfiguration_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> MemberConfiguration -> f MemberConfiguration
memberConfiguration_tags = (MemberConfiguration -> Maybe (HashMap Text Text))
-> (MemberConfiguration
-> Maybe (HashMap Text Text) -> MemberConfiguration)
-> Lens
MemberConfiguration
MemberConfiguration
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberConfiguration' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:MemberConfiguration' :: MemberConfiguration -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: MemberConfiguration
s@MemberConfiguration' {} Maybe (HashMap Text Text)
a -> MemberConfiguration
s {$sel:tags:MemberConfiguration' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: MemberConfiguration) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> MemberConfiguration -> f MemberConfiguration)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> MemberConfiguration
-> f MemberConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
memberConfiguration_name :: Lens.Lens' MemberConfiguration Prelude.Text
memberConfiguration_name :: (Text -> f Text) -> MemberConfiguration -> f MemberConfiguration
memberConfiguration_name = (MemberConfiguration -> Text)
-> (MemberConfiguration -> Text -> MemberConfiguration)
-> Lens MemberConfiguration MemberConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberConfiguration' {Text
name :: Text
$sel:name:MemberConfiguration' :: MemberConfiguration -> Text
name} -> Text
name) (\s :: MemberConfiguration
s@MemberConfiguration' {} Text
a -> MemberConfiguration
s {$sel:name:MemberConfiguration' :: Text
name = Text
a} :: MemberConfiguration)
memberConfiguration_frameworkConfiguration :: Lens.Lens' MemberConfiguration MemberFrameworkConfiguration
memberConfiguration_frameworkConfiguration :: (MemberFrameworkConfiguration -> f MemberFrameworkConfiguration)
-> MemberConfiguration -> f MemberConfiguration
memberConfiguration_frameworkConfiguration = (MemberConfiguration -> MemberFrameworkConfiguration)
-> (MemberConfiguration
-> MemberFrameworkConfiguration -> MemberConfiguration)
-> Lens
MemberConfiguration
MemberConfiguration
MemberFrameworkConfiguration
MemberFrameworkConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MemberConfiguration' {MemberFrameworkConfiguration
frameworkConfiguration :: MemberFrameworkConfiguration
$sel:frameworkConfiguration:MemberConfiguration' :: MemberConfiguration -> MemberFrameworkConfiguration
frameworkConfiguration} -> MemberFrameworkConfiguration
frameworkConfiguration) (\s :: MemberConfiguration
s@MemberConfiguration' {} MemberFrameworkConfiguration
a -> MemberConfiguration
s {$sel:frameworkConfiguration:MemberConfiguration' :: MemberFrameworkConfiguration
frameworkConfiguration = MemberFrameworkConfiguration
a} :: MemberConfiguration)
instance Prelude.Hashable MemberConfiguration
instance Prelude.NFData MemberConfiguration
instance Core.ToJSON MemberConfiguration where
toJSON :: MemberConfiguration -> Value
toJSON MemberConfiguration' {Maybe Text
Maybe (HashMap Text Text)
Maybe MemberLogPublishingConfiguration
Text
MemberFrameworkConfiguration
frameworkConfiguration :: MemberFrameworkConfiguration
name :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
logPublishingConfiguration :: Maybe MemberLogPublishingConfiguration
kmsKeyArn :: Maybe Text
$sel:frameworkConfiguration:MemberConfiguration' :: MemberConfiguration -> MemberFrameworkConfiguration
$sel:name:MemberConfiguration' :: MemberConfiguration -> Text
$sel:tags:MemberConfiguration' :: MemberConfiguration -> Maybe (HashMap Text Text)
$sel:description:MemberConfiguration' :: MemberConfiguration -> Maybe Text
$sel:logPublishingConfiguration:MemberConfiguration' :: MemberConfiguration -> Maybe MemberLogPublishingConfiguration
$sel:kmsKeyArn:MemberConfiguration' :: MemberConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"KmsKeyArn" 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
kmsKeyArn,
(Text
"LogPublishingConfiguration" Text -> MemberLogPublishingConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(MemberLogPublishingConfiguration -> Pair)
-> Maybe MemberLogPublishingConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MemberLogPublishingConfiguration
logPublishingConfiguration,
(Text
"Description" 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
description,
(Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"FrameworkConfiguration"
Text -> MemberFrameworkConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MemberFrameworkConfiguration
frameworkConfiguration
)
]
)