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