{-# 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.KafkaConnect.Types.ApacheKafkaClusterDescription
-- 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.KafkaConnect.Types.ApacheKafkaClusterDescription where

import qualified Amazonka.Core as Core
import Amazonka.KafkaConnect.Types.VpcDescription
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The description of the Apache Kafka cluster to which the connector is
-- connected.
--
-- /See:/ 'newApacheKafkaClusterDescription' smart constructor.
data ApacheKafkaClusterDescription = ApacheKafkaClusterDescription'
  { -- | The bootstrap servers of the cluster.
    ApacheKafkaClusterDescription -> Maybe Text
bootstrapServers :: Prelude.Maybe Prelude.Text,
    -- | Details of an Amazon VPC which has network connectivity to the Apache
    -- Kafka cluster.
    ApacheKafkaClusterDescription -> Maybe VpcDescription
vpc :: Prelude.Maybe VpcDescription
  }
  deriving (ApacheKafkaClusterDescription
-> ApacheKafkaClusterDescription -> Bool
(ApacheKafkaClusterDescription
 -> ApacheKafkaClusterDescription -> Bool)
-> (ApacheKafkaClusterDescription
    -> ApacheKafkaClusterDescription -> Bool)
-> Eq ApacheKafkaClusterDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApacheKafkaClusterDescription
-> ApacheKafkaClusterDescription -> Bool
$c/= :: ApacheKafkaClusterDescription
-> ApacheKafkaClusterDescription -> Bool
== :: ApacheKafkaClusterDescription
-> ApacheKafkaClusterDescription -> Bool
$c== :: ApacheKafkaClusterDescription
-> ApacheKafkaClusterDescription -> Bool
Prelude.Eq, ReadPrec [ApacheKafkaClusterDescription]
ReadPrec ApacheKafkaClusterDescription
Int -> ReadS ApacheKafkaClusterDescription
ReadS [ApacheKafkaClusterDescription]
(Int -> ReadS ApacheKafkaClusterDescription)
-> ReadS [ApacheKafkaClusterDescription]
-> ReadPrec ApacheKafkaClusterDescription
-> ReadPrec [ApacheKafkaClusterDescription]
-> Read ApacheKafkaClusterDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApacheKafkaClusterDescription]
$creadListPrec :: ReadPrec [ApacheKafkaClusterDescription]
readPrec :: ReadPrec ApacheKafkaClusterDescription
$creadPrec :: ReadPrec ApacheKafkaClusterDescription
readList :: ReadS [ApacheKafkaClusterDescription]
$creadList :: ReadS [ApacheKafkaClusterDescription]
readsPrec :: Int -> ReadS ApacheKafkaClusterDescription
$creadsPrec :: Int -> ReadS ApacheKafkaClusterDescription
Prelude.Read, Int -> ApacheKafkaClusterDescription -> ShowS
[ApacheKafkaClusterDescription] -> ShowS
ApacheKafkaClusterDescription -> String
(Int -> ApacheKafkaClusterDescription -> ShowS)
-> (ApacheKafkaClusterDescription -> String)
-> ([ApacheKafkaClusterDescription] -> ShowS)
-> Show ApacheKafkaClusterDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApacheKafkaClusterDescription] -> ShowS
$cshowList :: [ApacheKafkaClusterDescription] -> ShowS
show :: ApacheKafkaClusterDescription -> String
$cshow :: ApacheKafkaClusterDescription -> String
showsPrec :: Int -> ApacheKafkaClusterDescription -> ShowS
$cshowsPrec :: Int -> ApacheKafkaClusterDescription -> ShowS
Prelude.Show, (forall x.
 ApacheKafkaClusterDescription
 -> Rep ApacheKafkaClusterDescription x)
-> (forall x.
    Rep ApacheKafkaClusterDescription x
    -> ApacheKafkaClusterDescription)
-> Generic ApacheKafkaClusterDescription
forall x.
Rep ApacheKafkaClusterDescription x
-> ApacheKafkaClusterDescription
forall x.
ApacheKafkaClusterDescription
-> Rep ApacheKafkaClusterDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApacheKafkaClusterDescription x
-> ApacheKafkaClusterDescription
$cfrom :: forall x.
ApacheKafkaClusterDescription
-> Rep ApacheKafkaClusterDescription x
Prelude.Generic)

-- |
-- Create a value of 'ApacheKafkaClusterDescription' 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:
--
-- 'bootstrapServers', 'apacheKafkaClusterDescription_bootstrapServers' - The bootstrap servers of the cluster.
--
-- 'vpc', 'apacheKafkaClusterDescription_vpc' - Details of an Amazon VPC which has network connectivity to the Apache
-- Kafka cluster.
newApacheKafkaClusterDescription ::
  ApacheKafkaClusterDescription
newApacheKafkaClusterDescription :: ApacheKafkaClusterDescription
newApacheKafkaClusterDescription =
  ApacheKafkaClusterDescription' :: Maybe Text -> Maybe VpcDescription -> ApacheKafkaClusterDescription
ApacheKafkaClusterDescription'
    { $sel:bootstrapServers:ApacheKafkaClusterDescription' :: Maybe Text
bootstrapServers =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpc:ApacheKafkaClusterDescription' :: Maybe VpcDescription
vpc = Maybe VpcDescription
forall a. Maybe a
Prelude.Nothing
    }

-- | The bootstrap servers of the cluster.
apacheKafkaClusterDescription_bootstrapServers :: Lens.Lens' ApacheKafkaClusterDescription (Prelude.Maybe Prelude.Text)
apacheKafkaClusterDescription_bootstrapServers :: (Maybe Text -> f (Maybe Text))
-> ApacheKafkaClusterDescription -> f ApacheKafkaClusterDescription
apacheKafkaClusterDescription_bootstrapServers = (ApacheKafkaClusterDescription -> Maybe Text)
-> (ApacheKafkaClusterDescription
    -> Maybe Text -> ApacheKafkaClusterDescription)
-> Lens
     ApacheKafkaClusterDescription
     ApacheKafkaClusterDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApacheKafkaClusterDescription' {Maybe Text
bootstrapServers :: Maybe Text
$sel:bootstrapServers:ApacheKafkaClusterDescription' :: ApacheKafkaClusterDescription -> Maybe Text
bootstrapServers} -> Maybe Text
bootstrapServers) (\s :: ApacheKafkaClusterDescription
s@ApacheKafkaClusterDescription' {} Maybe Text
a -> ApacheKafkaClusterDescription
s {$sel:bootstrapServers:ApacheKafkaClusterDescription' :: Maybe Text
bootstrapServers = Maybe Text
a} :: ApacheKafkaClusterDescription)

-- | Details of an Amazon VPC which has network connectivity to the Apache
-- Kafka cluster.
apacheKafkaClusterDescription_vpc :: Lens.Lens' ApacheKafkaClusterDescription (Prelude.Maybe VpcDescription)
apacheKafkaClusterDescription_vpc :: (Maybe VpcDescription -> f (Maybe VpcDescription))
-> ApacheKafkaClusterDescription -> f ApacheKafkaClusterDescription
apacheKafkaClusterDescription_vpc = (ApacheKafkaClusterDescription -> Maybe VpcDescription)
-> (ApacheKafkaClusterDescription
    -> Maybe VpcDescription -> ApacheKafkaClusterDescription)
-> Lens
     ApacheKafkaClusterDescription
     ApacheKafkaClusterDescription
     (Maybe VpcDescription)
     (Maybe VpcDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApacheKafkaClusterDescription' {Maybe VpcDescription
vpc :: Maybe VpcDescription
$sel:vpc:ApacheKafkaClusterDescription' :: ApacheKafkaClusterDescription -> Maybe VpcDescription
vpc} -> Maybe VpcDescription
vpc) (\s :: ApacheKafkaClusterDescription
s@ApacheKafkaClusterDescription' {} Maybe VpcDescription
a -> ApacheKafkaClusterDescription
s {$sel:vpc:ApacheKafkaClusterDescription' :: Maybe VpcDescription
vpc = Maybe VpcDescription
a} :: ApacheKafkaClusterDescription)

instance Core.FromJSON ApacheKafkaClusterDescription where
  parseJSON :: Value -> Parser ApacheKafkaClusterDescription
parseJSON =
    String
-> (Object -> Parser ApacheKafkaClusterDescription)
-> Value
-> Parser ApacheKafkaClusterDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ApacheKafkaClusterDescription"
      ( \Object
x ->
          Maybe Text -> Maybe VpcDescription -> ApacheKafkaClusterDescription
ApacheKafkaClusterDescription'
            (Maybe Text
 -> Maybe VpcDescription -> ApacheKafkaClusterDescription)
-> Parser (Maybe Text)
-> Parser (Maybe VpcDescription -> ApacheKafkaClusterDescription)
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
"bootstrapServers")
            Parser (Maybe VpcDescription -> ApacheKafkaClusterDescription)
-> Parser (Maybe VpcDescription)
-> Parser ApacheKafkaClusterDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VpcDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vpc")
      )

instance
  Prelude.Hashable
    ApacheKafkaClusterDescription

instance Prelude.NFData ApacheKafkaClusterDescription