{-# 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.KafkaCluster
-- 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.KafkaCluster 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.ApacheKafkaCluster
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'KafkaCluster' 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', 'kafkaCluster_apacheKafkaCluster' - The Apache Kafka cluster to which the connector is connected.
newKafkaCluster ::
  -- | 'apacheKafkaCluster'
  ApacheKafkaCluster ->
  KafkaCluster
newKafkaCluster :: ApacheKafkaCluster -> KafkaCluster
newKafkaCluster ApacheKafkaCluster
pApacheKafkaCluster_ =
  KafkaCluster'
    { $sel:apacheKafkaCluster:KafkaCluster' :: ApacheKafkaCluster
apacheKafkaCluster =
        ApacheKafkaCluster
pApacheKafkaCluster_
    }

-- | The Apache Kafka cluster to which the connector is connected.
kafkaCluster_apacheKafkaCluster :: Lens.Lens' KafkaCluster ApacheKafkaCluster
kafkaCluster_apacheKafkaCluster :: Lens' KafkaCluster ApacheKafkaCluster
kafkaCluster_apacheKafkaCluster = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KafkaCluster' {ApacheKafkaCluster
apacheKafkaCluster :: ApacheKafkaCluster
$sel:apacheKafkaCluster:KafkaCluster' :: KafkaCluster -> ApacheKafkaCluster
apacheKafkaCluster} -> ApacheKafkaCluster
apacheKafkaCluster) (\s :: KafkaCluster
s@KafkaCluster' {} ApacheKafkaCluster
a -> KafkaCluster
s {$sel:apacheKafkaCluster:KafkaCluster' :: ApacheKafkaCluster
apacheKafkaCluster = ApacheKafkaCluster
a} :: KafkaCluster)

instance Prelude.Hashable KafkaCluster where
  hashWithSalt :: Int -> KafkaCluster -> Int
hashWithSalt Int
_salt KafkaCluster' {ApacheKafkaCluster
apacheKafkaCluster :: ApacheKafkaCluster
$sel:apacheKafkaCluster:KafkaCluster' :: KafkaCluster -> ApacheKafkaCluster
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ApacheKafkaCluster
apacheKafkaCluster

instance Prelude.NFData KafkaCluster where
  rnf :: KafkaCluster -> ()
rnf KafkaCluster' {ApacheKafkaCluster
apacheKafkaCluster :: ApacheKafkaCluster
$sel:apacheKafkaCluster:KafkaCluster' :: KafkaCluster -> ApacheKafkaCluster
..} =
    forall a. NFData a => a -> ()
Prelude.rnf ApacheKafkaCluster
apacheKafkaCluster

instance Data.ToJSON KafkaCluster where
  toJSON :: KafkaCluster -> Value
toJSON KafkaCluster' {ApacheKafkaCluster
apacheKafkaCluster :: ApacheKafkaCluster
$sel:apacheKafkaCluster:KafkaCluster' :: KafkaCluster -> ApacheKafkaCluster
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"apacheKafkaCluster" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ApacheKafkaCluster
apacheKafkaCluster)
          ]
      )