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