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

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

-- | Details of how to connect to the Apache Kafka cluster.
--
-- /See:/ 'newKafkaClusterDescription' smart constructor.
data KafkaClusterDescription = KafkaClusterDescription'
  { -- | The Apache Kafka cluster to which the connector is connected.
    KafkaClusterDescription -> Maybe ApacheKafkaClusterDescription
apacheKafkaCluster :: Prelude.Maybe ApacheKafkaClusterDescription
  }
  deriving (KafkaClusterDescription -> KafkaClusterDescription -> Bool
(KafkaClusterDescription -> KafkaClusterDescription -> Bool)
-> (KafkaClusterDescription -> KafkaClusterDescription -> Bool)
-> Eq KafkaClusterDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KafkaClusterDescription -> KafkaClusterDescription -> Bool
$c/= :: KafkaClusterDescription -> KafkaClusterDescription -> Bool
== :: KafkaClusterDescription -> KafkaClusterDescription -> Bool
$c== :: KafkaClusterDescription -> KafkaClusterDescription -> Bool
Prelude.Eq, ReadPrec [KafkaClusterDescription]
ReadPrec KafkaClusterDescription
Int -> ReadS KafkaClusterDescription
ReadS [KafkaClusterDescription]
(Int -> ReadS KafkaClusterDescription)
-> ReadS [KafkaClusterDescription]
-> ReadPrec KafkaClusterDescription
-> ReadPrec [KafkaClusterDescription]
-> Read KafkaClusterDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KafkaClusterDescription]
$creadListPrec :: ReadPrec [KafkaClusterDescription]
readPrec :: ReadPrec KafkaClusterDescription
$creadPrec :: ReadPrec KafkaClusterDescription
readList :: ReadS [KafkaClusterDescription]
$creadList :: ReadS [KafkaClusterDescription]
readsPrec :: Int -> ReadS KafkaClusterDescription
$creadsPrec :: Int -> ReadS KafkaClusterDescription
Prelude.Read, Int -> KafkaClusterDescription -> ShowS
[KafkaClusterDescription] -> ShowS
KafkaClusterDescription -> String
(Int -> KafkaClusterDescription -> ShowS)
-> (KafkaClusterDescription -> String)
-> ([KafkaClusterDescription] -> ShowS)
-> Show KafkaClusterDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KafkaClusterDescription] -> ShowS
$cshowList :: [KafkaClusterDescription] -> ShowS
show :: KafkaClusterDescription -> String
$cshow :: KafkaClusterDescription -> String
showsPrec :: Int -> KafkaClusterDescription -> ShowS
$cshowsPrec :: Int -> KafkaClusterDescription -> ShowS
Prelude.Show, (forall x.
 KafkaClusterDescription -> Rep KafkaClusterDescription x)
-> (forall x.
    Rep KafkaClusterDescription x -> KafkaClusterDescription)
-> Generic KafkaClusterDescription
forall x. Rep KafkaClusterDescription x -> KafkaClusterDescription
forall x. KafkaClusterDescription -> Rep KafkaClusterDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KafkaClusterDescription x -> KafkaClusterDescription
$cfrom :: forall x. KafkaClusterDescription -> Rep KafkaClusterDescription x
Prelude.Generic)

-- |
-- Create a value of 'KafkaClusterDescription' 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:
--
-- 'apacheKafkaCluster', 'kafkaClusterDescription_apacheKafkaCluster' - The Apache Kafka cluster to which the connector is connected.
newKafkaClusterDescription ::
  KafkaClusterDescription
newKafkaClusterDescription :: KafkaClusterDescription
newKafkaClusterDescription =
  KafkaClusterDescription' :: Maybe ApacheKafkaClusterDescription -> KafkaClusterDescription
KafkaClusterDescription'
    { $sel:apacheKafkaCluster:KafkaClusterDescription' :: Maybe ApacheKafkaClusterDescription
apacheKafkaCluster =
        Maybe ApacheKafkaClusterDescription
forall a. Maybe a
Prelude.Nothing
    }

-- | The Apache Kafka cluster to which the connector is connected.
kafkaClusterDescription_apacheKafkaCluster :: Lens.Lens' KafkaClusterDescription (Prelude.Maybe ApacheKafkaClusterDescription)
kafkaClusterDescription_apacheKafkaCluster :: (Maybe ApacheKafkaClusterDescription
 -> f (Maybe ApacheKafkaClusterDescription))
-> KafkaClusterDescription -> f KafkaClusterDescription
kafkaClusterDescription_apacheKafkaCluster = (KafkaClusterDescription -> Maybe ApacheKafkaClusterDescription)
-> (KafkaClusterDescription
    -> Maybe ApacheKafkaClusterDescription -> KafkaClusterDescription)
-> Lens
     KafkaClusterDescription
     KafkaClusterDescription
     (Maybe ApacheKafkaClusterDescription)
     (Maybe ApacheKafkaClusterDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KafkaClusterDescription' {Maybe ApacheKafkaClusterDescription
apacheKafkaCluster :: Maybe ApacheKafkaClusterDescription
$sel:apacheKafkaCluster:KafkaClusterDescription' :: KafkaClusterDescription -> Maybe ApacheKafkaClusterDescription
apacheKafkaCluster} -> Maybe ApacheKafkaClusterDescription
apacheKafkaCluster) (\s :: KafkaClusterDescription
s@KafkaClusterDescription' {} Maybe ApacheKafkaClusterDescription
a -> KafkaClusterDescription
s {$sel:apacheKafkaCluster:KafkaClusterDescription' :: Maybe ApacheKafkaClusterDescription
apacheKafkaCluster = Maybe ApacheKafkaClusterDescription
a} :: KafkaClusterDescription)

instance Core.FromJSON KafkaClusterDescription where
  parseJSON :: Value -> Parser KafkaClusterDescription
parseJSON =
    String
-> (Object -> Parser KafkaClusterDescription)
-> Value
-> Parser KafkaClusterDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"KafkaClusterDescription"
      ( \Object
x ->
          Maybe ApacheKafkaClusterDescription -> KafkaClusterDescription
KafkaClusterDescription'
            (Maybe ApacheKafkaClusterDescription -> KafkaClusterDescription)
-> Parser (Maybe ApacheKafkaClusterDescription)
-> Parser KafkaClusterDescription
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ApacheKafkaClusterDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"apacheKafkaCluster")
      )

instance Prelude.Hashable KafkaClusterDescription

instance Prelude.NFData KafkaClusterDescription