{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ElasticTranscoder.Types.Playlist
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ElasticTranscoder.Types.Playlist where

import qualified Amazonka.Core as Core
import Amazonka.ElasticTranscoder.Types.HlsContentProtection
import Amazonka.ElasticTranscoder.Types.PlayReadyDrm
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Use Only for Fragmented MP4 or MPEG-TS Outputs. If you specify a preset
-- for which the value of Container is @fmp4@ (Fragmented MP4) or @ts@
-- (MPEG-TS), Playlists contains information about the master playlists
-- that you want Elastic Transcoder to create. We recommend that you create
-- only one master playlist per output format. The maximum number of master
-- playlists in a job is 30.
--
-- /See:/ 'newPlaylist' smart constructor.
data Playlist = Playlist'
  { -- | The status of the job with which the playlist is associated.
    Playlist -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The DRM settings, if any, that you want Elastic Transcoder to apply to
    -- the output files associated with this playlist.
    Playlist -> Maybe PlayReadyDrm
playReadyDrm :: Prelude.Maybe PlayReadyDrm,
    -- | The format of the output playlist. Valid formats include @HLSv3@,
    -- @HLSv4@, and @Smooth@.
    Playlist -> Maybe Text
format :: Prelude.Maybe Prelude.Text,
    -- | For each output in this job that you want to include in a master
    -- playlist, the value of the Outputs:Key object.
    --
    -- -   If your output is not @HLS@ or does not have a segment duration set,
    --     the name of the output file is a concatenation of @OutputKeyPrefix@
    --     and @Outputs:Key@:
    --
    --     OutputKeyPrefix@Outputs:Key@
    --
    -- -   If your output is @HLSv3@ and has a segment duration set, or is not
    --     included in a playlist, Elastic Transcoder creates an output
    --     playlist file with a file extension of @.m3u8@, and a series of
    --     @.ts@ files that include a five-digit sequential counter beginning
    --     with 00000:
    --
    --     OutputKeyPrefix@Outputs:Key@.m3u8
    --
    --     OutputKeyPrefix@Outputs:Key@00000.ts
    --
    -- -   If your output is @HLSv4@, has a segment duration set, and is
    --     included in an @HLSv4@ playlist, Elastic Transcoder creates an
    --     output playlist file with a file extension of @_v4.m3u8@. If the
    --     output is video, Elastic Transcoder also creates an output file with
    --     an extension of @_iframe.m3u8@:
    --
    --     OutputKeyPrefix@Outputs:Key@_v4.m3u8
    --
    --     OutputKeyPrefix@Outputs:Key@_iframe.m3u8
    --
    --     OutputKeyPrefix@Outputs:Key@.ts
    --
    -- Elastic Transcoder automatically appends the relevant file extension to
    -- the file name. If you include a file extension in Output Key, the file
    -- name will have two extensions.
    --
    -- If you include more than one output in a playlist, any segment duration
    -- settings, clip settings, or caption settings must be the same for all
    -- outputs in the playlist. For @Smooth@ playlists, the @Audio:Profile@,
    -- @Video:Profile@, and @Video:FrameRate@ to @Video:KeyframesMaxDist@ ratio
    -- must be the same for all outputs.
    Playlist -> Maybe [Text]
outputKeys :: Prelude.Maybe [Prelude.Text],
    -- | The name that you want Elastic Transcoder to assign to the master
    -- playlist, for example, nyc-vacation.m3u8. If the name includes a @\/@
    -- character, the section of the name before the last @\/@ must be
    -- identical for all @Name@ objects. If you create more than one master
    -- playlist, the values of all @Name@ objects must be unique.
    --
    -- Elastic Transcoder automatically appends the relevant file extension to
    -- the file name (@.m3u8@ for @HLSv3@ and @HLSv4@ playlists, and @.ism@ and
    -- @.ismc@ for @Smooth@ playlists). If you include a file extension in
    -- @Name@, the file name will have two extensions.
    Playlist -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Information that further explains the status.
    Playlist -> Maybe Text
statusDetail :: Prelude.Maybe Prelude.Text,
    -- | The HLS content protection settings, if any, that you want Elastic
    -- Transcoder to apply to the output files associated with this playlist.
    Playlist -> Maybe HlsContentProtection
hlsContentProtection :: Prelude.Maybe HlsContentProtection
  }
  deriving (Playlist -> Playlist -> Bool
(Playlist -> Playlist -> Bool)
-> (Playlist -> Playlist -> Bool) -> Eq Playlist
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Playlist -> Playlist -> Bool
$c/= :: Playlist -> Playlist -> Bool
== :: Playlist -> Playlist -> Bool
$c== :: Playlist -> Playlist -> Bool
Prelude.Eq, ReadPrec [Playlist]
ReadPrec Playlist
Int -> ReadS Playlist
ReadS [Playlist]
(Int -> ReadS Playlist)
-> ReadS [Playlist]
-> ReadPrec Playlist
-> ReadPrec [Playlist]
-> Read Playlist
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Playlist]
$creadListPrec :: ReadPrec [Playlist]
readPrec :: ReadPrec Playlist
$creadPrec :: ReadPrec Playlist
readList :: ReadS [Playlist]
$creadList :: ReadS [Playlist]
readsPrec :: Int -> ReadS Playlist
$creadsPrec :: Int -> ReadS Playlist
Prelude.Read, Int -> Playlist -> ShowS
[Playlist] -> ShowS
Playlist -> String
(Int -> Playlist -> ShowS)
-> (Playlist -> String) -> ([Playlist] -> ShowS) -> Show Playlist
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Playlist] -> ShowS
$cshowList :: [Playlist] -> ShowS
show :: Playlist -> String
$cshow :: Playlist -> String
showsPrec :: Int -> Playlist -> ShowS
$cshowsPrec :: Int -> Playlist -> ShowS
Prelude.Show, (forall x. Playlist -> Rep Playlist x)
-> (forall x. Rep Playlist x -> Playlist) -> Generic Playlist
forall x. Rep Playlist x -> Playlist
forall x. Playlist -> Rep Playlist x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Playlist x -> Playlist
$cfrom :: forall x. Playlist -> Rep Playlist x
Prelude.Generic)

-- |
-- Create a value of 'Playlist' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'playlist_status' - The status of the job with which the playlist is associated.
--
-- 'playReadyDrm', 'playlist_playReadyDrm' - The DRM settings, if any, that you want Elastic Transcoder to apply to
-- the output files associated with this playlist.
--
-- 'format', 'playlist_format' - The format of the output playlist. Valid formats include @HLSv3@,
-- @HLSv4@, and @Smooth@.
--
-- 'outputKeys', 'playlist_outputKeys' - For each output in this job that you want to include in a master
-- playlist, the value of the Outputs:Key object.
--
-- -   If your output is not @HLS@ or does not have a segment duration set,
--     the name of the output file is a concatenation of @OutputKeyPrefix@
--     and @Outputs:Key@:
--
--     OutputKeyPrefix@Outputs:Key@
--
-- -   If your output is @HLSv3@ and has a segment duration set, or is not
--     included in a playlist, Elastic Transcoder creates an output
--     playlist file with a file extension of @.m3u8@, and a series of
--     @.ts@ files that include a five-digit sequential counter beginning
--     with 00000:
--
--     OutputKeyPrefix@Outputs:Key@.m3u8
--
--     OutputKeyPrefix@Outputs:Key@00000.ts
--
-- -   If your output is @HLSv4@, has a segment duration set, and is
--     included in an @HLSv4@ playlist, Elastic Transcoder creates an
--     output playlist file with a file extension of @_v4.m3u8@. If the
--     output is video, Elastic Transcoder also creates an output file with
--     an extension of @_iframe.m3u8@:
--
--     OutputKeyPrefix@Outputs:Key@_v4.m3u8
--
--     OutputKeyPrefix@Outputs:Key@_iframe.m3u8
--
--     OutputKeyPrefix@Outputs:Key@.ts
--
-- Elastic Transcoder automatically appends the relevant file extension to
-- the file name. If you include a file extension in Output Key, the file
-- name will have two extensions.
--
-- If you include more than one output in a playlist, any segment duration
-- settings, clip settings, or caption settings must be the same for all
-- outputs in the playlist. For @Smooth@ playlists, the @Audio:Profile@,
-- @Video:Profile@, and @Video:FrameRate@ to @Video:KeyframesMaxDist@ ratio
-- must be the same for all outputs.
--
-- 'name', 'playlist_name' - The name that you want Elastic Transcoder to assign to the master
-- playlist, for example, nyc-vacation.m3u8. If the name includes a @\/@
-- character, the section of the name before the last @\/@ must be
-- identical for all @Name@ objects. If you create more than one master
-- playlist, the values of all @Name@ objects must be unique.
--
-- Elastic Transcoder automatically appends the relevant file extension to
-- the file name (@.m3u8@ for @HLSv3@ and @HLSv4@ playlists, and @.ism@ and
-- @.ismc@ for @Smooth@ playlists). If you include a file extension in
-- @Name@, the file name will have two extensions.
--
-- 'statusDetail', 'playlist_statusDetail' - Information that further explains the status.
--
-- 'hlsContentProtection', 'playlist_hlsContentProtection' - The HLS content protection settings, if any, that you want Elastic
-- Transcoder to apply to the output files associated with this playlist.
newPlaylist ::
  Playlist
newPlaylist :: Playlist
newPlaylist =
  Playlist' :: Maybe Text
-> Maybe PlayReadyDrm
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe HlsContentProtection
-> Playlist
Playlist'
    { $sel:status:Playlist' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:playReadyDrm:Playlist' :: Maybe PlayReadyDrm
playReadyDrm = Maybe PlayReadyDrm
forall a. Maybe a
Prelude.Nothing,
      $sel:format:Playlist' :: Maybe Text
format = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:outputKeys:Playlist' :: Maybe [Text]
outputKeys = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Playlist' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusDetail:Playlist' :: Maybe Text
statusDetail = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hlsContentProtection:Playlist' :: Maybe HlsContentProtection
hlsContentProtection = Maybe HlsContentProtection
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the job with which the playlist is associated.
playlist_status :: Lens.Lens' Playlist (Prelude.Maybe Prelude.Text)
playlist_status :: (Maybe Text -> f (Maybe Text)) -> Playlist -> f Playlist
playlist_status = (Playlist -> Maybe Text)
-> (Playlist -> Maybe Text -> Playlist)
-> Lens Playlist Playlist (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Playlist' {Maybe Text
status :: Maybe Text
$sel:status:Playlist' :: Playlist -> Maybe Text
status} -> Maybe Text
status) (\s :: Playlist
s@Playlist' {} Maybe Text
a -> Playlist
s {$sel:status:Playlist' :: Maybe Text
status = Maybe Text
a} :: Playlist)

-- | The DRM settings, if any, that you want Elastic Transcoder to apply to
-- the output files associated with this playlist.
playlist_playReadyDrm :: Lens.Lens' Playlist (Prelude.Maybe PlayReadyDrm)
playlist_playReadyDrm :: (Maybe PlayReadyDrm -> f (Maybe PlayReadyDrm))
-> Playlist -> f Playlist
playlist_playReadyDrm = (Playlist -> Maybe PlayReadyDrm)
-> (Playlist -> Maybe PlayReadyDrm -> Playlist)
-> Lens Playlist Playlist (Maybe PlayReadyDrm) (Maybe PlayReadyDrm)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Playlist' {Maybe PlayReadyDrm
playReadyDrm :: Maybe PlayReadyDrm
$sel:playReadyDrm:Playlist' :: Playlist -> Maybe PlayReadyDrm
playReadyDrm} -> Maybe PlayReadyDrm
playReadyDrm) (\s :: Playlist
s@Playlist' {} Maybe PlayReadyDrm
a -> Playlist
s {$sel:playReadyDrm:Playlist' :: Maybe PlayReadyDrm
playReadyDrm = Maybe PlayReadyDrm
a} :: Playlist)

-- | The format of the output playlist. Valid formats include @HLSv3@,
-- @HLSv4@, and @Smooth@.
playlist_format :: Lens.Lens' Playlist (Prelude.Maybe Prelude.Text)
playlist_format :: (Maybe Text -> f (Maybe Text)) -> Playlist -> f Playlist
playlist_format = (Playlist -> Maybe Text)
-> (Playlist -> Maybe Text -> Playlist)
-> Lens Playlist Playlist (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Playlist' {Maybe Text
format :: Maybe Text
$sel:format:Playlist' :: Playlist -> Maybe Text
format} -> Maybe Text
format) (\s :: Playlist
s@Playlist' {} Maybe Text
a -> Playlist
s {$sel:format:Playlist' :: Maybe Text
format = Maybe Text
a} :: Playlist)

-- | For each output in this job that you want to include in a master
-- playlist, the value of the Outputs:Key object.
--
-- -   If your output is not @HLS@ or does not have a segment duration set,
--     the name of the output file is a concatenation of @OutputKeyPrefix@
--     and @Outputs:Key@:
--
--     OutputKeyPrefix@Outputs:Key@
--
-- -   If your output is @HLSv3@ and has a segment duration set, or is not
--     included in a playlist, Elastic Transcoder creates an output
--     playlist file with a file extension of @.m3u8@, and a series of
--     @.ts@ files that include a five-digit sequential counter beginning
--     with 00000:
--
--     OutputKeyPrefix@Outputs:Key@.m3u8
--
--     OutputKeyPrefix@Outputs:Key@00000.ts
--
-- -   If your output is @HLSv4@, has a segment duration set, and is
--     included in an @HLSv4@ playlist, Elastic Transcoder creates an
--     output playlist file with a file extension of @_v4.m3u8@. If the
--     output is video, Elastic Transcoder also creates an output file with
--     an extension of @_iframe.m3u8@:
--
--     OutputKeyPrefix@Outputs:Key@_v4.m3u8
--
--     OutputKeyPrefix@Outputs:Key@_iframe.m3u8
--
--     OutputKeyPrefix@Outputs:Key@.ts
--
-- Elastic Transcoder automatically appends the relevant file extension to
-- the file name. If you include a file extension in Output Key, the file
-- name will have two extensions.
--
-- If you include more than one output in a playlist, any segment duration
-- settings, clip settings, or caption settings must be the same for all
-- outputs in the playlist. For @Smooth@ playlists, the @Audio:Profile@,
-- @Video:Profile@, and @Video:FrameRate@ to @Video:KeyframesMaxDist@ ratio
-- must be the same for all outputs.
playlist_outputKeys :: Lens.Lens' Playlist (Prelude.Maybe [Prelude.Text])
playlist_outputKeys :: (Maybe [Text] -> f (Maybe [Text])) -> Playlist -> f Playlist
playlist_outputKeys = (Playlist -> Maybe [Text])
-> (Playlist -> Maybe [Text] -> Playlist)
-> Lens Playlist Playlist (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Playlist' {Maybe [Text]
outputKeys :: Maybe [Text]
$sel:outputKeys:Playlist' :: Playlist -> Maybe [Text]
outputKeys} -> Maybe [Text]
outputKeys) (\s :: Playlist
s@Playlist' {} Maybe [Text]
a -> Playlist
s {$sel:outputKeys:Playlist' :: Maybe [Text]
outputKeys = Maybe [Text]
a} :: Playlist) ((Maybe [Text] -> f (Maybe [Text])) -> Playlist -> f Playlist)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Playlist
-> f Playlist
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name that you want Elastic Transcoder to assign to the master
-- playlist, for example, nyc-vacation.m3u8. If the name includes a @\/@
-- character, the section of the name before the last @\/@ must be
-- identical for all @Name@ objects. If you create more than one master
-- playlist, the values of all @Name@ objects must be unique.
--
-- Elastic Transcoder automatically appends the relevant file extension to
-- the file name (@.m3u8@ for @HLSv3@ and @HLSv4@ playlists, and @.ism@ and
-- @.ismc@ for @Smooth@ playlists). If you include a file extension in
-- @Name@, the file name will have two extensions.
playlist_name :: Lens.Lens' Playlist (Prelude.Maybe Prelude.Text)
playlist_name :: (Maybe Text -> f (Maybe Text)) -> Playlist -> f Playlist
playlist_name = (Playlist -> Maybe Text)
-> (Playlist -> Maybe Text -> Playlist)
-> Lens Playlist Playlist (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Playlist' {Maybe Text
name :: Maybe Text
$sel:name:Playlist' :: Playlist -> Maybe Text
name} -> Maybe Text
name) (\s :: Playlist
s@Playlist' {} Maybe Text
a -> Playlist
s {$sel:name:Playlist' :: Maybe Text
name = Maybe Text
a} :: Playlist)

-- | Information that further explains the status.
playlist_statusDetail :: Lens.Lens' Playlist (Prelude.Maybe Prelude.Text)
playlist_statusDetail :: (Maybe Text -> f (Maybe Text)) -> Playlist -> f Playlist
playlist_statusDetail = (Playlist -> Maybe Text)
-> (Playlist -> Maybe Text -> Playlist)
-> Lens Playlist Playlist (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Playlist' {Maybe Text
statusDetail :: Maybe Text
$sel:statusDetail:Playlist' :: Playlist -> Maybe Text
statusDetail} -> Maybe Text
statusDetail) (\s :: Playlist
s@Playlist' {} Maybe Text
a -> Playlist
s {$sel:statusDetail:Playlist' :: Maybe Text
statusDetail = Maybe Text
a} :: Playlist)

-- | The HLS content protection settings, if any, that you want Elastic
-- Transcoder to apply to the output files associated with this playlist.
playlist_hlsContentProtection :: Lens.Lens' Playlist (Prelude.Maybe HlsContentProtection)
playlist_hlsContentProtection :: (Maybe HlsContentProtection -> f (Maybe HlsContentProtection))
-> Playlist -> f Playlist
playlist_hlsContentProtection = (Playlist -> Maybe HlsContentProtection)
-> (Playlist -> Maybe HlsContentProtection -> Playlist)
-> Lens
     Playlist
     Playlist
     (Maybe HlsContentProtection)
     (Maybe HlsContentProtection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Playlist' {Maybe HlsContentProtection
hlsContentProtection :: Maybe HlsContentProtection
$sel:hlsContentProtection:Playlist' :: Playlist -> Maybe HlsContentProtection
hlsContentProtection} -> Maybe HlsContentProtection
hlsContentProtection) (\s :: Playlist
s@Playlist' {} Maybe HlsContentProtection
a -> Playlist
s {$sel:hlsContentProtection:Playlist' :: Maybe HlsContentProtection
hlsContentProtection = Maybe HlsContentProtection
a} :: Playlist)

instance Core.FromJSON Playlist where
  parseJSON :: Value -> Parser Playlist
parseJSON =
    String -> (Object -> Parser Playlist) -> Value -> Parser Playlist
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Playlist"
      ( \Object
x ->
          Maybe Text
-> Maybe PlayReadyDrm
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe HlsContentProtection
-> Playlist
Playlist'
            (Maybe Text
 -> Maybe PlayReadyDrm
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe HlsContentProtection
 -> Playlist)
-> Parser (Maybe Text)
-> Parser
     (Maybe PlayReadyDrm
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe HlsContentProtection
      -> Playlist)
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
"Status")
            Parser
  (Maybe PlayReadyDrm
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe HlsContentProtection
   -> Playlist)
-> Parser (Maybe PlayReadyDrm)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe HlsContentProtection
      -> Playlist)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PlayReadyDrm)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PlayReadyDrm")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe HlsContentProtection
   -> Playlist)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe HlsContentProtection
      -> Playlist)
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
"Format")
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe HlsContentProtection
   -> Playlist)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe HlsContentProtection -> Playlist)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OutputKeys" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe HlsContentProtection -> Playlist)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe HlsContentProtection -> Playlist)
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
"Name")
            Parser (Maybe Text -> Maybe HlsContentProtection -> Playlist)
-> Parser (Maybe Text)
-> Parser (Maybe HlsContentProtection -> Playlist)
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
"StatusDetail")
            Parser (Maybe HlsContentProtection -> Playlist)
-> Parser (Maybe HlsContentProtection) -> Parser Playlist
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HlsContentProtection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HlsContentProtection")
      )

instance Prelude.Hashable Playlist

instance Prelude.NFData Playlist