{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types.MLUserDataEncryptionModeString
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
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]
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
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. 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'
{ $sel:kmsKeyId:MLUserDataEncryption' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
$sel:mlUserDataEncryptionMode:MLUserDataEncryption' :: MLUserDataEncryptionModeString
mlUserDataEncryptionMode =
MLUserDataEncryptionModeString
pMlUserDataEncryptionMode_
}
mLUserDataEncryption_kmsKeyId :: Lens.Lens' MLUserDataEncryption (Prelude.Maybe Prelude.Text)
mLUserDataEncryption_kmsKeyId :: Lens' MLUserDataEncryption (Maybe Text)
mLUserDataEncryption_kmsKeyId = 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 :: Lens' MLUserDataEncryption MLUserDataEncryptionModeString
mLUserDataEncryption_mlUserDataEncryptionMode = 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 Data.FromJSON MLUserDataEncryption where
parseJSON :: Value -> Parser MLUserDataEncryption
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MLUserDataEncryption"
( \Object
x ->
Maybe Text
-> MLUserDataEncryptionModeString -> MLUserDataEncryption
MLUserDataEncryption'
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
"KmsKeyId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MlUserDataEncryptionMode")
)
instance Prelude.Hashable MLUserDataEncryption where
hashWithSalt :: Int -> MLUserDataEncryption -> Int
hashWithSalt Int
_salt MLUserDataEncryption' {Maybe Text
MLUserDataEncryptionModeString
mlUserDataEncryptionMode :: MLUserDataEncryptionModeString
kmsKeyId :: Maybe Text
$sel:mlUserDataEncryptionMode:MLUserDataEncryption' :: MLUserDataEncryption -> MLUserDataEncryptionModeString
$sel:kmsKeyId:MLUserDataEncryption' :: MLUserDataEncryption -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` MLUserDataEncryptionModeString
mlUserDataEncryptionMode
instance Prelude.NFData MLUserDataEncryption where
rnf :: MLUserDataEncryption -> ()
rnf MLUserDataEncryption' {Maybe Text
MLUserDataEncryptionModeString
mlUserDataEncryptionMode :: MLUserDataEncryptionModeString
kmsKeyId :: Maybe Text
$sel:mlUserDataEncryptionMode:MLUserDataEncryption' :: MLUserDataEncryption -> MLUserDataEncryptionModeString
$sel:kmsKeyId:MLUserDataEncryption' :: MLUserDataEncryption -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MLUserDataEncryptionModeString
mlUserDataEncryptionMode
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"KmsKeyId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyId,
forall a. a -> Maybe a
Prelude.Just
( Key
"MlUserDataEncryptionMode"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= MLUserDataEncryptionModeString
mlUserDataEncryptionMode
)
]
)