{-# 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.Kafka.Types.BrokerNodeGroupInfo where
import qualified Amazonka.Core as Core
import Amazonka.Kafka.Types.BrokerAZDistribution
import Amazonka.Kafka.Types.StorageInfo
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BrokerNodeGroupInfo = BrokerNodeGroupInfo'
{
BrokerNodeGroupInfo -> Maybe StorageInfo
storageInfo :: Prelude.Maybe StorageInfo,
BrokerNodeGroupInfo -> Maybe BrokerAZDistribution
brokerAZDistribution :: Prelude.Maybe BrokerAZDistribution,
BrokerNodeGroupInfo -> Maybe [Text]
securityGroups :: Prelude.Maybe [Prelude.Text],
BrokerNodeGroupInfo -> [Text]
clientSubnets :: [Prelude.Text],
BrokerNodeGroupInfo -> Text
instanceType :: Prelude.Text
}
deriving (BrokerNodeGroupInfo -> BrokerNodeGroupInfo -> Bool
(BrokerNodeGroupInfo -> BrokerNodeGroupInfo -> Bool)
-> (BrokerNodeGroupInfo -> BrokerNodeGroupInfo -> Bool)
-> Eq BrokerNodeGroupInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BrokerNodeGroupInfo -> BrokerNodeGroupInfo -> Bool
$c/= :: BrokerNodeGroupInfo -> BrokerNodeGroupInfo -> Bool
== :: BrokerNodeGroupInfo -> BrokerNodeGroupInfo -> Bool
$c== :: BrokerNodeGroupInfo -> BrokerNodeGroupInfo -> Bool
Prelude.Eq, ReadPrec [BrokerNodeGroupInfo]
ReadPrec BrokerNodeGroupInfo
Int -> ReadS BrokerNodeGroupInfo
ReadS [BrokerNodeGroupInfo]
(Int -> ReadS BrokerNodeGroupInfo)
-> ReadS [BrokerNodeGroupInfo]
-> ReadPrec BrokerNodeGroupInfo
-> ReadPrec [BrokerNodeGroupInfo]
-> Read BrokerNodeGroupInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BrokerNodeGroupInfo]
$creadListPrec :: ReadPrec [BrokerNodeGroupInfo]
readPrec :: ReadPrec BrokerNodeGroupInfo
$creadPrec :: ReadPrec BrokerNodeGroupInfo
readList :: ReadS [BrokerNodeGroupInfo]
$creadList :: ReadS [BrokerNodeGroupInfo]
readsPrec :: Int -> ReadS BrokerNodeGroupInfo
$creadsPrec :: Int -> ReadS BrokerNodeGroupInfo
Prelude.Read, Int -> BrokerNodeGroupInfo -> ShowS
[BrokerNodeGroupInfo] -> ShowS
BrokerNodeGroupInfo -> String
(Int -> BrokerNodeGroupInfo -> ShowS)
-> (BrokerNodeGroupInfo -> String)
-> ([BrokerNodeGroupInfo] -> ShowS)
-> Show BrokerNodeGroupInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BrokerNodeGroupInfo] -> ShowS
$cshowList :: [BrokerNodeGroupInfo] -> ShowS
show :: BrokerNodeGroupInfo -> String
$cshow :: BrokerNodeGroupInfo -> String
showsPrec :: Int -> BrokerNodeGroupInfo -> ShowS
$cshowsPrec :: Int -> BrokerNodeGroupInfo -> ShowS
Prelude.Show, (forall x. BrokerNodeGroupInfo -> Rep BrokerNodeGroupInfo x)
-> (forall x. Rep BrokerNodeGroupInfo x -> BrokerNodeGroupInfo)
-> Generic BrokerNodeGroupInfo
forall x. Rep BrokerNodeGroupInfo x -> BrokerNodeGroupInfo
forall x. BrokerNodeGroupInfo -> Rep BrokerNodeGroupInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BrokerNodeGroupInfo x -> BrokerNodeGroupInfo
$cfrom :: forall x. BrokerNodeGroupInfo -> Rep BrokerNodeGroupInfo x
Prelude.Generic)
newBrokerNodeGroupInfo ::
Prelude.Text ->
BrokerNodeGroupInfo
newBrokerNodeGroupInfo :: Text -> BrokerNodeGroupInfo
newBrokerNodeGroupInfo Text
pInstanceType_ =
BrokerNodeGroupInfo' :: Maybe StorageInfo
-> Maybe BrokerAZDistribution
-> Maybe [Text]
-> [Text]
-> Text
-> BrokerNodeGroupInfo
BrokerNodeGroupInfo'
{ $sel:storageInfo:BrokerNodeGroupInfo' :: Maybe StorageInfo
storageInfo = Maybe StorageInfo
forall a. Maybe a
Prelude.Nothing,
$sel:brokerAZDistribution:BrokerNodeGroupInfo' :: Maybe BrokerAZDistribution
brokerAZDistribution = Maybe BrokerAZDistribution
forall a. Maybe a
Prelude.Nothing,
$sel:securityGroups:BrokerNodeGroupInfo' :: Maybe [Text]
securityGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:clientSubnets:BrokerNodeGroupInfo' :: [Text]
clientSubnets = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:instanceType:BrokerNodeGroupInfo' :: Text
instanceType = Text
pInstanceType_
}
brokerNodeGroupInfo_storageInfo :: Lens.Lens' BrokerNodeGroupInfo (Prelude.Maybe StorageInfo)
brokerNodeGroupInfo_storageInfo :: (Maybe StorageInfo -> f (Maybe StorageInfo))
-> BrokerNodeGroupInfo -> f BrokerNodeGroupInfo
brokerNodeGroupInfo_storageInfo = (BrokerNodeGroupInfo -> Maybe StorageInfo)
-> (BrokerNodeGroupInfo
-> Maybe StorageInfo -> BrokerNodeGroupInfo)
-> Lens
BrokerNodeGroupInfo
BrokerNodeGroupInfo
(Maybe StorageInfo)
(Maybe StorageInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerNodeGroupInfo' {Maybe StorageInfo
storageInfo :: Maybe StorageInfo
$sel:storageInfo:BrokerNodeGroupInfo' :: BrokerNodeGroupInfo -> Maybe StorageInfo
storageInfo} -> Maybe StorageInfo
storageInfo) (\s :: BrokerNodeGroupInfo
s@BrokerNodeGroupInfo' {} Maybe StorageInfo
a -> BrokerNodeGroupInfo
s {$sel:storageInfo:BrokerNodeGroupInfo' :: Maybe StorageInfo
storageInfo = Maybe StorageInfo
a} :: BrokerNodeGroupInfo)
brokerNodeGroupInfo_brokerAZDistribution :: Lens.Lens' BrokerNodeGroupInfo (Prelude.Maybe BrokerAZDistribution)
brokerNodeGroupInfo_brokerAZDistribution :: (Maybe BrokerAZDistribution -> f (Maybe BrokerAZDistribution))
-> BrokerNodeGroupInfo -> f BrokerNodeGroupInfo
brokerNodeGroupInfo_brokerAZDistribution = (BrokerNodeGroupInfo -> Maybe BrokerAZDistribution)
-> (BrokerNodeGroupInfo
-> Maybe BrokerAZDistribution -> BrokerNodeGroupInfo)
-> Lens
BrokerNodeGroupInfo
BrokerNodeGroupInfo
(Maybe BrokerAZDistribution)
(Maybe BrokerAZDistribution)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerNodeGroupInfo' {Maybe BrokerAZDistribution
brokerAZDistribution :: Maybe BrokerAZDistribution
$sel:brokerAZDistribution:BrokerNodeGroupInfo' :: BrokerNodeGroupInfo -> Maybe BrokerAZDistribution
brokerAZDistribution} -> Maybe BrokerAZDistribution
brokerAZDistribution) (\s :: BrokerNodeGroupInfo
s@BrokerNodeGroupInfo' {} Maybe BrokerAZDistribution
a -> BrokerNodeGroupInfo
s {$sel:brokerAZDistribution:BrokerNodeGroupInfo' :: Maybe BrokerAZDistribution
brokerAZDistribution = Maybe BrokerAZDistribution
a} :: BrokerNodeGroupInfo)
brokerNodeGroupInfo_securityGroups :: Lens.Lens' BrokerNodeGroupInfo (Prelude.Maybe [Prelude.Text])
brokerNodeGroupInfo_securityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> BrokerNodeGroupInfo -> f BrokerNodeGroupInfo
brokerNodeGroupInfo_securityGroups = (BrokerNodeGroupInfo -> Maybe [Text])
-> (BrokerNodeGroupInfo -> Maybe [Text] -> BrokerNodeGroupInfo)
-> Lens
BrokerNodeGroupInfo
BrokerNodeGroupInfo
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerNodeGroupInfo' {Maybe [Text]
securityGroups :: Maybe [Text]
$sel:securityGroups:BrokerNodeGroupInfo' :: BrokerNodeGroupInfo -> Maybe [Text]
securityGroups} -> Maybe [Text]
securityGroups) (\s :: BrokerNodeGroupInfo
s@BrokerNodeGroupInfo' {} Maybe [Text]
a -> BrokerNodeGroupInfo
s {$sel:securityGroups:BrokerNodeGroupInfo' :: Maybe [Text]
securityGroups = Maybe [Text]
a} :: BrokerNodeGroupInfo) ((Maybe [Text] -> f (Maybe [Text]))
-> BrokerNodeGroupInfo -> f BrokerNodeGroupInfo)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BrokerNodeGroupInfo
-> f BrokerNodeGroupInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
brokerNodeGroupInfo_clientSubnets :: Lens.Lens' BrokerNodeGroupInfo [Prelude.Text]
brokerNodeGroupInfo_clientSubnets :: ([Text] -> f [Text])
-> BrokerNodeGroupInfo -> f BrokerNodeGroupInfo
brokerNodeGroupInfo_clientSubnets = (BrokerNodeGroupInfo -> [Text])
-> (BrokerNodeGroupInfo -> [Text] -> BrokerNodeGroupInfo)
-> Lens BrokerNodeGroupInfo BrokerNodeGroupInfo [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerNodeGroupInfo' {[Text]
clientSubnets :: [Text]
$sel:clientSubnets:BrokerNodeGroupInfo' :: BrokerNodeGroupInfo -> [Text]
clientSubnets} -> [Text]
clientSubnets) (\s :: BrokerNodeGroupInfo
s@BrokerNodeGroupInfo' {} [Text]
a -> BrokerNodeGroupInfo
s {$sel:clientSubnets:BrokerNodeGroupInfo' :: [Text]
clientSubnets = [Text]
a} :: BrokerNodeGroupInfo) (([Text] -> f [Text])
-> BrokerNodeGroupInfo -> f BrokerNodeGroupInfo)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> BrokerNodeGroupInfo
-> f BrokerNodeGroupInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
brokerNodeGroupInfo_instanceType :: Lens.Lens' BrokerNodeGroupInfo Prelude.Text
brokerNodeGroupInfo_instanceType :: (Text -> f Text) -> BrokerNodeGroupInfo -> f BrokerNodeGroupInfo
brokerNodeGroupInfo_instanceType = (BrokerNodeGroupInfo -> Text)
-> (BrokerNodeGroupInfo -> Text -> BrokerNodeGroupInfo)
-> Lens BrokerNodeGroupInfo BrokerNodeGroupInfo Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerNodeGroupInfo' {Text
instanceType :: Text
$sel:instanceType:BrokerNodeGroupInfo' :: BrokerNodeGroupInfo -> Text
instanceType} -> Text
instanceType) (\s :: BrokerNodeGroupInfo
s@BrokerNodeGroupInfo' {} Text
a -> BrokerNodeGroupInfo
s {$sel:instanceType:BrokerNodeGroupInfo' :: Text
instanceType = Text
a} :: BrokerNodeGroupInfo)
instance Core.FromJSON BrokerNodeGroupInfo where
parseJSON :: Value -> Parser BrokerNodeGroupInfo
parseJSON =
String
-> (Object -> Parser BrokerNodeGroupInfo)
-> Value
-> Parser BrokerNodeGroupInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BrokerNodeGroupInfo"
( \Object
x ->
Maybe StorageInfo
-> Maybe BrokerAZDistribution
-> Maybe [Text]
-> [Text]
-> Text
-> BrokerNodeGroupInfo
BrokerNodeGroupInfo'
(Maybe StorageInfo
-> Maybe BrokerAZDistribution
-> Maybe [Text]
-> [Text]
-> Text
-> BrokerNodeGroupInfo)
-> Parser (Maybe StorageInfo)
-> Parser
(Maybe BrokerAZDistribution
-> Maybe [Text] -> [Text] -> Text -> BrokerNodeGroupInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe StorageInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"storageInfo")
Parser
(Maybe BrokerAZDistribution
-> Maybe [Text] -> [Text] -> Text -> BrokerNodeGroupInfo)
-> Parser (Maybe BrokerAZDistribution)
-> Parser (Maybe [Text] -> [Text] -> Text -> BrokerNodeGroupInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BrokerAZDistribution)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"brokerAZDistribution")
Parser (Maybe [Text] -> [Text] -> Text -> BrokerNodeGroupInfo)
-> Parser (Maybe [Text])
-> Parser ([Text] -> Text -> BrokerNodeGroupInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"securityGroups" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser ([Text] -> Text -> BrokerNodeGroupInfo)
-> Parser [Text] -> Parser (Text -> BrokerNodeGroupInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"clientSubnets" Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Text -> BrokerNodeGroupInfo)
-> Parser Text -> Parser BrokerNodeGroupInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"instanceType")
)
instance Prelude.Hashable BrokerNodeGroupInfo
instance Prelude.NFData BrokerNodeGroupInfo
instance Core.ToJSON BrokerNodeGroupInfo where
toJSON :: BrokerNodeGroupInfo -> Value
toJSON BrokerNodeGroupInfo' {[Text]
Maybe [Text]
Maybe BrokerAZDistribution
Maybe StorageInfo
Text
instanceType :: Text
clientSubnets :: [Text]
securityGroups :: Maybe [Text]
brokerAZDistribution :: Maybe BrokerAZDistribution
storageInfo :: Maybe StorageInfo
$sel:instanceType:BrokerNodeGroupInfo' :: BrokerNodeGroupInfo -> Text
$sel:clientSubnets:BrokerNodeGroupInfo' :: BrokerNodeGroupInfo -> [Text]
$sel:securityGroups:BrokerNodeGroupInfo' :: BrokerNodeGroupInfo -> Maybe [Text]
$sel:brokerAZDistribution:BrokerNodeGroupInfo' :: BrokerNodeGroupInfo -> Maybe BrokerAZDistribution
$sel:storageInfo:BrokerNodeGroupInfo' :: BrokerNodeGroupInfo -> Maybe StorageInfo
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"storageInfo" Text -> StorageInfo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (StorageInfo -> Pair) -> Maybe StorageInfo -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StorageInfo
storageInfo,
(Text
"brokerAZDistribution" Text -> BrokerAZDistribution -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(BrokerAZDistribution -> Pair)
-> Maybe BrokerAZDistribution -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BrokerAZDistribution
brokerAZDistribution,
(Text
"securityGroups" 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]
securityGroups,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"clientSubnets" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
clientSubnets),
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)
]
)