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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Zookeeper node information.
--
-- /See:/ 'newZookeeperNodeInfo' smart constructor.
data ZookeeperNodeInfo = ZookeeperNodeInfo'
  { -- | The version of Zookeeper.
    ZookeeperNodeInfo -> Maybe Text
zookeeperVersion :: Prelude.Maybe Prelude.Text,
    -- | The attached elastic network interface of the broker.
    ZookeeperNodeInfo -> Maybe Text
attachedENIId :: Prelude.Maybe Prelude.Text,
    -- | Endpoints for accessing the ZooKeeper.
    ZookeeperNodeInfo -> Maybe [Text]
endpoints :: Prelude.Maybe [Prelude.Text],
    -- | The virtual private cloud (VPC) IP address of the client.
    ZookeeperNodeInfo -> Maybe Text
clientVpcIpAddress :: Prelude.Maybe Prelude.Text,
    -- | The role-specific ID for Zookeeper.
    ZookeeperNodeInfo -> Maybe Double
zookeeperId :: Prelude.Maybe Prelude.Double
  }
  deriving (ZookeeperNodeInfo -> ZookeeperNodeInfo -> Bool
(ZookeeperNodeInfo -> ZookeeperNodeInfo -> Bool)
-> (ZookeeperNodeInfo -> ZookeeperNodeInfo -> Bool)
-> Eq ZookeeperNodeInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ZookeeperNodeInfo -> ZookeeperNodeInfo -> Bool
$c/= :: ZookeeperNodeInfo -> ZookeeperNodeInfo -> Bool
== :: ZookeeperNodeInfo -> ZookeeperNodeInfo -> Bool
$c== :: ZookeeperNodeInfo -> ZookeeperNodeInfo -> Bool
Prelude.Eq, ReadPrec [ZookeeperNodeInfo]
ReadPrec ZookeeperNodeInfo
Int -> ReadS ZookeeperNodeInfo
ReadS [ZookeeperNodeInfo]
(Int -> ReadS ZookeeperNodeInfo)
-> ReadS [ZookeeperNodeInfo]
-> ReadPrec ZookeeperNodeInfo
-> ReadPrec [ZookeeperNodeInfo]
-> Read ZookeeperNodeInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ZookeeperNodeInfo]
$creadListPrec :: ReadPrec [ZookeeperNodeInfo]
readPrec :: ReadPrec ZookeeperNodeInfo
$creadPrec :: ReadPrec ZookeeperNodeInfo
readList :: ReadS [ZookeeperNodeInfo]
$creadList :: ReadS [ZookeeperNodeInfo]
readsPrec :: Int -> ReadS ZookeeperNodeInfo
$creadsPrec :: Int -> ReadS ZookeeperNodeInfo
Prelude.Read, Int -> ZookeeperNodeInfo -> ShowS
[ZookeeperNodeInfo] -> ShowS
ZookeeperNodeInfo -> String
(Int -> ZookeeperNodeInfo -> ShowS)
-> (ZookeeperNodeInfo -> String)
-> ([ZookeeperNodeInfo] -> ShowS)
-> Show ZookeeperNodeInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ZookeeperNodeInfo] -> ShowS
$cshowList :: [ZookeeperNodeInfo] -> ShowS
show :: ZookeeperNodeInfo -> String
$cshow :: ZookeeperNodeInfo -> String
showsPrec :: Int -> ZookeeperNodeInfo -> ShowS
$cshowsPrec :: Int -> ZookeeperNodeInfo -> ShowS
Prelude.Show, (forall x. ZookeeperNodeInfo -> Rep ZookeeperNodeInfo x)
-> (forall x. Rep ZookeeperNodeInfo x -> ZookeeperNodeInfo)
-> Generic ZookeeperNodeInfo
forall x. Rep ZookeeperNodeInfo x -> ZookeeperNodeInfo
forall x. ZookeeperNodeInfo -> Rep ZookeeperNodeInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ZookeeperNodeInfo x -> ZookeeperNodeInfo
$cfrom :: forall x. ZookeeperNodeInfo -> Rep ZookeeperNodeInfo x
Prelude.Generic)

-- |
-- Create a value of 'ZookeeperNodeInfo' 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:
--
-- 'zookeeperVersion', 'zookeeperNodeInfo_zookeeperVersion' - The version of Zookeeper.
--
-- 'attachedENIId', 'zookeeperNodeInfo_attachedENIId' - The attached elastic network interface of the broker.
--
-- 'endpoints', 'zookeeperNodeInfo_endpoints' - Endpoints for accessing the ZooKeeper.
--
-- 'clientVpcIpAddress', 'zookeeperNodeInfo_clientVpcIpAddress' - The virtual private cloud (VPC) IP address of the client.
--
-- 'zookeeperId', 'zookeeperNodeInfo_zookeeperId' - The role-specific ID for Zookeeper.
newZookeeperNodeInfo ::
  ZookeeperNodeInfo
newZookeeperNodeInfo :: ZookeeperNodeInfo
newZookeeperNodeInfo =
  ZookeeperNodeInfo' :: Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Double
-> ZookeeperNodeInfo
ZookeeperNodeInfo'
    { $sel:zookeeperVersion:ZookeeperNodeInfo' :: Maybe Text
zookeeperVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attachedENIId:ZookeeperNodeInfo' :: Maybe Text
attachedENIId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpoints:ZookeeperNodeInfo' :: Maybe [Text]
endpoints = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:clientVpcIpAddress:ZookeeperNodeInfo' :: Maybe Text
clientVpcIpAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:zookeeperId:ZookeeperNodeInfo' :: Maybe Double
zookeeperId = Maybe Double
forall a. Maybe a
Prelude.Nothing
    }

-- | The version of Zookeeper.
zookeeperNodeInfo_zookeeperVersion :: Lens.Lens' ZookeeperNodeInfo (Prelude.Maybe Prelude.Text)
zookeeperNodeInfo_zookeeperVersion :: (Maybe Text -> f (Maybe Text))
-> ZookeeperNodeInfo -> f ZookeeperNodeInfo
zookeeperNodeInfo_zookeeperVersion = (ZookeeperNodeInfo -> Maybe Text)
-> (ZookeeperNodeInfo -> Maybe Text -> ZookeeperNodeInfo)
-> Lens
     ZookeeperNodeInfo ZookeeperNodeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ZookeeperNodeInfo' {Maybe Text
zookeeperVersion :: Maybe Text
$sel:zookeeperVersion:ZookeeperNodeInfo' :: ZookeeperNodeInfo -> Maybe Text
zookeeperVersion} -> Maybe Text
zookeeperVersion) (\s :: ZookeeperNodeInfo
s@ZookeeperNodeInfo' {} Maybe Text
a -> ZookeeperNodeInfo
s {$sel:zookeeperVersion:ZookeeperNodeInfo' :: Maybe Text
zookeeperVersion = Maybe Text
a} :: ZookeeperNodeInfo)

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

-- | Endpoints for accessing the ZooKeeper.
zookeeperNodeInfo_endpoints :: Lens.Lens' ZookeeperNodeInfo (Prelude.Maybe [Prelude.Text])
zookeeperNodeInfo_endpoints :: (Maybe [Text] -> f (Maybe [Text]))
-> ZookeeperNodeInfo -> f ZookeeperNodeInfo
zookeeperNodeInfo_endpoints = (ZookeeperNodeInfo -> Maybe [Text])
-> (ZookeeperNodeInfo -> Maybe [Text] -> ZookeeperNodeInfo)
-> Lens
     ZookeeperNodeInfo ZookeeperNodeInfo (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ZookeeperNodeInfo' {Maybe [Text]
endpoints :: Maybe [Text]
$sel:endpoints:ZookeeperNodeInfo' :: ZookeeperNodeInfo -> Maybe [Text]
endpoints} -> Maybe [Text]
endpoints) (\s :: ZookeeperNodeInfo
s@ZookeeperNodeInfo' {} Maybe [Text]
a -> ZookeeperNodeInfo
s {$sel:endpoints:ZookeeperNodeInfo' :: Maybe [Text]
endpoints = Maybe [Text]
a} :: ZookeeperNodeInfo) ((Maybe [Text] -> f (Maybe [Text]))
 -> ZookeeperNodeInfo -> f ZookeeperNodeInfo)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ZookeeperNodeInfo
-> f ZookeeperNodeInfo
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) IP address of the client.
zookeeperNodeInfo_clientVpcIpAddress :: Lens.Lens' ZookeeperNodeInfo (Prelude.Maybe Prelude.Text)
zookeeperNodeInfo_clientVpcIpAddress :: (Maybe Text -> f (Maybe Text))
-> ZookeeperNodeInfo -> f ZookeeperNodeInfo
zookeeperNodeInfo_clientVpcIpAddress = (ZookeeperNodeInfo -> Maybe Text)
-> (ZookeeperNodeInfo -> Maybe Text -> ZookeeperNodeInfo)
-> Lens
     ZookeeperNodeInfo ZookeeperNodeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ZookeeperNodeInfo' {Maybe Text
clientVpcIpAddress :: Maybe Text
$sel:clientVpcIpAddress:ZookeeperNodeInfo' :: ZookeeperNodeInfo -> Maybe Text
clientVpcIpAddress} -> Maybe Text
clientVpcIpAddress) (\s :: ZookeeperNodeInfo
s@ZookeeperNodeInfo' {} Maybe Text
a -> ZookeeperNodeInfo
s {$sel:clientVpcIpAddress:ZookeeperNodeInfo' :: Maybe Text
clientVpcIpAddress = Maybe Text
a} :: ZookeeperNodeInfo)

-- | The role-specific ID for Zookeeper.
zookeeperNodeInfo_zookeeperId :: Lens.Lens' ZookeeperNodeInfo (Prelude.Maybe Prelude.Double)
zookeeperNodeInfo_zookeeperId :: (Maybe Double -> f (Maybe Double))
-> ZookeeperNodeInfo -> f ZookeeperNodeInfo
zookeeperNodeInfo_zookeeperId = (ZookeeperNodeInfo -> Maybe Double)
-> (ZookeeperNodeInfo -> Maybe Double -> ZookeeperNodeInfo)
-> Lens
     ZookeeperNodeInfo ZookeeperNodeInfo (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ZookeeperNodeInfo' {Maybe Double
zookeeperId :: Maybe Double
$sel:zookeeperId:ZookeeperNodeInfo' :: ZookeeperNodeInfo -> Maybe Double
zookeeperId} -> Maybe Double
zookeeperId) (\s :: ZookeeperNodeInfo
s@ZookeeperNodeInfo' {} Maybe Double
a -> ZookeeperNodeInfo
s {$sel:zookeeperId:ZookeeperNodeInfo' :: Maybe Double
zookeeperId = Maybe Double
a} :: ZookeeperNodeInfo)

instance Core.FromJSON ZookeeperNodeInfo where
  parseJSON :: Value -> Parser ZookeeperNodeInfo
parseJSON =
    String
-> (Object -> Parser ZookeeperNodeInfo)
-> Value
-> Parser ZookeeperNodeInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ZookeeperNodeInfo"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Double
-> ZookeeperNodeInfo
ZookeeperNodeInfo'
            (Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Double
 -> ZookeeperNodeInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text] -> Maybe Text -> Maybe Double -> ZookeeperNodeInfo)
forall (f :: * -> *) a b. Functor 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
"zookeeperVersion")
            Parser
  (Maybe Text
   -> Maybe [Text] -> Maybe Text -> Maybe Double -> ZookeeperNodeInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text] -> Maybe Text -> Maybe Double -> ZookeeperNodeInfo)
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 -> ZookeeperNodeInfo)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> Maybe Double -> ZookeeperNodeInfo)
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 -> ZookeeperNodeInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Double -> ZookeeperNodeInfo)
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 -> ZookeeperNodeInfo)
-> Parser (Maybe Double) -> Parser ZookeeperNodeInfo
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
"zookeeperId")
      )

instance Prelude.Hashable ZookeeperNodeInfo

instance Prelude.NFData ZookeeperNodeInfo