{-# 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 #-}
module Amazonka.Glue.Types.DataCatalogEncryptionSettings where
import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.ConnectionPasswordEncryption
import Amazonka.Glue.Types.EncryptionAtRest
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DataCatalogEncryptionSettings = DataCatalogEncryptionSettings'
{
DataCatalogEncryptionSettings -> Maybe EncryptionAtRest
encryptionAtRest :: Prelude.Maybe EncryptionAtRest,
DataCatalogEncryptionSettings -> Maybe ConnectionPasswordEncryption
connectionPasswordEncryption :: Prelude.Maybe ConnectionPasswordEncryption
}
deriving (DataCatalogEncryptionSettings
-> DataCatalogEncryptionSettings -> Bool
(DataCatalogEncryptionSettings
-> DataCatalogEncryptionSettings -> Bool)
-> (DataCatalogEncryptionSettings
-> DataCatalogEncryptionSettings -> Bool)
-> Eq DataCatalogEncryptionSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataCatalogEncryptionSettings
-> DataCatalogEncryptionSettings -> Bool
$c/= :: DataCatalogEncryptionSettings
-> DataCatalogEncryptionSettings -> Bool
== :: DataCatalogEncryptionSettings
-> DataCatalogEncryptionSettings -> Bool
$c== :: DataCatalogEncryptionSettings
-> DataCatalogEncryptionSettings -> Bool
Prelude.Eq, ReadPrec [DataCatalogEncryptionSettings]
ReadPrec DataCatalogEncryptionSettings
Int -> ReadS DataCatalogEncryptionSettings
ReadS [DataCatalogEncryptionSettings]
(Int -> ReadS DataCatalogEncryptionSettings)
-> ReadS [DataCatalogEncryptionSettings]
-> ReadPrec DataCatalogEncryptionSettings
-> ReadPrec [DataCatalogEncryptionSettings]
-> Read DataCatalogEncryptionSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataCatalogEncryptionSettings]
$creadListPrec :: ReadPrec [DataCatalogEncryptionSettings]
readPrec :: ReadPrec DataCatalogEncryptionSettings
$creadPrec :: ReadPrec DataCatalogEncryptionSettings
readList :: ReadS [DataCatalogEncryptionSettings]
$creadList :: ReadS [DataCatalogEncryptionSettings]
readsPrec :: Int -> ReadS DataCatalogEncryptionSettings
$creadsPrec :: Int -> ReadS DataCatalogEncryptionSettings
Prelude.Read, Int -> DataCatalogEncryptionSettings -> ShowS
[DataCatalogEncryptionSettings] -> ShowS
DataCatalogEncryptionSettings -> String
(Int -> DataCatalogEncryptionSettings -> ShowS)
-> (DataCatalogEncryptionSettings -> String)
-> ([DataCatalogEncryptionSettings] -> ShowS)
-> Show DataCatalogEncryptionSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataCatalogEncryptionSettings] -> ShowS
$cshowList :: [DataCatalogEncryptionSettings] -> ShowS
show :: DataCatalogEncryptionSettings -> String
$cshow :: DataCatalogEncryptionSettings -> String
showsPrec :: Int -> DataCatalogEncryptionSettings -> ShowS
$cshowsPrec :: Int -> DataCatalogEncryptionSettings -> ShowS
Prelude.Show, (forall x.
DataCatalogEncryptionSettings
-> Rep DataCatalogEncryptionSettings x)
-> (forall x.
Rep DataCatalogEncryptionSettings x
-> DataCatalogEncryptionSettings)
-> Generic DataCatalogEncryptionSettings
forall x.
Rep DataCatalogEncryptionSettings x
-> DataCatalogEncryptionSettings
forall x.
DataCatalogEncryptionSettings
-> Rep DataCatalogEncryptionSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DataCatalogEncryptionSettings x
-> DataCatalogEncryptionSettings
$cfrom :: forall x.
DataCatalogEncryptionSettings
-> Rep DataCatalogEncryptionSettings x
Prelude.Generic)
newDataCatalogEncryptionSettings ::
DataCatalogEncryptionSettings
newDataCatalogEncryptionSettings :: DataCatalogEncryptionSettings
newDataCatalogEncryptionSettings =
DataCatalogEncryptionSettings' :: Maybe EncryptionAtRest
-> Maybe ConnectionPasswordEncryption
-> DataCatalogEncryptionSettings
DataCatalogEncryptionSettings'
{ $sel:encryptionAtRest:DataCatalogEncryptionSettings' :: Maybe EncryptionAtRest
encryptionAtRest =
Maybe EncryptionAtRest
forall a. Maybe a
Prelude.Nothing,
$sel:connectionPasswordEncryption:DataCatalogEncryptionSettings' :: Maybe ConnectionPasswordEncryption
connectionPasswordEncryption =
Maybe ConnectionPasswordEncryption
forall a. Maybe a
Prelude.Nothing
}
dataCatalogEncryptionSettings_encryptionAtRest :: Lens.Lens' DataCatalogEncryptionSettings (Prelude.Maybe EncryptionAtRest)
dataCatalogEncryptionSettings_encryptionAtRest :: (Maybe EncryptionAtRest -> f (Maybe EncryptionAtRest))
-> DataCatalogEncryptionSettings -> f DataCatalogEncryptionSettings
dataCatalogEncryptionSettings_encryptionAtRest = (DataCatalogEncryptionSettings -> Maybe EncryptionAtRest)
-> (DataCatalogEncryptionSettings
-> Maybe EncryptionAtRest -> DataCatalogEncryptionSettings)
-> Lens
DataCatalogEncryptionSettings
DataCatalogEncryptionSettings
(Maybe EncryptionAtRest)
(Maybe EncryptionAtRest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataCatalogEncryptionSettings' {Maybe EncryptionAtRest
encryptionAtRest :: Maybe EncryptionAtRest
$sel:encryptionAtRest:DataCatalogEncryptionSettings' :: DataCatalogEncryptionSettings -> Maybe EncryptionAtRest
encryptionAtRest} -> Maybe EncryptionAtRest
encryptionAtRest) (\s :: DataCatalogEncryptionSettings
s@DataCatalogEncryptionSettings' {} Maybe EncryptionAtRest
a -> DataCatalogEncryptionSettings
s {$sel:encryptionAtRest:DataCatalogEncryptionSettings' :: Maybe EncryptionAtRest
encryptionAtRest = Maybe EncryptionAtRest
a} :: DataCatalogEncryptionSettings)
dataCatalogEncryptionSettings_connectionPasswordEncryption :: Lens.Lens' DataCatalogEncryptionSettings (Prelude.Maybe ConnectionPasswordEncryption)
dataCatalogEncryptionSettings_connectionPasswordEncryption :: (Maybe ConnectionPasswordEncryption
-> f (Maybe ConnectionPasswordEncryption))
-> DataCatalogEncryptionSettings -> f DataCatalogEncryptionSettings
dataCatalogEncryptionSettings_connectionPasswordEncryption = (DataCatalogEncryptionSettings
-> Maybe ConnectionPasswordEncryption)
-> (DataCatalogEncryptionSettings
-> Maybe ConnectionPasswordEncryption
-> DataCatalogEncryptionSettings)
-> Lens
DataCatalogEncryptionSettings
DataCatalogEncryptionSettings
(Maybe ConnectionPasswordEncryption)
(Maybe ConnectionPasswordEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataCatalogEncryptionSettings' {Maybe ConnectionPasswordEncryption
connectionPasswordEncryption :: Maybe ConnectionPasswordEncryption
$sel:connectionPasswordEncryption:DataCatalogEncryptionSettings' :: DataCatalogEncryptionSettings -> Maybe ConnectionPasswordEncryption
connectionPasswordEncryption} -> Maybe ConnectionPasswordEncryption
connectionPasswordEncryption) (\s :: DataCatalogEncryptionSettings
s@DataCatalogEncryptionSettings' {} Maybe ConnectionPasswordEncryption
a -> DataCatalogEncryptionSettings
s {$sel:connectionPasswordEncryption:DataCatalogEncryptionSettings' :: Maybe ConnectionPasswordEncryption
connectionPasswordEncryption = Maybe ConnectionPasswordEncryption
a} :: DataCatalogEncryptionSettings)
instance Core.FromJSON DataCatalogEncryptionSettings where
parseJSON :: Value -> Parser DataCatalogEncryptionSettings
parseJSON =
String
-> (Object -> Parser DataCatalogEncryptionSettings)
-> Value
-> Parser DataCatalogEncryptionSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DataCatalogEncryptionSettings"
( \Object
x ->
Maybe EncryptionAtRest
-> Maybe ConnectionPasswordEncryption
-> DataCatalogEncryptionSettings
DataCatalogEncryptionSettings'
(Maybe EncryptionAtRest
-> Maybe ConnectionPasswordEncryption
-> DataCatalogEncryptionSettings)
-> Parser (Maybe EncryptionAtRest)
-> Parser
(Maybe ConnectionPasswordEncryption
-> DataCatalogEncryptionSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EncryptionAtRest)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EncryptionAtRest")
Parser
(Maybe ConnectionPasswordEncryption
-> DataCatalogEncryptionSettings)
-> Parser (Maybe ConnectionPasswordEncryption)
-> Parser DataCatalogEncryptionSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConnectionPasswordEncryption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ConnectionPasswordEncryption")
)
instance
Prelude.Hashable
DataCatalogEncryptionSettings
instance Prelude.NFData DataCatalogEncryptionSettings
instance Core.ToJSON DataCatalogEncryptionSettings where
toJSON :: DataCatalogEncryptionSettings -> Value
toJSON DataCatalogEncryptionSettings' {Maybe ConnectionPasswordEncryption
Maybe EncryptionAtRest
connectionPasswordEncryption :: Maybe ConnectionPasswordEncryption
encryptionAtRest :: Maybe EncryptionAtRest
$sel:connectionPasswordEncryption:DataCatalogEncryptionSettings' :: DataCatalogEncryptionSettings -> Maybe ConnectionPasswordEncryption
$sel:encryptionAtRest:DataCatalogEncryptionSettings' :: DataCatalogEncryptionSettings -> Maybe EncryptionAtRest
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EncryptionAtRest" Text -> EncryptionAtRest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(EncryptionAtRest -> Pair) -> Maybe EncryptionAtRest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EncryptionAtRest
encryptionAtRest,
(Text
"ConnectionPasswordEncryption" Text -> ConnectionPasswordEncryption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ConnectionPasswordEncryption -> Pair)
-> Maybe ConnectionPasswordEncryption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConnectionPasswordEncryption
connectionPasswordEncryption
]
)