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

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

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

-- |
-- Create a value of 'KafkaClusterEncryptionInTransit' 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', 'kafkaClusterEncryptionInTransit_encryptionType' - The type of encryption in transit to the Apache Kafka cluster.
newKafkaClusterEncryptionInTransit ::
  -- | 'encryptionType'
  KafkaClusterEncryptionInTransitType ->
  KafkaClusterEncryptionInTransit
newKafkaClusterEncryptionInTransit :: KafkaClusterEncryptionInTransitType
-> KafkaClusterEncryptionInTransit
newKafkaClusterEncryptionInTransit KafkaClusterEncryptionInTransitType
pEncryptionType_ =
  KafkaClusterEncryptionInTransit' :: KafkaClusterEncryptionInTransitType
-> KafkaClusterEncryptionInTransit
KafkaClusterEncryptionInTransit'
    { $sel:encryptionType:KafkaClusterEncryptionInTransit' :: KafkaClusterEncryptionInTransitType
encryptionType =
        KafkaClusterEncryptionInTransitType
pEncryptionType_
    }

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

instance
  Prelude.Hashable
    KafkaClusterEncryptionInTransit

instance
  Prelude.NFData
    KafkaClusterEncryptionInTransit

instance Core.ToJSON KafkaClusterEncryptionInTransit where
  toJSON :: KafkaClusterEncryptionInTransit -> Value
toJSON KafkaClusterEncryptionInTransit' {KafkaClusterEncryptionInTransitType
encryptionType :: KafkaClusterEncryptionInTransitType
$sel:encryptionType:KafkaClusterEncryptionInTransit' :: KafkaClusterEncryptionInTransit
-> KafkaClusterEncryptionInTransitType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"encryptionType" Text -> KafkaClusterEncryptionInTransitType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= KafkaClusterEncryptionInTransitType
encryptionType)
          ]
      )