{-# 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.DynamoDB.Types.SSESpecification where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.SSEType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SSESpecification = SSESpecification'
{
SSESpecification -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
SSESpecification -> Maybe Text
kmsMasterKeyId :: Prelude.Maybe Prelude.Text,
SSESpecification -> Maybe SSEType
sSEType :: Prelude.Maybe SSEType
}
deriving (SSESpecification -> SSESpecification -> Bool
(SSESpecification -> SSESpecification -> Bool)
-> (SSESpecification -> SSESpecification -> Bool)
-> Eq SSESpecification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SSESpecification -> SSESpecification -> Bool
$c/= :: SSESpecification -> SSESpecification -> Bool
== :: SSESpecification -> SSESpecification -> Bool
$c== :: SSESpecification -> SSESpecification -> Bool
Prelude.Eq, ReadPrec [SSESpecification]
ReadPrec SSESpecification
Int -> ReadS SSESpecification
ReadS [SSESpecification]
(Int -> ReadS SSESpecification)
-> ReadS [SSESpecification]
-> ReadPrec SSESpecification
-> ReadPrec [SSESpecification]
-> Read SSESpecification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SSESpecification]
$creadListPrec :: ReadPrec [SSESpecification]
readPrec :: ReadPrec SSESpecification
$creadPrec :: ReadPrec SSESpecification
readList :: ReadS [SSESpecification]
$creadList :: ReadS [SSESpecification]
readsPrec :: Int -> ReadS SSESpecification
$creadsPrec :: Int -> ReadS SSESpecification
Prelude.Read, Int -> SSESpecification -> ShowS
[SSESpecification] -> ShowS
SSESpecification -> String
(Int -> SSESpecification -> ShowS)
-> (SSESpecification -> String)
-> ([SSESpecification] -> ShowS)
-> Show SSESpecification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SSESpecification] -> ShowS
$cshowList :: [SSESpecification] -> ShowS
show :: SSESpecification -> String
$cshow :: SSESpecification -> String
showsPrec :: Int -> SSESpecification -> ShowS
$cshowsPrec :: Int -> SSESpecification -> ShowS
Prelude.Show, (forall x. SSESpecification -> Rep SSESpecification x)
-> (forall x. Rep SSESpecification x -> SSESpecification)
-> Generic SSESpecification
forall x. Rep SSESpecification x -> SSESpecification
forall x. SSESpecification -> Rep SSESpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SSESpecification x -> SSESpecification
$cfrom :: forall x. SSESpecification -> Rep SSESpecification x
Prelude.Generic)
newSSESpecification ::
SSESpecification
newSSESpecification :: SSESpecification
newSSESpecification =
SSESpecification' :: Maybe Bool -> Maybe Text -> Maybe SSEType -> SSESpecification
SSESpecification'
{ $sel:enabled:SSESpecification' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:kmsMasterKeyId:SSESpecification' :: Maybe Text
kmsMasterKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sSEType:SSESpecification' :: Maybe SSEType
sSEType = Maybe SSEType
forall a. Maybe a
Prelude.Nothing
}
sSESpecification_enabled :: Lens.Lens' SSESpecification (Prelude.Maybe Prelude.Bool)
sSESpecification_enabled :: (Maybe Bool -> f (Maybe Bool))
-> SSESpecification -> f SSESpecification
sSESpecification_enabled = (SSESpecification -> Maybe Bool)
-> (SSESpecification -> Maybe Bool -> SSESpecification)
-> Lens SSESpecification SSESpecification (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSESpecification' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:SSESpecification' :: SSESpecification -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: SSESpecification
s@SSESpecification' {} Maybe Bool
a -> SSESpecification
s {$sel:enabled:SSESpecification' :: Maybe Bool
enabled = Maybe Bool
a} :: SSESpecification)
sSESpecification_kmsMasterKeyId :: Lens.Lens' SSESpecification (Prelude.Maybe Prelude.Text)
sSESpecification_kmsMasterKeyId :: (Maybe Text -> f (Maybe Text))
-> SSESpecification -> f SSESpecification
sSESpecification_kmsMasterKeyId = (SSESpecification -> Maybe Text)
-> (SSESpecification -> Maybe Text -> SSESpecification)
-> Lens SSESpecification SSESpecification (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSESpecification' {Maybe Text
kmsMasterKeyId :: Maybe Text
$sel:kmsMasterKeyId:SSESpecification' :: SSESpecification -> Maybe Text
kmsMasterKeyId} -> Maybe Text
kmsMasterKeyId) (\s :: SSESpecification
s@SSESpecification' {} Maybe Text
a -> SSESpecification
s {$sel:kmsMasterKeyId:SSESpecification' :: Maybe Text
kmsMasterKeyId = Maybe Text
a} :: SSESpecification)
sSESpecification_sSEType :: Lens.Lens' SSESpecification (Prelude.Maybe SSEType)
sSESpecification_sSEType :: (Maybe SSEType -> f (Maybe SSEType))
-> SSESpecification -> f SSESpecification
sSESpecification_sSEType = (SSESpecification -> Maybe SSEType)
-> (SSESpecification -> Maybe SSEType -> SSESpecification)
-> Lens
SSESpecification SSESpecification (Maybe SSEType) (Maybe SSEType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SSESpecification' {Maybe SSEType
sSEType :: Maybe SSEType
$sel:sSEType:SSESpecification' :: SSESpecification -> Maybe SSEType
sSEType} -> Maybe SSEType
sSEType) (\s :: SSESpecification
s@SSESpecification' {} Maybe SSEType
a -> SSESpecification
s {$sel:sSEType:SSESpecification' :: Maybe SSEType
sSEType = Maybe SSEType
a} :: SSESpecification)
instance Prelude.Hashable SSESpecification
instance Prelude.NFData SSESpecification
instance Core.ToJSON SSESpecification where
toJSON :: SSESpecification -> Value
toJSON SSESpecification' {Maybe Bool
Maybe Text
Maybe SSEType
sSEType :: Maybe SSEType
kmsMasterKeyId :: Maybe Text
enabled :: Maybe Bool
$sel:sSEType:SSESpecification' :: SSESpecification -> Maybe SSEType
$sel:kmsMasterKeyId:SSESpecification' :: SSESpecification -> Maybe Text
$sel:enabled:SSESpecification' :: SSESpecification -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Enabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enabled,
(Text
"KMSMasterKeyId" 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
kmsMasterKeyId,
(Text
"SSEType" Text -> SSEType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SSEType -> Pair) -> Maybe SSEType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SSEType
sSEType
]
)