{-# 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.DashConfigurationForPut
-- 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.DashConfigurationForPut where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaTailor.Types.OriginManifestType
import qualified Amazonka.Prelude as Prelude

-- | The configuration for DASH PUT operations.
--
-- /See:/ 'newDashConfigurationForPut' smart constructor.
data DashConfigurationForPut = DashConfigurationForPut'
  { -- | The setting that controls whether MediaTailor includes the Location tag
    -- in DASH manifests. MediaTailor populates the Location tag with the URL
    -- for manifest update requests, to be used by players that don\'t support
    -- sticky redirects. Disable this if you have CDN routing rules set up for
    -- accessing MediaTailor manifests, and you are either using client-side
    -- reporting or your players support sticky HTTP redirects. Valid values
    -- are @DISABLED@ and @EMT_DEFAULT@. The @EMT_DEFAULT@ setting enables the
    -- inclusion of the tag and is the default value.
    DashConfigurationForPut -> Maybe Text
mpdLocation :: Prelude.Maybe Prelude.Text,
    -- | The setting that controls whether MediaTailor handles manifests from the
    -- origin server as multi-period manifests or single-period manifests. If
    -- your origin server produces single-period manifests, set this to
    -- @SINGLE_PERIOD@. The default setting is @MULTI_PERIOD@. For multi-period
    -- manifests, omit this setting or set it to @MULTI_PERIOD@.
    DashConfigurationForPut -> Maybe OriginManifestType
originManifestType :: Prelude.Maybe OriginManifestType
  }
  deriving (DashConfigurationForPut -> DashConfigurationForPut -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DashConfigurationForPut -> DashConfigurationForPut -> Bool
$c/= :: DashConfigurationForPut -> DashConfigurationForPut -> Bool
== :: DashConfigurationForPut -> DashConfigurationForPut -> Bool
$c== :: DashConfigurationForPut -> DashConfigurationForPut -> Bool
Prelude.Eq, ReadPrec [DashConfigurationForPut]
ReadPrec DashConfigurationForPut
Int -> ReadS DashConfigurationForPut
ReadS [DashConfigurationForPut]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DashConfigurationForPut]
$creadListPrec :: ReadPrec [DashConfigurationForPut]
readPrec :: ReadPrec DashConfigurationForPut
$creadPrec :: ReadPrec DashConfigurationForPut
readList :: ReadS [DashConfigurationForPut]
$creadList :: ReadS [DashConfigurationForPut]
readsPrec :: Int -> ReadS DashConfigurationForPut
$creadsPrec :: Int -> ReadS DashConfigurationForPut
Prelude.Read, Int -> DashConfigurationForPut -> ShowS
[DashConfigurationForPut] -> ShowS
DashConfigurationForPut -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DashConfigurationForPut] -> ShowS
$cshowList :: [DashConfigurationForPut] -> ShowS
show :: DashConfigurationForPut -> String
$cshow :: DashConfigurationForPut -> String
showsPrec :: Int -> DashConfigurationForPut -> ShowS
$cshowsPrec :: Int -> DashConfigurationForPut -> ShowS
Prelude.Show, forall x. Rep DashConfigurationForPut x -> DashConfigurationForPut
forall x. DashConfigurationForPut -> Rep DashConfigurationForPut x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DashConfigurationForPut x -> DashConfigurationForPut
$cfrom :: forall x. DashConfigurationForPut -> Rep DashConfigurationForPut x
Prelude.Generic)

-- |
-- Create a value of 'DashConfigurationForPut' 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:
--
-- 'mpdLocation', 'dashConfigurationForPut_mpdLocation' - The setting that controls whether MediaTailor includes the Location tag
-- in DASH manifests. MediaTailor populates the Location tag with the URL
-- for manifest update requests, to be used by players that don\'t support
-- sticky redirects. Disable this if you have CDN routing rules set up for
-- accessing MediaTailor manifests, and you are either using client-side
-- reporting or your players support sticky HTTP redirects. Valid values
-- are @DISABLED@ and @EMT_DEFAULT@. The @EMT_DEFAULT@ setting enables the
-- inclusion of the tag and is the default value.
--
-- 'originManifestType', 'dashConfigurationForPut_originManifestType' - The setting that controls whether MediaTailor handles manifests from the
-- origin server as multi-period manifests or single-period manifests. If
-- your origin server produces single-period manifests, set this to
-- @SINGLE_PERIOD@. The default setting is @MULTI_PERIOD@. For multi-period
-- manifests, omit this setting or set it to @MULTI_PERIOD@.
newDashConfigurationForPut ::
  DashConfigurationForPut
newDashConfigurationForPut :: DashConfigurationForPut
newDashConfigurationForPut =
  DashConfigurationForPut'
    { $sel:mpdLocation:DashConfigurationForPut' :: Maybe Text
mpdLocation =
        forall a. Maybe a
Prelude.Nothing,
      $sel:originManifestType:DashConfigurationForPut' :: Maybe OriginManifestType
originManifestType = forall a. Maybe a
Prelude.Nothing
    }

-- | The setting that controls whether MediaTailor includes the Location tag
-- in DASH manifests. MediaTailor populates the Location tag with the URL
-- for manifest update requests, to be used by players that don\'t support
-- sticky redirects. Disable this if you have CDN routing rules set up for
-- accessing MediaTailor manifests, and you are either using client-side
-- reporting or your players support sticky HTTP redirects. Valid values
-- are @DISABLED@ and @EMT_DEFAULT@. The @EMT_DEFAULT@ setting enables the
-- inclusion of the tag and is the default value.
dashConfigurationForPut_mpdLocation :: Lens.Lens' DashConfigurationForPut (Prelude.Maybe Prelude.Text)
dashConfigurationForPut_mpdLocation :: Lens' DashConfigurationForPut (Maybe Text)
dashConfigurationForPut_mpdLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashConfigurationForPut' {Maybe Text
mpdLocation :: Maybe Text
$sel:mpdLocation:DashConfigurationForPut' :: DashConfigurationForPut -> Maybe Text
mpdLocation} -> Maybe Text
mpdLocation) (\s :: DashConfigurationForPut
s@DashConfigurationForPut' {} Maybe Text
a -> DashConfigurationForPut
s {$sel:mpdLocation:DashConfigurationForPut' :: Maybe Text
mpdLocation = Maybe Text
a} :: DashConfigurationForPut)

-- | The setting that controls whether MediaTailor handles manifests from the
-- origin server as multi-period manifests or single-period manifests. If
-- your origin server produces single-period manifests, set this to
-- @SINGLE_PERIOD@. The default setting is @MULTI_PERIOD@. For multi-period
-- manifests, omit this setting or set it to @MULTI_PERIOD@.
dashConfigurationForPut_originManifestType :: Lens.Lens' DashConfigurationForPut (Prelude.Maybe OriginManifestType)
dashConfigurationForPut_originManifestType :: Lens' DashConfigurationForPut (Maybe OriginManifestType)
dashConfigurationForPut_originManifestType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DashConfigurationForPut' {Maybe OriginManifestType
originManifestType :: Maybe OriginManifestType
$sel:originManifestType:DashConfigurationForPut' :: DashConfigurationForPut -> Maybe OriginManifestType
originManifestType} -> Maybe OriginManifestType
originManifestType) (\s :: DashConfigurationForPut
s@DashConfigurationForPut' {} Maybe OriginManifestType
a -> DashConfigurationForPut
s {$sel:originManifestType:DashConfigurationForPut' :: Maybe OriginManifestType
originManifestType = Maybe OriginManifestType
a} :: DashConfigurationForPut)

instance Prelude.Hashable DashConfigurationForPut where
  hashWithSalt :: Int -> DashConfigurationForPut -> Int
hashWithSalt Int
_salt DashConfigurationForPut' {Maybe Text
Maybe OriginManifestType
originManifestType :: Maybe OriginManifestType
mpdLocation :: Maybe Text
$sel:originManifestType:DashConfigurationForPut' :: DashConfigurationForPut -> Maybe OriginManifestType
$sel:mpdLocation:DashConfigurationForPut' :: DashConfigurationForPut -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
mpdLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OriginManifestType
originManifestType

instance Prelude.NFData DashConfigurationForPut where
  rnf :: DashConfigurationForPut -> ()
rnf DashConfigurationForPut' {Maybe Text
Maybe OriginManifestType
originManifestType :: Maybe OriginManifestType
mpdLocation :: Maybe Text
$sel:originManifestType:DashConfigurationForPut' :: DashConfigurationForPut -> Maybe OriginManifestType
$sel:mpdLocation:DashConfigurationForPut' :: DashConfigurationForPut -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
mpdLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OriginManifestType
originManifestType

instance Data.ToJSON DashConfigurationForPut where
  toJSON :: DashConfigurationForPut -> Value
toJSON DashConfigurationForPut' {Maybe Text
Maybe OriginManifestType
originManifestType :: Maybe OriginManifestType
mpdLocation :: Maybe Text
$sel:originManifestType:DashConfigurationForPut' :: DashConfigurationForPut -> Maybe OriginManifestType
$sel:mpdLocation:DashConfigurationForPut' :: DashConfigurationForPut -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MpdLocation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
mpdLocation,
            (Key
"OriginManifestType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OriginManifestType
originManifestType
          ]
      )