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