{-# 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.ElasticTranscoder.Types.HlsContentProtection where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HlsContentProtection = HlsContentProtection'
{
HlsContentProtection -> Maybe Text
keyMd5 :: Prelude.Maybe Prelude.Text,
HlsContentProtection -> Maybe Text
keyStoragePolicy :: Prelude.Maybe Prelude.Text,
HlsContentProtection -> Maybe Text
key :: Prelude.Maybe Prelude.Text,
HlsContentProtection -> Maybe Text
method :: Prelude.Maybe Prelude.Text,
HlsContentProtection -> Maybe Text
initializationVector :: Prelude.Maybe Prelude.Text,
HlsContentProtection -> Maybe Text
licenseAcquisitionUrl :: Prelude.Maybe Prelude.Text
}
deriving (HlsContentProtection -> HlsContentProtection -> Bool
(HlsContentProtection -> HlsContentProtection -> Bool)
-> (HlsContentProtection -> HlsContentProtection -> Bool)
-> Eq HlsContentProtection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HlsContentProtection -> HlsContentProtection -> Bool
$c/= :: HlsContentProtection -> HlsContentProtection -> Bool
== :: HlsContentProtection -> HlsContentProtection -> Bool
$c== :: HlsContentProtection -> HlsContentProtection -> Bool
Prelude.Eq, ReadPrec [HlsContentProtection]
ReadPrec HlsContentProtection
Int -> ReadS HlsContentProtection
ReadS [HlsContentProtection]
(Int -> ReadS HlsContentProtection)
-> ReadS [HlsContentProtection]
-> ReadPrec HlsContentProtection
-> ReadPrec [HlsContentProtection]
-> Read HlsContentProtection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HlsContentProtection]
$creadListPrec :: ReadPrec [HlsContentProtection]
readPrec :: ReadPrec HlsContentProtection
$creadPrec :: ReadPrec HlsContentProtection
readList :: ReadS [HlsContentProtection]
$creadList :: ReadS [HlsContentProtection]
readsPrec :: Int -> ReadS HlsContentProtection
$creadsPrec :: Int -> ReadS HlsContentProtection
Prelude.Read, Int -> HlsContentProtection -> ShowS
[HlsContentProtection] -> ShowS
HlsContentProtection -> String
(Int -> HlsContentProtection -> ShowS)
-> (HlsContentProtection -> String)
-> ([HlsContentProtection] -> ShowS)
-> Show HlsContentProtection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HlsContentProtection] -> ShowS
$cshowList :: [HlsContentProtection] -> ShowS
show :: HlsContentProtection -> String
$cshow :: HlsContentProtection -> String
showsPrec :: Int -> HlsContentProtection -> ShowS
$cshowsPrec :: Int -> HlsContentProtection -> ShowS
Prelude.Show, (forall x. HlsContentProtection -> Rep HlsContentProtection x)
-> (forall x. Rep HlsContentProtection x -> HlsContentProtection)
-> Generic HlsContentProtection
forall x. Rep HlsContentProtection x -> HlsContentProtection
forall x. HlsContentProtection -> Rep HlsContentProtection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HlsContentProtection x -> HlsContentProtection
$cfrom :: forall x. HlsContentProtection -> Rep HlsContentProtection x
Prelude.Generic)
newHlsContentProtection ::
HlsContentProtection
newHlsContentProtection :: HlsContentProtection
newHlsContentProtection =
HlsContentProtection' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> HlsContentProtection
HlsContentProtection'
{ $sel:keyMd5:HlsContentProtection' :: Maybe Text
keyMd5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:keyStoragePolicy:HlsContentProtection' :: Maybe Text
keyStoragePolicy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:key:HlsContentProtection' :: Maybe Text
key = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:method:HlsContentProtection' :: Maybe Text
method = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:initializationVector:HlsContentProtection' :: Maybe Text
initializationVector = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:licenseAcquisitionUrl:HlsContentProtection' :: Maybe Text
licenseAcquisitionUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
hlsContentProtection_keyMd5 :: Lens.Lens' HlsContentProtection (Prelude.Maybe Prelude.Text)
hlsContentProtection_keyMd5 :: (Maybe Text -> f (Maybe Text))
-> HlsContentProtection -> f HlsContentProtection
hlsContentProtection_keyMd5 = (HlsContentProtection -> Maybe Text)
-> (HlsContentProtection -> Maybe Text -> HlsContentProtection)
-> Lens
HlsContentProtection HlsContentProtection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsContentProtection' {Maybe Text
keyMd5 :: Maybe Text
$sel:keyMd5:HlsContentProtection' :: HlsContentProtection -> Maybe Text
keyMd5} -> Maybe Text
keyMd5) (\s :: HlsContentProtection
s@HlsContentProtection' {} Maybe Text
a -> HlsContentProtection
s {$sel:keyMd5:HlsContentProtection' :: Maybe Text
keyMd5 = Maybe Text
a} :: HlsContentProtection)
hlsContentProtection_keyStoragePolicy :: Lens.Lens' HlsContentProtection (Prelude.Maybe Prelude.Text)
hlsContentProtection_keyStoragePolicy :: (Maybe Text -> f (Maybe Text))
-> HlsContentProtection -> f HlsContentProtection
hlsContentProtection_keyStoragePolicy = (HlsContentProtection -> Maybe Text)
-> (HlsContentProtection -> Maybe Text -> HlsContentProtection)
-> Lens
HlsContentProtection HlsContentProtection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsContentProtection' {Maybe Text
keyStoragePolicy :: Maybe Text
$sel:keyStoragePolicy:HlsContentProtection' :: HlsContentProtection -> Maybe Text
keyStoragePolicy} -> Maybe Text
keyStoragePolicy) (\s :: HlsContentProtection
s@HlsContentProtection' {} Maybe Text
a -> HlsContentProtection
s {$sel:keyStoragePolicy:HlsContentProtection' :: Maybe Text
keyStoragePolicy = Maybe Text
a} :: HlsContentProtection)
hlsContentProtection_key :: Lens.Lens' HlsContentProtection (Prelude.Maybe Prelude.Text)
hlsContentProtection_key :: (Maybe Text -> f (Maybe Text))
-> HlsContentProtection -> f HlsContentProtection
hlsContentProtection_key = (HlsContentProtection -> Maybe Text)
-> (HlsContentProtection -> Maybe Text -> HlsContentProtection)
-> Lens
HlsContentProtection HlsContentProtection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsContentProtection' {Maybe Text
key :: Maybe Text
$sel:key:HlsContentProtection' :: HlsContentProtection -> Maybe Text
key} -> Maybe Text
key) (\s :: HlsContentProtection
s@HlsContentProtection' {} Maybe Text
a -> HlsContentProtection
s {$sel:key:HlsContentProtection' :: Maybe Text
key = Maybe Text
a} :: HlsContentProtection)
hlsContentProtection_method :: Lens.Lens' HlsContentProtection (Prelude.Maybe Prelude.Text)
hlsContentProtection_method :: (Maybe Text -> f (Maybe Text))
-> HlsContentProtection -> f HlsContentProtection
hlsContentProtection_method = (HlsContentProtection -> Maybe Text)
-> (HlsContentProtection -> Maybe Text -> HlsContentProtection)
-> Lens
HlsContentProtection HlsContentProtection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsContentProtection' {Maybe Text
method :: Maybe Text
$sel:method:HlsContentProtection' :: HlsContentProtection -> Maybe Text
method} -> Maybe Text
method) (\s :: HlsContentProtection
s@HlsContentProtection' {} Maybe Text
a -> HlsContentProtection
s {$sel:method:HlsContentProtection' :: Maybe Text
method = Maybe Text
a} :: HlsContentProtection)
hlsContentProtection_initializationVector :: Lens.Lens' HlsContentProtection (Prelude.Maybe Prelude.Text)
hlsContentProtection_initializationVector :: (Maybe Text -> f (Maybe Text))
-> HlsContentProtection -> f HlsContentProtection
hlsContentProtection_initializationVector = (HlsContentProtection -> Maybe Text)
-> (HlsContentProtection -> Maybe Text -> HlsContentProtection)
-> Lens
HlsContentProtection HlsContentProtection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsContentProtection' {Maybe Text
initializationVector :: Maybe Text
$sel:initializationVector:HlsContentProtection' :: HlsContentProtection -> Maybe Text
initializationVector} -> Maybe Text
initializationVector) (\s :: HlsContentProtection
s@HlsContentProtection' {} Maybe Text
a -> HlsContentProtection
s {$sel:initializationVector:HlsContentProtection' :: Maybe Text
initializationVector = Maybe Text
a} :: HlsContentProtection)
hlsContentProtection_licenseAcquisitionUrl :: Lens.Lens' HlsContentProtection (Prelude.Maybe Prelude.Text)
hlsContentProtection_licenseAcquisitionUrl :: (Maybe Text -> f (Maybe Text))
-> HlsContentProtection -> f HlsContentProtection
hlsContentProtection_licenseAcquisitionUrl = (HlsContentProtection -> Maybe Text)
-> (HlsContentProtection -> Maybe Text -> HlsContentProtection)
-> Lens
HlsContentProtection HlsContentProtection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsContentProtection' {Maybe Text
licenseAcquisitionUrl :: Maybe Text
$sel:licenseAcquisitionUrl:HlsContentProtection' :: HlsContentProtection -> Maybe Text
licenseAcquisitionUrl} -> Maybe Text
licenseAcquisitionUrl) (\s :: HlsContentProtection
s@HlsContentProtection' {} Maybe Text
a -> HlsContentProtection
s {$sel:licenseAcquisitionUrl:HlsContentProtection' :: Maybe Text
licenseAcquisitionUrl = Maybe Text
a} :: HlsContentProtection)
instance Core.FromJSON HlsContentProtection where
parseJSON :: Value -> Parser HlsContentProtection
parseJSON =
String
-> (Object -> Parser HlsContentProtection)
-> Value
-> Parser HlsContentProtection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HlsContentProtection"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> HlsContentProtection
HlsContentProtection'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> HlsContentProtection)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> HlsContentProtection)
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
"KeyMd5")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> HlsContentProtection)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> HlsContentProtection)
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
"KeyStoragePolicy")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> HlsContentProtection)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> HlsContentProtection)
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
"Key")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> HlsContentProtection)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> HlsContentProtection)
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
"Method")
Parser (Maybe Text -> Maybe Text -> HlsContentProtection)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> HlsContentProtection)
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")
Parser (Maybe Text -> HlsContentProtection)
-> Parser (Maybe Text) -> Parser HlsContentProtection
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
"LicenseAcquisitionUrl")
)
instance Prelude.Hashable HlsContentProtection
instance Prelude.NFData HlsContentProtection
instance Core.ToJSON HlsContentProtection where
toJSON :: HlsContentProtection -> Value
toJSON HlsContentProtection' {Maybe Text
licenseAcquisitionUrl :: Maybe Text
initializationVector :: Maybe Text
method :: Maybe Text
key :: Maybe Text
keyStoragePolicy :: Maybe Text
keyMd5 :: Maybe Text
$sel:licenseAcquisitionUrl:HlsContentProtection' :: HlsContentProtection -> Maybe Text
$sel:initializationVector:HlsContentProtection' :: HlsContentProtection -> Maybe Text
$sel:method:HlsContentProtection' :: HlsContentProtection -> Maybe Text
$sel:key:HlsContentProtection' :: HlsContentProtection -> Maybe Text
$sel:keyStoragePolicy:HlsContentProtection' :: HlsContentProtection -> Maybe Text
$sel:keyMd5:HlsContentProtection' :: HlsContentProtection -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"KeyMd5" 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
keyMd5,
(Text
"KeyStoragePolicy" 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
keyStoragePolicy,
(Text
"Key" 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
key,
(Text
"Method" 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
method,
(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,
(Text
"LicenseAcquisitionUrl" 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
licenseAcquisitionUrl
]
)