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

import qualified Amazonka.Core as Core
import Amazonka.KafkaConnect.Types.KafkaClusterEncryptionInTransitType
import qualified Amazonka.Lens as Lens
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
(KafkaClusterEncryptionInTransitDescription
 -> KafkaClusterEncryptionInTransitDescription -> Bool)
-> (KafkaClusterEncryptionInTransitDescription
    -> KafkaClusterEncryptionInTransitDescription -> Bool)
-> Eq KafkaClusterEncryptionInTransitDescription
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]
(Int -> ReadS KafkaClusterEncryptionInTransitDescription)
-> ReadS [KafkaClusterEncryptionInTransitDescription]
-> ReadPrec KafkaClusterEncryptionInTransitDescription
-> ReadPrec [KafkaClusterEncryptionInTransitDescription]
-> Read 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
(Int -> KafkaClusterEncryptionInTransitDescription -> ShowS)
-> (KafkaClusterEncryptionInTransitDescription -> String)
-> ([KafkaClusterEncryptionInTransitDescription] -> ShowS)
-> Show KafkaClusterEncryptionInTransitDescription
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.
 KafkaClusterEncryptionInTransitDescription
 -> Rep KafkaClusterEncryptionInTransitDescription x)
-> (forall x.
    Rep KafkaClusterEncryptionInTransitDescription x
    -> KafkaClusterEncryptionInTransitDescription)
-> Generic KafkaClusterEncryptionInTransitDescription
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' :: Maybe KafkaClusterEncryptionInTransitType
-> KafkaClusterEncryptionInTransitDescription
KafkaClusterEncryptionInTransitDescription'
    { $sel:encryptionType:KafkaClusterEncryptionInTransitDescription' :: Maybe KafkaClusterEncryptionInTransitType
encryptionType =
        Maybe KafkaClusterEncryptionInTransitType
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 :: (Maybe KafkaClusterEncryptionInTransitType
 -> f (Maybe KafkaClusterEncryptionInTransitType))
-> KafkaClusterEncryptionInTransitDescription
-> f KafkaClusterEncryptionInTransitDescription
kafkaClusterEncryptionInTransitDescription_encryptionType = (KafkaClusterEncryptionInTransitDescription
 -> Maybe KafkaClusterEncryptionInTransitType)
-> (KafkaClusterEncryptionInTransitDescription
    -> Maybe KafkaClusterEncryptionInTransitType
    -> KafkaClusterEncryptionInTransitDescription)
-> Lens
     KafkaClusterEncryptionInTransitDescription
     KafkaClusterEncryptionInTransitDescription
     (Maybe KafkaClusterEncryptionInTransitType)
     (Maybe KafkaClusterEncryptionInTransitType)
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
  Core.FromJSON
    KafkaClusterEncryptionInTransitDescription
  where
  parseJSON :: Value -> Parser KafkaClusterEncryptionInTransitDescription
parseJSON =
    String
-> (Object -> Parser KafkaClusterEncryptionInTransitDescription)
-> Value
-> Parser KafkaClusterEncryptionInTransitDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"KafkaClusterEncryptionInTransitDescription"
      ( \Object
x ->
          Maybe KafkaClusterEncryptionInTransitType
-> KafkaClusterEncryptionInTransitDescription
KafkaClusterEncryptionInTransitDescription'
            (Maybe KafkaClusterEncryptionInTransitType
 -> KafkaClusterEncryptionInTransitDescription)
-> Parser (Maybe KafkaClusterEncryptionInTransitType)
-> Parser KafkaClusterEncryptionInTransitDescription
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser (Maybe KafkaClusterEncryptionInTransitType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"encryptionType")
      )

instance
  Prelude.Hashable
    KafkaClusterEncryptionInTransitDescription

instance
  Prelude.NFData
    KafkaClusterEncryptionInTransitDescription