{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaTailor.Types.HlsConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
    { $sel:manifestEndpointPrefix:HlsConfiguration' :: Maybe Text
manifestEndpointPrefix =
        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 :: Lens' HlsConfiguration (Maybe Text)
hlsConfiguration_manifestEndpointPrefix = 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 Data.FromJSON HlsConfiguration where
  parseJSON :: Value -> Parser HlsConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HlsConfiguration"
      ( \Object
x ->
          Maybe Text -> HlsConfiguration
HlsConfiguration'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ManifestEndpointPrefix")
      )

instance Prelude.Hashable HlsConfiguration where
  hashWithSalt :: Int -> HlsConfiguration -> Int
hashWithSalt Int
_salt HlsConfiguration' {Maybe Text
manifestEndpointPrefix :: Maybe Text
$sel:manifestEndpointPrefix:HlsConfiguration' :: HlsConfiguration -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
manifestEndpointPrefix

instance Prelude.NFData HlsConfiguration where
  rnf :: HlsConfiguration -> ()
rnf HlsConfiguration' {Maybe Text
manifestEndpointPrefix :: Maybe Text
$sel:manifestEndpointPrefix:HlsConfiguration' :: HlsConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
manifestEndpointPrefix