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

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

-- | The client authentication information used in order to authenticate with
-- the Apache Kafka cluster.
--
-- /See:/ 'newKafkaClusterClientAuthenticationDescription' smart constructor.
data KafkaClusterClientAuthenticationDescription = KafkaClusterClientAuthenticationDescription'
  { -- | The type of client authentication used to connect to the Apache Kafka
    -- cluster. Value NONE means that no client authentication is used.
    KafkaClusterClientAuthenticationDescription
-> Maybe KafkaClusterClientAuthenticationType
authenticationType :: Prelude.Maybe KafkaClusterClientAuthenticationType
  }
  deriving (KafkaClusterClientAuthenticationDescription
-> KafkaClusterClientAuthenticationDescription -> Bool
(KafkaClusterClientAuthenticationDescription
 -> KafkaClusterClientAuthenticationDescription -> Bool)
-> (KafkaClusterClientAuthenticationDescription
    -> KafkaClusterClientAuthenticationDescription -> Bool)
-> Eq KafkaClusterClientAuthenticationDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KafkaClusterClientAuthenticationDescription
-> KafkaClusterClientAuthenticationDescription -> Bool
$c/= :: KafkaClusterClientAuthenticationDescription
-> KafkaClusterClientAuthenticationDescription -> Bool
== :: KafkaClusterClientAuthenticationDescription
-> KafkaClusterClientAuthenticationDescription -> Bool
$c== :: KafkaClusterClientAuthenticationDescription
-> KafkaClusterClientAuthenticationDescription -> Bool
Prelude.Eq, ReadPrec [KafkaClusterClientAuthenticationDescription]
ReadPrec KafkaClusterClientAuthenticationDescription
Int -> ReadS KafkaClusterClientAuthenticationDescription
ReadS [KafkaClusterClientAuthenticationDescription]
(Int -> ReadS KafkaClusterClientAuthenticationDescription)
-> ReadS [KafkaClusterClientAuthenticationDescription]
-> ReadPrec KafkaClusterClientAuthenticationDescription
-> ReadPrec [KafkaClusterClientAuthenticationDescription]
-> Read KafkaClusterClientAuthenticationDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KafkaClusterClientAuthenticationDescription]
$creadListPrec :: ReadPrec [KafkaClusterClientAuthenticationDescription]
readPrec :: ReadPrec KafkaClusterClientAuthenticationDescription
$creadPrec :: ReadPrec KafkaClusterClientAuthenticationDescription
readList :: ReadS [KafkaClusterClientAuthenticationDescription]
$creadList :: ReadS [KafkaClusterClientAuthenticationDescription]
readsPrec :: Int -> ReadS KafkaClusterClientAuthenticationDescription
$creadsPrec :: Int -> ReadS KafkaClusterClientAuthenticationDescription
Prelude.Read, Int -> KafkaClusterClientAuthenticationDescription -> ShowS
[KafkaClusterClientAuthenticationDescription] -> ShowS
KafkaClusterClientAuthenticationDescription -> String
(Int -> KafkaClusterClientAuthenticationDescription -> ShowS)
-> (KafkaClusterClientAuthenticationDescription -> String)
-> ([KafkaClusterClientAuthenticationDescription] -> ShowS)
-> Show KafkaClusterClientAuthenticationDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KafkaClusterClientAuthenticationDescription] -> ShowS
$cshowList :: [KafkaClusterClientAuthenticationDescription] -> ShowS
show :: KafkaClusterClientAuthenticationDescription -> String
$cshow :: KafkaClusterClientAuthenticationDescription -> String
showsPrec :: Int -> KafkaClusterClientAuthenticationDescription -> ShowS
$cshowsPrec :: Int -> KafkaClusterClientAuthenticationDescription -> ShowS
Prelude.Show, (forall x.
 KafkaClusterClientAuthenticationDescription
 -> Rep KafkaClusterClientAuthenticationDescription x)
-> (forall x.
    Rep KafkaClusterClientAuthenticationDescription x
    -> KafkaClusterClientAuthenticationDescription)
-> Generic KafkaClusterClientAuthenticationDescription
forall x.
Rep KafkaClusterClientAuthenticationDescription x
-> KafkaClusterClientAuthenticationDescription
forall x.
KafkaClusterClientAuthenticationDescription
-> Rep KafkaClusterClientAuthenticationDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KafkaClusterClientAuthenticationDescription x
-> KafkaClusterClientAuthenticationDescription
$cfrom :: forall x.
KafkaClusterClientAuthenticationDescription
-> Rep KafkaClusterClientAuthenticationDescription x
Prelude.Generic)

-- |
-- Create a value of 'KafkaClusterClientAuthenticationDescription' 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:
--
-- 'authenticationType', 'kafkaClusterClientAuthenticationDescription_authenticationType' - The type of client authentication used to connect to the Apache Kafka
-- cluster. Value NONE means that no client authentication is used.
newKafkaClusterClientAuthenticationDescription ::
  KafkaClusterClientAuthenticationDescription
newKafkaClusterClientAuthenticationDescription :: KafkaClusterClientAuthenticationDescription
newKafkaClusterClientAuthenticationDescription =
  KafkaClusterClientAuthenticationDescription' :: Maybe KafkaClusterClientAuthenticationType
-> KafkaClusterClientAuthenticationDescription
KafkaClusterClientAuthenticationDescription'
    { $sel:authenticationType:KafkaClusterClientAuthenticationDescription' :: Maybe KafkaClusterClientAuthenticationType
authenticationType =
        Maybe KafkaClusterClientAuthenticationType
forall a. Maybe a
Prelude.Nothing
    }

-- | The type of client authentication used to connect to the Apache Kafka
-- cluster. Value NONE means that no client authentication is used.
kafkaClusterClientAuthenticationDescription_authenticationType :: Lens.Lens' KafkaClusterClientAuthenticationDescription (Prelude.Maybe KafkaClusterClientAuthenticationType)
kafkaClusterClientAuthenticationDescription_authenticationType :: (Maybe KafkaClusterClientAuthenticationType
 -> f (Maybe KafkaClusterClientAuthenticationType))
-> KafkaClusterClientAuthenticationDescription
-> f KafkaClusterClientAuthenticationDescription
kafkaClusterClientAuthenticationDescription_authenticationType = (KafkaClusterClientAuthenticationDescription
 -> Maybe KafkaClusterClientAuthenticationType)
-> (KafkaClusterClientAuthenticationDescription
    -> Maybe KafkaClusterClientAuthenticationType
    -> KafkaClusterClientAuthenticationDescription)
-> Lens
     KafkaClusterClientAuthenticationDescription
     KafkaClusterClientAuthenticationDescription
     (Maybe KafkaClusterClientAuthenticationType)
     (Maybe KafkaClusterClientAuthenticationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KafkaClusterClientAuthenticationDescription' {Maybe KafkaClusterClientAuthenticationType
authenticationType :: Maybe KafkaClusterClientAuthenticationType
$sel:authenticationType:KafkaClusterClientAuthenticationDescription' :: KafkaClusterClientAuthenticationDescription
-> Maybe KafkaClusterClientAuthenticationType
authenticationType} -> Maybe KafkaClusterClientAuthenticationType
authenticationType) (\s :: KafkaClusterClientAuthenticationDescription
s@KafkaClusterClientAuthenticationDescription' {} Maybe KafkaClusterClientAuthenticationType
a -> KafkaClusterClientAuthenticationDescription
s {$sel:authenticationType:KafkaClusterClientAuthenticationDescription' :: Maybe KafkaClusterClientAuthenticationType
authenticationType = Maybe KafkaClusterClientAuthenticationType
a} :: KafkaClusterClientAuthenticationDescription)

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

instance
  Prelude.Hashable
    KafkaClusterClientAuthenticationDescription

instance
  Prelude.NFData
    KafkaClusterClientAuthenticationDescription