{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Kafka.Types.BrokerNodeGroupInfo
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Describes the setup to be used for Kafka broker nodes in the cluster.
--
-- /See:/ 'newBrokerNodeGroupInfo' smart constructor.
data BrokerNodeGroupInfo = BrokerNodeGroupInfo'
  { -- | Contains information about storage volumes attached to MSK broker nodes.
    BrokerNodeGroupInfo -> Maybe StorageInfo
storageInfo :: Prelude.Maybe StorageInfo,
    -- | The distribution of broker nodes across Availability Zones. This is an
    -- optional parameter. If you don\'t specify it, Amazon MSK gives it the
    -- value DEFAULT. You can also explicitly set this parameter to the value
    -- DEFAULT. No other values are currently allowed.
    --
    -- Amazon MSK distributes the broker nodes evenly across the Availability
    -- Zones that correspond to the subnets you provide when you create the
    -- cluster.
    BrokerNodeGroupInfo -> Maybe BrokerAZDistribution
brokerAZDistribution :: Prelude.Maybe BrokerAZDistribution,
    -- | The AWS security groups to associate with the elastic network interfaces
    -- in order to specify who can connect to and communicate with the Amazon
    -- MSK cluster. If you don\'t specify a security group, Amazon MSK uses the
    -- default security group associated with the VPC.
    BrokerNodeGroupInfo -> Maybe [Text]
securityGroups :: Prelude.Maybe [Prelude.Text],
    -- | The list of subnets to connect to in the client virtual private cloud
    -- (VPC). AWS creates elastic network interfaces inside these subnets.
    -- Client applications use elastic network interfaces to produce and
    -- consume data. Client subnets can\'t be in Availability Zone us-east-1e.
    BrokerNodeGroupInfo -> [Text]
clientSubnets :: [Prelude.Text],
    -- | The type of Amazon EC2 instances to use for Kafka brokers. The following
    -- instance types are allowed: kafka.m5.large, kafka.m5.xlarge,
    -- kafka.m5.2xlarge, kafka.m5.4xlarge, kafka.m5.12xlarge, and
    -- kafka.m5.24xlarge.
    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)

-- |
-- Create a value of 'BrokerNodeGroupInfo' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'storageInfo', 'brokerNodeGroupInfo_storageInfo' - Contains information about storage volumes attached to MSK broker nodes.
--
-- 'brokerAZDistribution', 'brokerNodeGroupInfo_brokerAZDistribution' - The distribution of broker nodes across Availability Zones. This is an
-- optional parameter. If you don\'t specify it, Amazon MSK gives it the
-- value DEFAULT. You can also explicitly set this parameter to the value
-- DEFAULT. No other values are currently allowed.
--
-- Amazon MSK distributes the broker nodes evenly across the Availability
-- Zones that correspond to the subnets you provide when you create the
-- cluster.
--
-- 'securityGroups', 'brokerNodeGroupInfo_securityGroups' - The AWS security groups to associate with the elastic network interfaces
-- in order to specify who can connect to and communicate with the Amazon
-- MSK cluster. If you don\'t specify a security group, Amazon MSK uses the
-- default security group associated with the VPC.
--
-- 'clientSubnets', 'brokerNodeGroupInfo_clientSubnets' - The list of subnets to connect to in the client virtual private cloud
-- (VPC). AWS creates elastic network interfaces inside these subnets.
-- Client applications use elastic network interfaces to produce and
-- consume data. Client subnets can\'t be in Availability Zone us-east-1e.
--
-- 'instanceType', 'brokerNodeGroupInfo_instanceType' - The type of Amazon EC2 instances to use for Kafka brokers. The following
-- instance types are allowed: kafka.m5.large, kafka.m5.xlarge,
-- kafka.m5.2xlarge, kafka.m5.4xlarge, kafka.m5.12xlarge, and
-- kafka.m5.24xlarge.
newBrokerNodeGroupInfo ::
  -- | 'instanceType'
  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_
    }

-- | Contains information about storage volumes attached to MSK broker nodes.
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)

-- | The distribution of broker nodes across Availability Zones. This is an
-- optional parameter. If you don\'t specify it, Amazon MSK gives it the
-- value DEFAULT. You can also explicitly set this parameter to the value
-- DEFAULT. No other values are currently allowed.
--
-- Amazon MSK distributes the broker nodes evenly across the Availability
-- Zones that correspond to the subnets you provide when you create the
-- cluster.
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)

-- | The AWS security groups to associate with the elastic network interfaces
-- in order to specify who can connect to and communicate with the Amazon
-- MSK cluster. If you don\'t specify a security group, Amazon MSK uses the
-- default security group associated with the VPC.
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

-- | The list of subnets to connect to in the client virtual private cloud
-- (VPC). AWS creates elastic network interfaces inside these subnets.
-- Client applications use elastic network interfaces to produce and
-- consume data. Client subnets can\'t be in Availability Zone us-east-1e.
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

-- | The type of Amazon EC2 instances to use for Kafka brokers. The following
-- instance types are allowed: kafka.m5.large, kafka.m5.xlarge,
-- kafka.m5.2xlarge, kafka.m5.4xlarge, kafka.m5.12xlarge, and
-- kafka.m5.24xlarge.
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)
          ]
      )