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