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