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