{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.KafkaConnect.Types.ApacheKafkaClusterDescription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KafkaConnect.Types.VpcDescription
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
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]
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
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.
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'
    { $sel:bootstrapServers:ApacheKafkaClusterDescription' :: Maybe Text
bootstrapServers =
        forall a. Maybe a
Prelude.Nothing,
      $sel:vpc:ApacheKafkaClusterDescription' :: Maybe VpcDescription
vpc = forall a. Maybe a
Prelude.Nothing
    }

-- | The bootstrap servers of the cluster.
apacheKafkaClusterDescription_bootstrapServers :: Lens.Lens' ApacheKafkaClusterDescription (Prelude.Maybe Prelude.Text)
apacheKafkaClusterDescription_bootstrapServers :: Lens' ApacheKafkaClusterDescription (Maybe Text)
apacheKafkaClusterDescription_bootstrapServers = 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 :: Lens' ApacheKafkaClusterDescription (Maybe VpcDescription)
apacheKafkaClusterDescription_vpc = 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 Data.FromJSON ApacheKafkaClusterDescription where
  parseJSON :: Value -> Parser ApacheKafkaClusterDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ApacheKafkaClusterDescription"
      ( \Object
x ->
          Maybe Text -> Maybe VpcDescription -> ApacheKafkaClusterDescription
ApacheKafkaClusterDescription'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"bootstrapServers")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"vpc")
      )

instance
  Prelude.Hashable
    ApacheKafkaClusterDescription
  where
  hashWithSalt :: Int -> ApacheKafkaClusterDescription -> Int
hashWithSalt Int
_salt ApacheKafkaClusterDescription' {Maybe Text
Maybe VpcDescription
vpc :: Maybe VpcDescription
bootstrapServers :: Maybe Text
$sel:vpc:ApacheKafkaClusterDescription' :: ApacheKafkaClusterDescription -> Maybe VpcDescription
$sel:bootstrapServers:ApacheKafkaClusterDescription' :: ApacheKafkaClusterDescription -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bootstrapServers
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VpcDescription
vpc

instance Prelude.NFData ApacheKafkaClusterDescription where
  rnf :: ApacheKafkaClusterDescription -> ()
rnf ApacheKafkaClusterDescription' {Maybe Text
Maybe VpcDescription
vpc :: Maybe VpcDescription
bootstrapServers :: Maybe Text
$sel:vpc:ApacheKafkaClusterDescription' :: ApacheKafkaClusterDescription -> Maybe VpcDescription
$sel:bootstrapServers:ApacheKafkaClusterDescription' :: ApacheKafkaClusterDescription -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bootstrapServers
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VpcDescription
vpc