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