{-# 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.BrokerNodeInfo
-- 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.BrokerNodeInfo where

import qualified Amazonka.Core as Core
import Amazonka.Kafka.Types.BrokerSoftwareInfo
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | BrokerNodeInfo
--
-- /See:/ 'newBrokerNodeInfo' smart constructor.
data BrokerNodeInfo = BrokerNodeInfo'
  { -- | Information about the version of software currently deployed on the
    -- Kafka brokers in the cluster.
    BrokerNodeInfo -> Maybe BrokerSoftwareInfo
currentBrokerSoftwareInfo :: Prelude.Maybe BrokerSoftwareInfo,
    -- | The client subnet to which this broker node belongs.
    BrokerNodeInfo -> Maybe Text
clientSubnet :: Prelude.Maybe Prelude.Text,
    -- | The attached elastic network interface of the broker.
    BrokerNodeInfo -> Maybe Text
attachedENIId :: Prelude.Maybe Prelude.Text,
    -- | Endpoints for accessing the broker.
    BrokerNodeInfo -> Maybe [Text]
endpoints :: Prelude.Maybe [Prelude.Text],
    -- | The virtual private cloud (VPC) of the client.
    BrokerNodeInfo -> Maybe Text
clientVpcIpAddress :: Prelude.Maybe Prelude.Text,
    -- | The ID of the broker.
    BrokerNodeInfo -> Maybe Double
brokerId :: Prelude.Maybe Prelude.Double
  }
  deriving (BrokerNodeInfo -> BrokerNodeInfo -> Bool
(BrokerNodeInfo -> BrokerNodeInfo -> Bool)
-> (BrokerNodeInfo -> BrokerNodeInfo -> Bool) -> Eq BrokerNodeInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BrokerNodeInfo -> BrokerNodeInfo -> Bool
$c/= :: BrokerNodeInfo -> BrokerNodeInfo -> Bool
== :: BrokerNodeInfo -> BrokerNodeInfo -> Bool
$c== :: BrokerNodeInfo -> BrokerNodeInfo -> Bool
Prelude.Eq, ReadPrec [BrokerNodeInfo]
ReadPrec BrokerNodeInfo
Int -> ReadS BrokerNodeInfo
ReadS [BrokerNodeInfo]
(Int -> ReadS BrokerNodeInfo)
-> ReadS [BrokerNodeInfo]
-> ReadPrec BrokerNodeInfo
-> ReadPrec [BrokerNodeInfo]
-> Read BrokerNodeInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BrokerNodeInfo]
$creadListPrec :: ReadPrec [BrokerNodeInfo]
readPrec :: ReadPrec BrokerNodeInfo
$creadPrec :: ReadPrec BrokerNodeInfo
readList :: ReadS [BrokerNodeInfo]
$creadList :: ReadS [BrokerNodeInfo]
readsPrec :: Int -> ReadS BrokerNodeInfo
$creadsPrec :: Int -> ReadS BrokerNodeInfo
Prelude.Read, Int -> BrokerNodeInfo -> ShowS
[BrokerNodeInfo] -> ShowS
BrokerNodeInfo -> String
(Int -> BrokerNodeInfo -> ShowS)
-> (BrokerNodeInfo -> String)
-> ([BrokerNodeInfo] -> ShowS)
-> Show BrokerNodeInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BrokerNodeInfo] -> ShowS
$cshowList :: [BrokerNodeInfo] -> ShowS
show :: BrokerNodeInfo -> String
$cshow :: BrokerNodeInfo -> String
showsPrec :: Int -> BrokerNodeInfo -> ShowS
$cshowsPrec :: Int -> BrokerNodeInfo -> ShowS
Prelude.Show, (forall x. BrokerNodeInfo -> Rep BrokerNodeInfo x)
-> (forall x. Rep BrokerNodeInfo x -> BrokerNodeInfo)
-> Generic BrokerNodeInfo
forall x. Rep BrokerNodeInfo x -> BrokerNodeInfo
forall x. BrokerNodeInfo -> Rep BrokerNodeInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BrokerNodeInfo x -> BrokerNodeInfo
$cfrom :: forall x. BrokerNodeInfo -> Rep BrokerNodeInfo x
Prelude.Generic)

-- |
-- Create a value of 'BrokerNodeInfo' 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:
--
-- 'currentBrokerSoftwareInfo', 'brokerNodeInfo_currentBrokerSoftwareInfo' - Information about the version of software currently deployed on the
-- Kafka brokers in the cluster.
--
-- 'clientSubnet', 'brokerNodeInfo_clientSubnet' - The client subnet to which this broker node belongs.
--
-- 'attachedENIId', 'brokerNodeInfo_attachedENIId' - The attached elastic network interface of the broker.
--
-- 'endpoints', 'brokerNodeInfo_endpoints' - Endpoints for accessing the broker.
--
-- 'clientVpcIpAddress', 'brokerNodeInfo_clientVpcIpAddress' - The virtual private cloud (VPC) of the client.
--
-- 'brokerId', 'brokerNodeInfo_brokerId' - The ID of the broker.
newBrokerNodeInfo ::
  BrokerNodeInfo
newBrokerNodeInfo :: BrokerNodeInfo
newBrokerNodeInfo =
  BrokerNodeInfo' :: Maybe BrokerSoftwareInfo
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Double
-> BrokerNodeInfo
BrokerNodeInfo'
    { $sel:currentBrokerSoftwareInfo:BrokerNodeInfo' :: Maybe BrokerSoftwareInfo
currentBrokerSoftwareInfo =
        Maybe BrokerSoftwareInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:clientSubnet:BrokerNodeInfo' :: Maybe Text
clientSubnet = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attachedENIId:BrokerNodeInfo' :: Maybe Text
attachedENIId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpoints:BrokerNodeInfo' :: Maybe [Text]
endpoints = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:clientVpcIpAddress:BrokerNodeInfo' :: Maybe Text
clientVpcIpAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:brokerId:BrokerNodeInfo' :: Maybe Double
brokerId = Maybe Double
forall a. Maybe a
Prelude.Nothing
    }

-- | Information about the version of software currently deployed on the
-- Kafka brokers in the cluster.
brokerNodeInfo_currentBrokerSoftwareInfo :: Lens.Lens' BrokerNodeInfo (Prelude.Maybe BrokerSoftwareInfo)
brokerNodeInfo_currentBrokerSoftwareInfo :: (Maybe BrokerSoftwareInfo -> f (Maybe BrokerSoftwareInfo))
-> BrokerNodeInfo -> f BrokerNodeInfo
brokerNodeInfo_currentBrokerSoftwareInfo = (BrokerNodeInfo -> Maybe BrokerSoftwareInfo)
-> (BrokerNodeInfo -> Maybe BrokerSoftwareInfo -> BrokerNodeInfo)
-> Lens
     BrokerNodeInfo
     BrokerNodeInfo
     (Maybe BrokerSoftwareInfo)
     (Maybe BrokerSoftwareInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerNodeInfo' {Maybe BrokerSoftwareInfo
currentBrokerSoftwareInfo :: Maybe BrokerSoftwareInfo
$sel:currentBrokerSoftwareInfo:BrokerNodeInfo' :: BrokerNodeInfo -> Maybe BrokerSoftwareInfo
currentBrokerSoftwareInfo} -> Maybe BrokerSoftwareInfo
currentBrokerSoftwareInfo) (\s :: BrokerNodeInfo
s@BrokerNodeInfo' {} Maybe BrokerSoftwareInfo
a -> BrokerNodeInfo
s {$sel:currentBrokerSoftwareInfo:BrokerNodeInfo' :: Maybe BrokerSoftwareInfo
currentBrokerSoftwareInfo = Maybe BrokerSoftwareInfo
a} :: BrokerNodeInfo)

-- | The client subnet to which this broker node belongs.
brokerNodeInfo_clientSubnet :: Lens.Lens' BrokerNodeInfo (Prelude.Maybe Prelude.Text)
brokerNodeInfo_clientSubnet :: (Maybe Text -> f (Maybe Text))
-> BrokerNodeInfo -> f BrokerNodeInfo
brokerNodeInfo_clientSubnet = (BrokerNodeInfo -> Maybe Text)
-> (BrokerNodeInfo -> Maybe Text -> BrokerNodeInfo)
-> Lens BrokerNodeInfo BrokerNodeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerNodeInfo' {Maybe Text
clientSubnet :: Maybe Text
$sel:clientSubnet:BrokerNodeInfo' :: BrokerNodeInfo -> Maybe Text
clientSubnet} -> Maybe Text
clientSubnet) (\s :: BrokerNodeInfo
s@BrokerNodeInfo' {} Maybe Text
a -> BrokerNodeInfo
s {$sel:clientSubnet:BrokerNodeInfo' :: Maybe Text
clientSubnet = Maybe Text
a} :: BrokerNodeInfo)

-- | The attached elastic network interface of the broker.
brokerNodeInfo_attachedENIId :: Lens.Lens' BrokerNodeInfo (Prelude.Maybe Prelude.Text)
brokerNodeInfo_attachedENIId :: (Maybe Text -> f (Maybe Text))
-> BrokerNodeInfo -> f BrokerNodeInfo
brokerNodeInfo_attachedENIId = (BrokerNodeInfo -> Maybe Text)
-> (BrokerNodeInfo -> Maybe Text -> BrokerNodeInfo)
-> Lens BrokerNodeInfo BrokerNodeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerNodeInfo' {Maybe Text
attachedENIId :: Maybe Text
$sel:attachedENIId:BrokerNodeInfo' :: BrokerNodeInfo -> Maybe Text
attachedENIId} -> Maybe Text
attachedENIId) (\s :: BrokerNodeInfo
s@BrokerNodeInfo' {} Maybe Text
a -> BrokerNodeInfo
s {$sel:attachedENIId:BrokerNodeInfo' :: Maybe Text
attachedENIId = Maybe Text
a} :: BrokerNodeInfo)

-- | Endpoints for accessing the broker.
brokerNodeInfo_endpoints :: Lens.Lens' BrokerNodeInfo (Prelude.Maybe [Prelude.Text])
brokerNodeInfo_endpoints :: (Maybe [Text] -> f (Maybe [Text]))
-> BrokerNodeInfo -> f BrokerNodeInfo
brokerNodeInfo_endpoints = (BrokerNodeInfo -> Maybe [Text])
-> (BrokerNodeInfo -> Maybe [Text] -> BrokerNodeInfo)
-> Lens BrokerNodeInfo BrokerNodeInfo (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerNodeInfo' {Maybe [Text]
endpoints :: Maybe [Text]
$sel:endpoints:BrokerNodeInfo' :: BrokerNodeInfo -> Maybe [Text]
endpoints} -> Maybe [Text]
endpoints) (\s :: BrokerNodeInfo
s@BrokerNodeInfo' {} Maybe [Text]
a -> BrokerNodeInfo
s {$sel:endpoints:BrokerNodeInfo' :: Maybe [Text]
endpoints = Maybe [Text]
a} :: BrokerNodeInfo) ((Maybe [Text] -> f (Maybe [Text]))
 -> BrokerNodeInfo -> f BrokerNodeInfo)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BrokerNodeInfo
-> f BrokerNodeInfo
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 virtual private cloud (VPC) of the client.
brokerNodeInfo_clientVpcIpAddress :: Lens.Lens' BrokerNodeInfo (Prelude.Maybe Prelude.Text)
brokerNodeInfo_clientVpcIpAddress :: (Maybe Text -> f (Maybe Text))
-> BrokerNodeInfo -> f BrokerNodeInfo
brokerNodeInfo_clientVpcIpAddress = (BrokerNodeInfo -> Maybe Text)
-> (BrokerNodeInfo -> Maybe Text -> BrokerNodeInfo)
-> Lens BrokerNodeInfo BrokerNodeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerNodeInfo' {Maybe Text
clientVpcIpAddress :: Maybe Text
$sel:clientVpcIpAddress:BrokerNodeInfo' :: BrokerNodeInfo -> Maybe Text
clientVpcIpAddress} -> Maybe Text
clientVpcIpAddress) (\s :: BrokerNodeInfo
s@BrokerNodeInfo' {} Maybe Text
a -> BrokerNodeInfo
s {$sel:clientVpcIpAddress:BrokerNodeInfo' :: Maybe Text
clientVpcIpAddress = Maybe Text
a} :: BrokerNodeInfo)

-- | The ID of the broker.
brokerNodeInfo_brokerId :: Lens.Lens' BrokerNodeInfo (Prelude.Maybe Prelude.Double)
brokerNodeInfo_brokerId :: (Maybe Double -> f (Maybe Double))
-> BrokerNodeInfo -> f BrokerNodeInfo
brokerNodeInfo_brokerId = (BrokerNodeInfo -> Maybe Double)
-> (BrokerNodeInfo -> Maybe Double -> BrokerNodeInfo)
-> Lens BrokerNodeInfo BrokerNodeInfo (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerNodeInfo' {Maybe Double
brokerId :: Maybe Double
$sel:brokerId:BrokerNodeInfo' :: BrokerNodeInfo -> Maybe Double
brokerId} -> Maybe Double
brokerId) (\s :: BrokerNodeInfo
s@BrokerNodeInfo' {} Maybe Double
a -> BrokerNodeInfo
s {$sel:brokerId:BrokerNodeInfo' :: Maybe Double
brokerId = Maybe Double
a} :: BrokerNodeInfo)

instance Core.FromJSON BrokerNodeInfo where
  parseJSON :: Value -> Parser BrokerNodeInfo
parseJSON =
    String
-> (Object -> Parser BrokerNodeInfo)
-> Value
-> Parser BrokerNodeInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BrokerNodeInfo"
      ( \Object
x ->
          Maybe BrokerSoftwareInfo
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Double
-> BrokerNodeInfo
BrokerNodeInfo'
            (Maybe BrokerSoftwareInfo
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Double
 -> BrokerNodeInfo)
-> Parser (Maybe BrokerSoftwareInfo)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Double
      -> BrokerNodeInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe BrokerSoftwareInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"currentBrokerSoftwareInfo")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Double
   -> BrokerNodeInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text] -> Maybe Text -> Maybe Double -> BrokerNodeInfo)
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
"clientSubnet")
            Parser
  (Maybe Text
   -> Maybe [Text] -> Maybe Text -> Maybe Double -> BrokerNodeInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text] -> Maybe Text -> Maybe Double -> BrokerNodeInfo)
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
"attachedENIId")
            Parser
  (Maybe [Text] -> Maybe Text -> Maybe Double -> BrokerNodeInfo)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> Maybe Double -> BrokerNodeInfo)
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
"endpoints" 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 (Maybe Text -> Maybe Double -> BrokerNodeInfo)
-> Parser (Maybe Text) -> Parser (Maybe Double -> BrokerNodeInfo)
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
"clientVpcIpAddress")
            Parser (Maybe Double -> BrokerNodeInfo)
-> Parser (Maybe Double) -> Parser BrokerNodeInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"brokerId")
      )

instance Prelude.Hashable BrokerNodeInfo

instance Prelude.NFData BrokerNodeInfo