{-# 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.CmafEncryptionSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types.CmafEncryptionType
import Amazonka.MediaConvert.Types.CmafInitializationVectorInManifest
import Amazonka.MediaConvert.Types.CmafKeyProviderType
import Amazonka.MediaConvert.Types.SpekeKeyProviderCmaf
import Amazonka.MediaConvert.Types.StaticKeyProvider
import qualified Amazonka.Prelude as Prelude
data CmafEncryptionSettings = CmafEncryptionSettings'
{
CmafEncryptionSettings -> Maybe Text
constantInitializationVector :: Prelude.Maybe Prelude.Text,
CmafEncryptionSettings -> Maybe CmafEncryptionType
encryptionMethod :: Prelude.Maybe CmafEncryptionType,
CmafEncryptionSettings -> Maybe CmafInitializationVectorInManifest
initializationVectorInManifest :: Prelude.Maybe CmafInitializationVectorInManifest,
CmafEncryptionSettings -> Maybe SpekeKeyProviderCmaf
spekeKeyProvider :: Prelude.Maybe SpekeKeyProviderCmaf,
CmafEncryptionSettings -> Maybe StaticKeyProvider
staticKeyProvider :: Prelude.Maybe StaticKeyProvider,
CmafEncryptionSettings -> Maybe CmafKeyProviderType
type' :: Prelude.Maybe CmafKeyProviderType
}
deriving (CmafEncryptionSettings -> CmafEncryptionSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CmafEncryptionSettings -> CmafEncryptionSettings -> Bool
$c/= :: CmafEncryptionSettings -> CmafEncryptionSettings -> Bool
== :: CmafEncryptionSettings -> CmafEncryptionSettings -> Bool
$c== :: CmafEncryptionSettings -> CmafEncryptionSettings -> Bool
Prelude.Eq, ReadPrec [CmafEncryptionSettings]
ReadPrec CmafEncryptionSettings
Int -> ReadS CmafEncryptionSettings
ReadS [CmafEncryptionSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CmafEncryptionSettings]
$creadListPrec :: ReadPrec [CmafEncryptionSettings]
readPrec :: ReadPrec CmafEncryptionSettings
$creadPrec :: ReadPrec CmafEncryptionSettings
readList :: ReadS [CmafEncryptionSettings]
$creadList :: ReadS [CmafEncryptionSettings]
readsPrec :: Int -> ReadS CmafEncryptionSettings
$creadsPrec :: Int -> ReadS CmafEncryptionSettings
Prelude.Read, Int -> CmafEncryptionSettings -> ShowS
[CmafEncryptionSettings] -> ShowS
CmafEncryptionSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CmafEncryptionSettings] -> ShowS
$cshowList :: [CmafEncryptionSettings] -> ShowS
show :: CmafEncryptionSettings -> String
$cshow :: CmafEncryptionSettings -> String
showsPrec :: Int -> CmafEncryptionSettings -> ShowS
$cshowsPrec :: Int -> CmafEncryptionSettings -> ShowS
Prelude.Show, forall x. Rep CmafEncryptionSettings x -> CmafEncryptionSettings
forall x. CmafEncryptionSettings -> Rep CmafEncryptionSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CmafEncryptionSettings x -> CmafEncryptionSettings
$cfrom :: forall x. CmafEncryptionSettings -> Rep CmafEncryptionSettings x
Prelude.Generic)
newCmafEncryptionSettings ::
CmafEncryptionSettings
newCmafEncryptionSettings :: CmafEncryptionSettings
newCmafEncryptionSettings =
CmafEncryptionSettings'
{ $sel:constantInitializationVector:CmafEncryptionSettings' :: Maybe Text
constantInitializationVector =
forall a. Maybe a
Prelude.Nothing,
$sel:encryptionMethod:CmafEncryptionSettings' :: Maybe CmafEncryptionType
encryptionMethod = forall a. Maybe a
Prelude.Nothing,
$sel:initializationVectorInManifest:CmafEncryptionSettings' :: Maybe CmafInitializationVectorInManifest
initializationVectorInManifest = forall a. Maybe a
Prelude.Nothing,
$sel:spekeKeyProvider:CmafEncryptionSettings' :: Maybe SpekeKeyProviderCmaf
spekeKeyProvider = forall a. Maybe a
Prelude.Nothing,
$sel:staticKeyProvider:CmafEncryptionSettings' :: Maybe StaticKeyProvider
staticKeyProvider = forall a. Maybe a
Prelude.Nothing,
$sel:type':CmafEncryptionSettings' :: Maybe CmafKeyProviderType
type' = forall a. Maybe a
Prelude.Nothing
}
cmafEncryptionSettings_constantInitializationVector :: Lens.Lens' CmafEncryptionSettings (Prelude.Maybe Prelude.Text)
cmafEncryptionSettings_constantInitializationVector :: Lens' CmafEncryptionSettings (Maybe Text)
cmafEncryptionSettings_constantInitializationVector = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafEncryptionSettings' {Maybe Text
constantInitializationVector :: Maybe Text
$sel:constantInitializationVector:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe Text
constantInitializationVector} -> Maybe Text
constantInitializationVector) (\s :: CmafEncryptionSettings
s@CmafEncryptionSettings' {} Maybe Text
a -> CmafEncryptionSettings
s {$sel:constantInitializationVector:CmafEncryptionSettings' :: Maybe Text
constantInitializationVector = Maybe Text
a} :: CmafEncryptionSettings)
cmafEncryptionSettings_encryptionMethod :: Lens.Lens' CmafEncryptionSettings (Prelude.Maybe CmafEncryptionType)
cmafEncryptionSettings_encryptionMethod :: Lens' CmafEncryptionSettings (Maybe CmafEncryptionType)
cmafEncryptionSettings_encryptionMethod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafEncryptionSettings' {Maybe CmafEncryptionType
encryptionMethod :: Maybe CmafEncryptionType
$sel:encryptionMethod:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafEncryptionType
encryptionMethod} -> Maybe CmafEncryptionType
encryptionMethod) (\s :: CmafEncryptionSettings
s@CmafEncryptionSettings' {} Maybe CmafEncryptionType
a -> CmafEncryptionSettings
s {$sel:encryptionMethod:CmafEncryptionSettings' :: Maybe CmafEncryptionType
encryptionMethod = Maybe CmafEncryptionType
a} :: CmafEncryptionSettings)
cmafEncryptionSettings_initializationVectorInManifest :: Lens.Lens' CmafEncryptionSettings (Prelude.Maybe CmafInitializationVectorInManifest)
cmafEncryptionSettings_initializationVectorInManifest :: Lens'
CmafEncryptionSettings (Maybe CmafInitializationVectorInManifest)
cmafEncryptionSettings_initializationVectorInManifest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafEncryptionSettings' {Maybe CmafInitializationVectorInManifest
initializationVectorInManifest :: Maybe CmafInitializationVectorInManifest
$sel:initializationVectorInManifest:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafInitializationVectorInManifest
initializationVectorInManifest} -> Maybe CmafInitializationVectorInManifest
initializationVectorInManifest) (\s :: CmafEncryptionSettings
s@CmafEncryptionSettings' {} Maybe CmafInitializationVectorInManifest
a -> CmafEncryptionSettings
s {$sel:initializationVectorInManifest:CmafEncryptionSettings' :: Maybe CmafInitializationVectorInManifest
initializationVectorInManifest = Maybe CmafInitializationVectorInManifest
a} :: CmafEncryptionSettings)
cmafEncryptionSettings_spekeKeyProvider :: Lens.Lens' CmafEncryptionSettings (Prelude.Maybe SpekeKeyProviderCmaf)
cmafEncryptionSettings_spekeKeyProvider :: Lens' CmafEncryptionSettings (Maybe SpekeKeyProviderCmaf)
cmafEncryptionSettings_spekeKeyProvider = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafEncryptionSettings' {Maybe SpekeKeyProviderCmaf
spekeKeyProvider :: Maybe SpekeKeyProviderCmaf
$sel:spekeKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe SpekeKeyProviderCmaf
spekeKeyProvider} -> Maybe SpekeKeyProviderCmaf
spekeKeyProvider) (\s :: CmafEncryptionSettings
s@CmafEncryptionSettings' {} Maybe SpekeKeyProviderCmaf
a -> CmafEncryptionSettings
s {$sel:spekeKeyProvider:CmafEncryptionSettings' :: Maybe SpekeKeyProviderCmaf
spekeKeyProvider = Maybe SpekeKeyProviderCmaf
a} :: CmafEncryptionSettings)
cmafEncryptionSettings_staticKeyProvider :: Lens.Lens' CmafEncryptionSettings (Prelude.Maybe StaticKeyProvider)
cmafEncryptionSettings_staticKeyProvider :: Lens' CmafEncryptionSettings (Maybe StaticKeyProvider)
cmafEncryptionSettings_staticKeyProvider = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafEncryptionSettings' {Maybe StaticKeyProvider
staticKeyProvider :: Maybe StaticKeyProvider
$sel:staticKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe StaticKeyProvider
staticKeyProvider} -> Maybe StaticKeyProvider
staticKeyProvider) (\s :: CmafEncryptionSettings
s@CmafEncryptionSettings' {} Maybe StaticKeyProvider
a -> CmafEncryptionSettings
s {$sel:staticKeyProvider:CmafEncryptionSettings' :: Maybe StaticKeyProvider
staticKeyProvider = Maybe StaticKeyProvider
a} :: CmafEncryptionSettings)
cmafEncryptionSettings_type :: Lens.Lens' CmafEncryptionSettings (Prelude.Maybe CmafKeyProviderType)
cmafEncryptionSettings_type :: Lens' CmafEncryptionSettings (Maybe CmafKeyProviderType)
cmafEncryptionSettings_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafEncryptionSettings' {Maybe CmafKeyProviderType
type' :: Maybe CmafKeyProviderType
$sel:type':CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafKeyProviderType
type'} -> Maybe CmafKeyProviderType
type') (\s :: CmafEncryptionSettings
s@CmafEncryptionSettings' {} Maybe CmafKeyProviderType
a -> CmafEncryptionSettings
s {$sel:type':CmafEncryptionSettings' :: Maybe CmafKeyProviderType
type' = Maybe CmafKeyProviderType
a} :: CmafEncryptionSettings)
instance Data.FromJSON CmafEncryptionSettings where
parseJSON :: Value -> Parser CmafEncryptionSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CmafEncryptionSettings"
( \Object
x ->
Maybe Text
-> Maybe CmafEncryptionType
-> Maybe CmafInitializationVectorInManifest
-> Maybe SpekeKeyProviderCmaf
-> Maybe StaticKeyProvider
-> Maybe CmafKeyProviderType
-> CmafEncryptionSettings
CmafEncryptionSettings'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"constantInitializationVector")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"encryptionMethod")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"initializationVectorInManifest")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"spekeKeyProvider")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"staticKeyProvider")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"type")
)
instance Prelude.Hashable CmafEncryptionSettings where
hashWithSalt :: Int -> CmafEncryptionSettings -> Int
hashWithSalt Int
_salt CmafEncryptionSettings' {Maybe Text
Maybe CmafEncryptionType
Maybe CmafInitializationVectorInManifest
Maybe CmafKeyProviderType
Maybe SpekeKeyProviderCmaf
Maybe StaticKeyProvider
type' :: Maybe CmafKeyProviderType
staticKeyProvider :: Maybe StaticKeyProvider
spekeKeyProvider :: Maybe SpekeKeyProviderCmaf
initializationVectorInManifest :: Maybe CmafInitializationVectorInManifest
encryptionMethod :: Maybe CmafEncryptionType
constantInitializationVector :: Maybe Text
$sel:type':CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafKeyProviderType
$sel:staticKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe StaticKeyProvider
$sel:spekeKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe SpekeKeyProviderCmaf
$sel:initializationVectorInManifest:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafInitializationVectorInManifest
$sel:encryptionMethod:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafEncryptionType
$sel:constantInitializationVector:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
constantInitializationVector
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CmafEncryptionType
encryptionMethod
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CmafInitializationVectorInManifest
initializationVectorInManifest
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SpekeKeyProviderCmaf
spekeKeyProvider
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StaticKeyProvider
staticKeyProvider
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CmafKeyProviderType
type'
instance Prelude.NFData CmafEncryptionSettings where
rnf :: CmafEncryptionSettings -> ()
rnf CmafEncryptionSettings' {Maybe Text
Maybe CmafEncryptionType
Maybe CmafInitializationVectorInManifest
Maybe CmafKeyProviderType
Maybe SpekeKeyProviderCmaf
Maybe StaticKeyProvider
type' :: Maybe CmafKeyProviderType
staticKeyProvider :: Maybe StaticKeyProvider
spekeKeyProvider :: Maybe SpekeKeyProviderCmaf
initializationVectorInManifest :: Maybe CmafInitializationVectorInManifest
encryptionMethod :: Maybe CmafEncryptionType
constantInitializationVector :: Maybe Text
$sel:type':CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafKeyProviderType
$sel:staticKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe StaticKeyProvider
$sel:spekeKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe SpekeKeyProviderCmaf
$sel:initializationVectorInManifest:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafInitializationVectorInManifest
$sel:encryptionMethod:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafEncryptionType
$sel:constantInitializationVector:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
constantInitializationVector
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CmafEncryptionType
encryptionMethod
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CmafInitializationVectorInManifest
initializationVectorInManifest
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SpekeKeyProviderCmaf
spekeKeyProvider
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StaticKeyProvider
staticKeyProvider
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CmafKeyProviderType
type'
instance Data.ToJSON CmafEncryptionSettings where
toJSON :: CmafEncryptionSettings -> Value
toJSON CmafEncryptionSettings' {Maybe Text
Maybe CmafEncryptionType
Maybe CmafInitializationVectorInManifest
Maybe CmafKeyProviderType
Maybe SpekeKeyProviderCmaf
Maybe StaticKeyProvider
type' :: Maybe CmafKeyProviderType
staticKeyProvider :: Maybe StaticKeyProvider
spekeKeyProvider :: Maybe SpekeKeyProviderCmaf
initializationVectorInManifest :: Maybe CmafInitializationVectorInManifest
encryptionMethod :: Maybe CmafEncryptionType
constantInitializationVector :: Maybe Text
$sel:type':CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafKeyProviderType
$sel:staticKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe StaticKeyProvider
$sel:spekeKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe SpekeKeyProviderCmaf
$sel:initializationVectorInManifest:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafInitializationVectorInManifest
$sel:encryptionMethod:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafEncryptionType
$sel:constantInitializationVector:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"constantInitializationVector" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
constantInitializationVector,
(Key
"encryptionMethod" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CmafEncryptionType
encryptionMethod,
(Key
"initializationVectorInManifest" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CmafInitializationVectorInManifest
initializationVectorInManifest,
(Key
"spekeKeyProvider" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SpekeKeyProviderCmaf
spekeKeyProvider,
(Key
"staticKeyProvider" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StaticKeyProvider
staticKeyProvider,
(Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CmafKeyProviderType
type'
]
)