{-# 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.MediaTailor.Types.HlsConfiguration
-- 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.MediaTailor.Types.HlsConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The configuration for HLS content.
--
-- /See:/ 'newHlsConfiguration' smart constructor.
data HlsConfiguration = HlsConfiguration'
  { -- | The URL that is used to initiate a playback session for devices that
    -- support Apple HLS. The session uses server-side reporting.
    HlsConfiguration -> Maybe Text
manifestEndpointPrefix :: Prelude.Maybe Prelude.Text
  }
  deriving (HlsConfiguration -> HlsConfiguration -> Bool
(HlsConfiguration -> HlsConfiguration -> Bool)
-> (HlsConfiguration -> HlsConfiguration -> Bool)
-> Eq HlsConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HlsConfiguration -> HlsConfiguration -> Bool
$c/= :: HlsConfiguration -> HlsConfiguration -> Bool
== :: HlsConfiguration -> HlsConfiguration -> Bool
$c== :: HlsConfiguration -> HlsConfiguration -> Bool
Prelude.Eq, ReadPrec [HlsConfiguration]
ReadPrec HlsConfiguration
Int -> ReadS HlsConfiguration
ReadS [HlsConfiguration]
(Int -> ReadS HlsConfiguration)
-> ReadS [HlsConfiguration]
-> ReadPrec HlsConfiguration
-> ReadPrec [HlsConfiguration]
-> Read HlsConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HlsConfiguration]
$creadListPrec :: ReadPrec [HlsConfiguration]
readPrec :: ReadPrec HlsConfiguration
$creadPrec :: ReadPrec HlsConfiguration
readList :: ReadS [HlsConfiguration]
$creadList :: ReadS [HlsConfiguration]
readsPrec :: Int -> ReadS HlsConfiguration
$creadsPrec :: Int -> ReadS HlsConfiguration
Prelude.Read, Int -> HlsConfiguration -> ShowS
[HlsConfiguration] -> ShowS
HlsConfiguration -> String
(Int -> HlsConfiguration -> ShowS)
-> (HlsConfiguration -> String)
-> ([HlsConfiguration] -> ShowS)
-> Show HlsConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HlsConfiguration] -> ShowS
$cshowList :: [HlsConfiguration] -> ShowS
show :: HlsConfiguration -> String
$cshow :: HlsConfiguration -> String
showsPrec :: Int -> HlsConfiguration -> ShowS
$cshowsPrec :: Int -> HlsConfiguration -> ShowS
Prelude.Show, (forall x. HlsConfiguration -> Rep HlsConfiguration x)
-> (forall x. Rep HlsConfiguration x -> HlsConfiguration)
-> Generic HlsConfiguration
forall x. Rep HlsConfiguration x -> HlsConfiguration
forall x. HlsConfiguration -> Rep HlsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HlsConfiguration x -> HlsConfiguration
$cfrom :: forall x. HlsConfiguration -> Rep HlsConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'HlsConfiguration' 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:
--
-- 'manifestEndpointPrefix', 'hlsConfiguration_manifestEndpointPrefix' - The URL that is used to initiate a playback session for devices that
-- support Apple HLS. The session uses server-side reporting.
newHlsConfiguration ::
  HlsConfiguration
newHlsConfiguration :: HlsConfiguration
newHlsConfiguration =
  HlsConfiguration' :: Maybe Text -> HlsConfiguration
HlsConfiguration'
    { $sel:manifestEndpointPrefix:HlsConfiguration' :: Maybe Text
manifestEndpointPrefix =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The URL that is used to initiate a playback session for devices that
-- support Apple HLS. The session uses server-side reporting.
hlsConfiguration_manifestEndpointPrefix :: Lens.Lens' HlsConfiguration (Prelude.Maybe Prelude.Text)
hlsConfiguration_manifestEndpointPrefix :: (Maybe Text -> f (Maybe Text))
-> HlsConfiguration -> f HlsConfiguration
hlsConfiguration_manifestEndpointPrefix = (HlsConfiguration -> Maybe Text)
-> (HlsConfiguration -> Maybe Text -> HlsConfiguration)
-> Lens HlsConfiguration HlsConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsConfiguration' {Maybe Text
manifestEndpointPrefix :: Maybe Text
$sel:manifestEndpointPrefix:HlsConfiguration' :: HlsConfiguration -> Maybe Text
manifestEndpointPrefix} -> Maybe Text
manifestEndpointPrefix) (\s :: HlsConfiguration
s@HlsConfiguration' {} Maybe Text
a -> HlsConfiguration
s {$sel:manifestEndpointPrefix:HlsConfiguration' :: Maybe Text
manifestEndpointPrefix = Maybe Text
a} :: HlsConfiguration)

instance Core.FromJSON HlsConfiguration where
  parseJSON :: Value -> Parser HlsConfiguration
parseJSON =
    String
-> (Object -> Parser HlsConfiguration)
-> Value
-> Parser HlsConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"HlsConfiguration"
      ( \Object
x ->
          Maybe Text -> HlsConfiguration
HlsConfiguration'
            (Maybe Text -> HlsConfiguration)
-> Parser (Maybe Text) -> Parser HlsConfiguration
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
"ManifestEndpointPrefix")
      )

instance Prelude.Hashable HlsConfiguration

instance Prelude.NFData HlsConfiguration