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

-- | The description of the encryption in transit to the Apache Kafka
-- cluster.
--
-- /See:/ 'newKafkaClusterEncryptionInTransitDescription' smart constructor.
data KafkaClusterEncryptionInTransitDescription = KafkaClusterEncryptionInTransitDescription'
  { -- | The type of encryption in transit to the Apache Kafka cluster.
    KafkaClusterEncryptionInTransitDescription
-> Maybe KafkaClusterEncryptionInTransitType
encryptionType :: Prelude.Maybe KafkaClusterEncryptionInTransitType
  }
  deriving (KafkaClusterEncryptionInTransitDescription
-> KafkaClusterEncryptionInTransitDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KafkaClusterEncryptionInTransitDescription
-> KafkaClusterEncryptionInTransitDescription -> Bool
$c/= :: KafkaClusterEncryptionInTransitDescription
-> KafkaClusterEncryptionInTransitDescription -> Bool
== :: KafkaClusterEncryptionInTransitDescription
-> KafkaClusterEncryptionInTransitDescription -> Bool
$c== :: KafkaClusterEncryptionInTransitDescription
-> KafkaClusterEncryptionInTransitDescription -> Bool
Prelude.Eq, ReadPrec [KafkaClusterEncryptionInTransitDescription]
ReadPrec KafkaClusterEncryptionInTransitDescription
Int -> ReadS KafkaClusterEncryptionInTransitDescription
ReadS [KafkaClusterEncryptionInTransitDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KafkaClusterEncryptionInTransitDescription]
$creadListPrec :: ReadPrec [KafkaClusterEncryptionInTransitDescription]
readPrec :: ReadPrec KafkaClusterEncryptionInTransitDescription
$creadPrec :: ReadPrec KafkaClusterEncryptionInTransitDescription
readList :: ReadS [KafkaClusterEncryptionInTransitDescription]
$creadList :: ReadS [KafkaClusterEncryptionInTransitDescription]
readsPrec :: Int -> ReadS KafkaClusterEncryptionInTransitDescription
$creadsPrec :: Int -> ReadS KafkaClusterEncryptionInTransitDescription
Prelude.Read, Int -> KafkaClusterEncryptionInTransitDescription -> ShowS
[KafkaClusterEncryptionInTransitDescription] -> ShowS
KafkaClusterEncryptionInTransitDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KafkaClusterEncryptionInTransitDescription] -> ShowS
$cshowList :: [KafkaClusterEncryptionInTransitDescription] -> ShowS
show :: KafkaClusterEncryptionInTransitDescription -> String
$cshow :: KafkaClusterEncryptionInTransitDescription -> String
showsPrec :: Int -> KafkaClusterEncryptionInTransitDescription -> ShowS
$cshowsPrec :: Int -> KafkaClusterEncryptionInTransitDescription -> ShowS
Prelude.Show, forall x.
Rep KafkaClusterEncryptionInTransitDescription x
-> KafkaClusterEncryptionInTransitDescription
forall x.
KafkaClusterEncryptionInTransitDescription
-> Rep KafkaClusterEncryptionInTransitDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KafkaClusterEncryptionInTransitDescription x
-> KafkaClusterEncryptionInTransitDescription
$cfrom :: forall x.
KafkaClusterEncryptionInTransitDescription
-> Rep KafkaClusterEncryptionInTransitDescription x
Prelude.Generic)

-- |
-- Create a value of 'KafkaClusterEncryptionInTransitDescription' 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:
--
-- 'encryptionType', 'kafkaClusterEncryptionInTransitDescription_encryptionType' - The type of encryption in transit to the Apache Kafka cluster.
newKafkaClusterEncryptionInTransitDescription ::
  KafkaClusterEncryptionInTransitDescription
newKafkaClusterEncryptionInTransitDescription :: KafkaClusterEncryptionInTransitDescription
newKafkaClusterEncryptionInTransitDescription =
  KafkaClusterEncryptionInTransitDescription'
    { $sel:encryptionType:KafkaClusterEncryptionInTransitDescription' :: Maybe KafkaClusterEncryptionInTransitType
encryptionType =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The type of encryption in transit to the Apache Kafka cluster.
kafkaClusterEncryptionInTransitDescription_encryptionType :: Lens.Lens' KafkaClusterEncryptionInTransitDescription (Prelude.Maybe KafkaClusterEncryptionInTransitType)
kafkaClusterEncryptionInTransitDescription_encryptionType :: Lens'
  KafkaClusterEncryptionInTransitDescription
  (Maybe KafkaClusterEncryptionInTransitType)
kafkaClusterEncryptionInTransitDescription_encryptionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KafkaClusterEncryptionInTransitDescription' {Maybe KafkaClusterEncryptionInTransitType
encryptionType :: Maybe KafkaClusterEncryptionInTransitType
$sel:encryptionType:KafkaClusterEncryptionInTransitDescription' :: KafkaClusterEncryptionInTransitDescription
-> Maybe KafkaClusterEncryptionInTransitType
encryptionType} -> Maybe KafkaClusterEncryptionInTransitType
encryptionType) (\s :: KafkaClusterEncryptionInTransitDescription
s@KafkaClusterEncryptionInTransitDescription' {} Maybe KafkaClusterEncryptionInTransitType
a -> KafkaClusterEncryptionInTransitDescription
s {$sel:encryptionType:KafkaClusterEncryptionInTransitDescription' :: Maybe KafkaClusterEncryptionInTransitType
encryptionType = Maybe KafkaClusterEncryptionInTransitType
a} :: KafkaClusterEncryptionInTransitDescription)

instance
  Data.FromJSON
    KafkaClusterEncryptionInTransitDescription
  where
  parseJSON :: Value -> Parser KafkaClusterEncryptionInTransitDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"KafkaClusterEncryptionInTransitDescription"
      ( \Object
x ->
          Maybe KafkaClusterEncryptionInTransitType
-> KafkaClusterEncryptionInTransitDescription
KafkaClusterEncryptionInTransitDescription'
            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
"encryptionType")
      )

instance
  Prelude.Hashable
    KafkaClusterEncryptionInTransitDescription
  where
  hashWithSalt :: Int -> KafkaClusterEncryptionInTransitDescription -> Int
hashWithSalt
    Int
_salt
    KafkaClusterEncryptionInTransitDescription' {Maybe KafkaClusterEncryptionInTransitType
encryptionType :: Maybe KafkaClusterEncryptionInTransitType
$sel:encryptionType:KafkaClusterEncryptionInTransitDescription' :: KafkaClusterEncryptionInTransitDescription
-> Maybe KafkaClusterEncryptionInTransitType
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe KafkaClusterEncryptionInTransitType
encryptionType

instance
  Prelude.NFData
    KafkaClusterEncryptionInTransitDescription
  where
  rnf :: KafkaClusterEncryptionInTransitDescription -> ()
rnf KafkaClusterEncryptionInTransitDescription' {Maybe KafkaClusterEncryptionInTransitType
encryptionType :: Maybe KafkaClusterEncryptionInTransitType
$sel:encryptionType:KafkaClusterEncryptionInTransitDescription' :: KafkaClusterEncryptionInTransitDescription
-> Maybe KafkaClusterEncryptionInTransitType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe KafkaClusterEncryptionInTransitType
encryptionType