{-# 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.MacieV2.Types.ServerSideEncryption where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types.EncryptionType
import qualified Amazonka.Prelude as Prelude
data ServerSideEncryption = ServerSideEncryption'
{
ServerSideEncryption -> Maybe EncryptionType
encryptionType :: Prelude.Maybe EncryptionType,
ServerSideEncryption -> Maybe Text
kmsMasterKeyId :: Prelude.Maybe Prelude.Text
}
deriving (ServerSideEncryption -> ServerSideEncryption -> Bool
(ServerSideEncryption -> ServerSideEncryption -> Bool)
-> (ServerSideEncryption -> ServerSideEncryption -> Bool)
-> Eq ServerSideEncryption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServerSideEncryption -> ServerSideEncryption -> Bool
$c/= :: ServerSideEncryption -> ServerSideEncryption -> Bool
== :: ServerSideEncryption -> ServerSideEncryption -> Bool
$c== :: ServerSideEncryption -> ServerSideEncryption -> Bool
Prelude.Eq, ReadPrec [ServerSideEncryption]
ReadPrec ServerSideEncryption
Int -> ReadS ServerSideEncryption
ReadS [ServerSideEncryption]
(Int -> ReadS ServerSideEncryption)
-> ReadS [ServerSideEncryption]
-> ReadPrec ServerSideEncryption
-> ReadPrec [ServerSideEncryption]
-> Read ServerSideEncryption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServerSideEncryption]
$creadListPrec :: ReadPrec [ServerSideEncryption]
readPrec :: ReadPrec ServerSideEncryption
$creadPrec :: ReadPrec ServerSideEncryption
readList :: ReadS [ServerSideEncryption]
$creadList :: ReadS [ServerSideEncryption]
readsPrec :: Int -> ReadS ServerSideEncryption
$creadsPrec :: Int -> ReadS ServerSideEncryption
Prelude.Read, Int -> ServerSideEncryption -> ShowS
[ServerSideEncryption] -> ShowS
ServerSideEncryption -> String
(Int -> ServerSideEncryption -> ShowS)
-> (ServerSideEncryption -> String)
-> ([ServerSideEncryption] -> ShowS)
-> Show ServerSideEncryption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServerSideEncryption] -> ShowS
$cshowList :: [ServerSideEncryption] -> ShowS
show :: ServerSideEncryption -> String
$cshow :: ServerSideEncryption -> String
showsPrec :: Int -> ServerSideEncryption -> ShowS
$cshowsPrec :: Int -> ServerSideEncryption -> ShowS
Prelude.Show, (forall x. ServerSideEncryption -> Rep ServerSideEncryption x)
-> (forall x. Rep ServerSideEncryption x -> ServerSideEncryption)
-> Generic ServerSideEncryption
forall x. Rep ServerSideEncryption x -> ServerSideEncryption
forall x. ServerSideEncryption -> Rep ServerSideEncryption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServerSideEncryption x -> ServerSideEncryption
$cfrom :: forall x. ServerSideEncryption -> Rep ServerSideEncryption x
Prelude.Generic)
newServerSideEncryption ::
ServerSideEncryption
newServerSideEncryption :: ServerSideEncryption
newServerSideEncryption =
ServerSideEncryption' :: Maybe EncryptionType -> Maybe Text -> ServerSideEncryption
ServerSideEncryption'
{ $sel:encryptionType:ServerSideEncryption' :: Maybe EncryptionType
encryptionType =
Maybe EncryptionType
forall a. Maybe a
Prelude.Nothing,
$sel:kmsMasterKeyId:ServerSideEncryption' :: Maybe Text
kmsMasterKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
serverSideEncryption_encryptionType :: Lens.Lens' ServerSideEncryption (Prelude.Maybe EncryptionType)
serverSideEncryption_encryptionType :: (Maybe EncryptionType -> f (Maybe EncryptionType))
-> ServerSideEncryption -> f ServerSideEncryption
serverSideEncryption_encryptionType = (ServerSideEncryption -> Maybe EncryptionType)
-> (ServerSideEncryption
-> Maybe EncryptionType -> ServerSideEncryption)
-> Lens
ServerSideEncryption
ServerSideEncryption
(Maybe EncryptionType)
(Maybe EncryptionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerSideEncryption' {Maybe EncryptionType
encryptionType :: Maybe EncryptionType
$sel:encryptionType:ServerSideEncryption' :: ServerSideEncryption -> Maybe EncryptionType
encryptionType} -> Maybe EncryptionType
encryptionType) (\s :: ServerSideEncryption
s@ServerSideEncryption' {} Maybe EncryptionType
a -> ServerSideEncryption
s {$sel:encryptionType:ServerSideEncryption' :: Maybe EncryptionType
encryptionType = Maybe EncryptionType
a} :: ServerSideEncryption)
serverSideEncryption_kmsMasterKeyId :: Lens.Lens' ServerSideEncryption (Prelude.Maybe Prelude.Text)
serverSideEncryption_kmsMasterKeyId :: (Maybe Text -> f (Maybe Text))
-> ServerSideEncryption -> f ServerSideEncryption
serverSideEncryption_kmsMasterKeyId = (ServerSideEncryption -> Maybe Text)
-> (ServerSideEncryption -> Maybe Text -> ServerSideEncryption)
-> Lens
ServerSideEncryption ServerSideEncryption (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerSideEncryption' {Maybe Text
kmsMasterKeyId :: Maybe Text
$sel:kmsMasterKeyId:ServerSideEncryption' :: ServerSideEncryption -> Maybe Text
kmsMasterKeyId} -> Maybe Text
kmsMasterKeyId) (\s :: ServerSideEncryption
s@ServerSideEncryption' {} Maybe Text
a -> ServerSideEncryption
s {$sel:kmsMasterKeyId:ServerSideEncryption' :: Maybe Text
kmsMasterKeyId = Maybe Text
a} :: ServerSideEncryption)
instance Core.FromJSON ServerSideEncryption where
parseJSON :: Value -> Parser ServerSideEncryption
parseJSON =
String
-> (Object -> Parser ServerSideEncryption)
-> Value
-> Parser ServerSideEncryption
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ServerSideEncryption"
( \Object
x ->
Maybe EncryptionType -> Maybe Text -> ServerSideEncryption
ServerSideEncryption'
(Maybe EncryptionType -> Maybe Text -> ServerSideEncryption)
-> Parser (Maybe EncryptionType)
-> Parser (Maybe Text -> ServerSideEncryption)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EncryptionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"encryptionType")
Parser (Maybe Text -> ServerSideEncryption)
-> Parser (Maybe Text) -> Parser ServerSideEncryption
forall (f :: * -> *) a b. Applicative f => 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
"kmsMasterKeyId")
)
instance Prelude.Hashable ServerSideEncryption
instance Prelude.NFData ServerSideEncryption