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