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