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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 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,
    -- | 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
  }
  deriving (DashConfigurationForPut -> DashConfigurationForPut -> Bool
(DashConfigurationForPut -> DashConfigurationForPut -> Bool)
-> (DashConfigurationForPut -> DashConfigurationForPut -> Bool)
-> Eq DashConfigurationForPut
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]
(Int -> ReadS DashConfigurationForPut)
-> ReadS [DashConfigurationForPut]
-> ReadPrec DashConfigurationForPut
-> ReadPrec [DashConfigurationForPut]
-> Read 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
(Int -> DashConfigurationForPut -> ShowS)
-> (DashConfigurationForPut -> String)
-> ([DashConfigurationForPut] -> ShowS)
-> Show DashConfigurationForPut
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.
 DashConfigurationForPut -> Rep DashConfigurationForPut x)
-> (forall x.
    Rep DashConfigurationForPut x -> DashConfigurationForPut)
-> Generic DashConfigurationForPut
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:
--
-- '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.
--
-- '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.
newDashConfigurationForPut ::
  DashConfigurationForPut
newDashConfigurationForPut :: DashConfigurationForPut
newDashConfigurationForPut =
  DashConfigurationForPut' :: Maybe OriginManifestType -> Maybe Text -> DashConfigurationForPut
DashConfigurationForPut'
    { $sel:originManifestType:DashConfigurationForPut' :: Maybe OriginManifestType
originManifestType =
        Maybe OriginManifestType
forall a. Maybe a
Prelude.Nothing,
      $sel:mpdLocation:DashConfigurationForPut' :: Maybe Text
mpdLocation = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe OriginManifestType -> f (Maybe OriginManifestType))
-> DashConfigurationForPut -> f DashConfigurationForPut
dashConfigurationForPut_originManifestType = (DashConfigurationForPut -> Maybe OriginManifestType)
-> (DashConfigurationForPut
    -> Maybe OriginManifestType -> DashConfigurationForPut)
-> Lens
     DashConfigurationForPut
     DashConfigurationForPut
     (Maybe OriginManifestType)
     (Maybe 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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> DashConfigurationForPut -> f DashConfigurationForPut
dashConfigurationForPut_mpdLocation = (DashConfigurationForPut -> Maybe Text)
-> (DashConfigurationForPut
    -> Maybe Text -> DashConfigurationForPut)
-> Lens
     DashConfigurationForPut
     DashConfigurationForPut
     (Maybe Text)
     (Maybe Text)
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)

instance Prelude.Hashable DashConfigurationForPut

instance Prelude.NFData DashConfigurationForPut

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