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