{-# 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.CmafPackage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaPackage.Types.CmafEncryption
import Amazonka.MediaPackage.Types.HlsManifest
import Amazonka.MediaPackage.Types.StreamSelection
import qualified Amazonka.Prelude as Prelude
data CmafPackage = CmafPackage'
{
CmafPackage -> Maybe [HlsManifest]
hlsManifests :: Prelude.Maybe [HlsManifest],
CmafPackage -> Maybe Int
segmentDurationSeconds :: Prelude.Maybe Prelude.Int,
CmafPackage -> Maybe StreamSelection
streamSelection :: Prelude.Maybe StreamSelection,
CmafPackage -> Maybe CmafEncryption
encryption :: Prelude.Maybe CmafEncryption,
CmafPackage -> Maybe Text
segmentPrefix :: Prelude.Maybe Prelude.Text
}
deriving (CmafPackage -> CmafPackage -> Bool
(CmafPackage -> CmafPackage -> Bool)
-> (CmafPackage -> CmafPackage -> Bool) -> Eq CmafPackage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CmafPackage -> CmafPackage -> Bool
$c/= :: CmafPackage -> CmafPackage -> Bool
== :: CmafPackage -> CmafPackage -> Bool
$c== :: CmafPackage -> CmafPackage -> Bool
Prelude.Eq, ReadPrec [CmafPackage]
ReadPrec CmafPackage
Int -> ReadS CmafPackage
ReadS [CmafPackage]
(Int -> ReadS CmafPackage)
-> ReadS [CmafPackage]
-> ReadPrec CmafPackage
-> ReadPrec [CmafPackage]
-> Read CmafPackage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CmafPackage]
$creadListPrec :: ReadPrec [CmafPackage]
readPrec :: ReadPrec CmafPackage
$creadPrec :: ReadPrec CmafPackage
readList :: ReadS [CmafPackage]
$creadList :: ReadS [CmafPackage]
readsPrec :: Int -> ReadS CmafPackage
$creadsPrec :: Int -> ReadS CmafPackage
Prelude.Read, Int -> CmafPackage -> ShowS
[CmafPackage] -> ShowS
CmafPackage -> String
(Int -> CmafPackage -> ShowS)
-> (CmafPackage -> String)
-> ([CmafPackage] -> ShowS)
-> Show CmafPackage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CmafPackage] -> ShowS
$cshowList :: [CmafPackage] -> ShowS
show :: CmafPackage -> String
$cshow :: CmafPackage -> String
showsPrec :: Int -> CmafPackage -> ShowS
$cshowsPrec :: Int -> CmafPackage -> ShowS
Prelude.Show, (forall x. CmafPackage -> Rep CmafPackage x)
-> (forall x. Rep CmafPackage x -> CmafPackage)
-> Generic CmafPackage
forall x. Rep CmafPackage x -> CmafPackage
forall x. CmafPackage -> Rep CmafPackage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CmafPackage x -> CmafPackage
$cfrom :: forall x. CmafPackage -> Rep CmafPackage x
Prelude.Generic)
newCmafPackage ::
CmafPackage
newCmafPackage :: CmafPackage
newCmafPackage =
CmafPackage' :: Maybe [HlsManifest]
-> Maybe Int
-> Maybe StreamSelection
-> Maybe CmafEncryption
-> Maybe Text
-> CmafPackage
CmafPackage'
{ $sel:hlsManifests:CmafPackage' :: Maybe [HlsManifest]
hlsManifests = Maybe [HlsManifest]
forall a. Maybe a
Prelude.Nothing,
$sel:segmentDurationSeconds:CmafPackage' :: Maybe Int
segmentDurationSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:streamSelection:CmafPackage' :: Maybe StreamSelection
streamSelection = Maybe StreamSelection
forall a. Maybe a
Prelude.Nothing,
$sel:encryption:CmafPackage' :: Maybe CmafEncryption
encryption = Maybe CmafEncryption
forall a. Maybe a
Prelude.Nothing,
$sel:segmentPrefix:CmafPackage' :: Maybe Text
segmentPrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
cmafPackage_hlsManifests :: Lens.Lens' CmafPackage (Prelude.Maybe [HlsManifest])
cmafPackage_hlsManifests :: (Maybe [HlsManifest] -> f (Maybe [HlsManifest]))
-> CmafPackage -> f CmafPackage
cmafPackage_hlsManifests = (CmafPackage -> Maybe [HlsManifest])
-> (CmafPackage -> Maybe [HlsManifest] -> CmafPackage)
-> Lens
CmafPackage CmafPackage (Maybe [HlsManifest]) (Maybe [HlsManifest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafPackage' {Maybe [HlsManifest]
hlsManifests :: Maybe [HlsManifest]
$sel:hlsManifests:CmafPackage' :: CmafPackage -> Maybe [HlsManifest]
hlsManifests} -> Maybe [HlsManifest]
hlsManifests) (\s :: CmafPackage
s@CmafPackage' {} Maybe [HlsManifest]
a -> CmafPackage
s {$sel:hlsManifests:CmafPackage' :: Maybe [HlsManifest]
hlsManifests = Maybe [HlsManifest]
a} :: CmafPackage) ((Maybe [HlsManifest] -> f (Maybe [HlsManifest]))
-> CmafPackage -> f CmafPackage)
-> ((Maybe [HlsManifest] -> f (Maybe [HlsManifest]))
-> Maybe [HlsManifest] -> f (Maybe [HlsManifest]))
-> (Maybe [HlsManifest] -> f (Maybe [HlsManifest]))
-> CmafPackage
-> f CmafPackage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [HlsManifest] [HlsManifest] [HlsManifest] [HlsManifest]
-> Iso
(Maybe [HlsManifest])
(Maybe [HlsManifest])
(Maybe [HlsManifest])
(Maybe [HlsManifest])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [HlsManifest] [HlsManifest] [HlsManifest] [HlsManifest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
cmafPackage_segmentDurationSeconds :: Lens.Lens' CmafPackage (Prelude.Maybe Prelude.Int)
cmafPackage_segmentDurationSeconds :: (Maybe Int -> f (Maybe Int)) -> CmafPackage -> f CmafPackage
cmafPackage_segmentDurationSeconds = (CmafPackage -> Maybe Int)
-> (CmafPackage -> Maybe Int -> CmafPackage)
-> Lens CmafPackage CmafPackage (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafPackage' {Maybe Int
segmentDurationSeconds :: Maybe Int
$sel:segmentDurationSeconds:CmafPackage' :: CmafPackage -> Maybe Int
segmentDurationSeconds} -> Maybe Int
segmentDurationSeconds) (\s :: CmafPackage
s@CmafPackage' {} Maybe Int
a -> CmafPackage
s {$sel:segmentDurationSeconds:CmafPackage' :: Maybe Int
segmentDurationSeconds = Maybe Int
a} :: CmafPackage)
cmafPackage_streamSelection :: Lens.Lens' CmafPackage (Prelude.Maybe StreamSelection)
cmafPackage_streamSelection :: (Maybe StreamSelection -> f (Maybe StreamSelection))
-> CmafPackage -> f CmafPackage
cmafPackage_streamSelection = (CmafPackage -> Maybe StreamSelection)
-> (CmafPackage -> Maybe StreamSelection -> CmafPackage)
-> Lens
CmafPackage
CmafPackage
(Maybe StreamSelection)
(Maybe StreamSelection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafPackage' {Maybe StreamSelection
streamSelection :: Maybe StreamSelection
$sel:streamSelection:CmafPackage' :: CmafPackage -> Maybe StreamSelection
streamSelection} -> Maybe StreamSelection
streamSelection) (\s :: CmafPackage
s@CmafPackage' {} Maybe StreamSelection
a -> CmafPackage
s {$sel:streamSelection:CmafPackage' :: Maybe StreamSelection
streamSelection = Maybe StreamSelection
a} :: CmafPackage)
cmafPackage_encryption :: Lens.Lens' CmafPackage (Prelude.Maybe CmafEncryption)
cmafPackage_encryption :: (Maybe CmafEncryption -> f (Maybe CmafEncryption))
-> CmafPackage -> f CmafPackage
cmafPackage_encryption = (CmafPackage -> Maybe CmafEncryption)
-> (CmafPackage -> Maybe CmafEncryption -> CmafPackage)
-> Lens
CmafPackage
CmafPackage
(Maybe CmafEncryption)
(Maybe CmafEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafPackage' {Maybe CmafEncryption
encryption :: Maybe CmafEncryption
$sel:encryption:CmafPackage' :: CmafPackage -> Maybe CmafEncryption
encryption} -> Maybe CmafEncryption
encryption) (\s :: CmafPackage
s@CmafPackage' {} Maybe CmafEncryption
a -> CmafPackage
s {$sel:encryption:CmafPackage' :: Maybe CmafEncryption
encryption = Maybe CmafEncryption
a} :: CmafPackage)
cmafPackage_segmentPrefix :: Lens.Lens' CmafPackage (Prelude.Maybe Prelude.Text)
cmafPackage_segmentPrefix :: (Maybe Text -> f (Maybe Text)) -> CmafPackage -> f CmafPackage
cmafPackage_segmentPrefix = (CmafPackage -> Maybe Text)
-> (CmafPackage -> Maybe Text -> CmafPackage)
-> Lens CmafPackage CmafPackage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafPackage' {Maybe Text
segmentPrefix :: Maybe Text
$sel:segmentPrefix:CmafPackage' :: CmafPackage -> Maybe Text
segmentPrefix} -> Maybe Text
segmentPrefix) (\s :: CmafPackage
s@CmafPackage' {} Maybe Text
a -> CmafPackage
s {$sel:segmentPrefix:CmafPackage' :: Maybe Text
segmentPrefix = Maybe Text
a} :: CmafPackage)
instance Core.FromJSON CmafPackage where
parseJSON :: Value -> Parser CmafPackage
parseJSON =
String
-> (Object -> Parser CmafPackage) -> Value -> Parser CmafPackage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CmafPackage"
( \Object
x ->
Maybe [HlsManifest]
-> Maybe Int
-> Maybe StreamSelection
-> Maybe CmafEncryption
-> Maybe Text
-> CmafPackage
CmafPackage'
(Maybe [HlsManifest]
-> Maybe Int
-> Maybe StreamSelection
-> Maybe CmafEncryption
-> Maybe Text
-> CmafPackage)
-> Parser (Maybe [HlsManifest])
-> Parser
(Maybe Int
-> Maybe StreamSelection
-> Maybe CmafEncryption
-> Maybe Text
-> CmafPackage)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [HlsManifest]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hlsManifests" Parser (Maybe (Maybe [HlsManifest]))
-> Maybe [HlsManifest] -> Parser (Maybe [HlsManifest])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [HlsManifest]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Int
-> Maybe StreamSelection
-> Maybe CmafEncryption
-> Maybe Text
-> CmafPackage)
-> Parser (Maybe Int)
-> Parser
(Maybe StreamSelection
-> Maybe CmafEncryption -> Maybe Text -> CmafPackage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"segmentDurationSeconds")
Parser
(Maybe StreamSelection
-> Maybe CmafEncryption -> Maybe Text -> CmafPackage)
-> Parser (Maybe StreamSelection)
-> Parser (Maybe CmafEncryption -> Maybe Text -> CmafPackage)
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")
Parser (Maybe CmafEncryption -> Maybe Text -> CmafPackage)
-> Parser (Maybe CmafEncryption)
-> Parser (Maybe Text -> CmafPackage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CmafEncryption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"encryption")
Parser (Maybe Text -> CmafPackage)
-> Parser (Maybe Text) -> Parser CmafPackage
forall (f :: * -> *) a b. Applicative f => 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
"segmentPrefix")
)
instance Prelude.Hashable CmafPackage
instance Prelude.NFData CmafPackage