{-# 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.MediaLive.Types.HlsCdnSettings
-- 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.MediaLive.Types.HlsCdnSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.HlsAkamaiSettings
import Amazonka.MediaLive.Types.HlsBasicPutSettings
import Amazonka.MediaLive.Types.HlsMediaStoreSettings
import Amazonka.MediaLive.Types.HlsS3Settings
import Amazonka.MediaLive.Types.HlsWebdavSettings
import qualified Amazonka.Prelude as Prelude

-- | Hls Cdn Settings
--
-- /See:/ 'newHlsCdnSettings' smart constructor.
data HlsCdnSettings = HlsCdnSettings'
  { HlsCdnSettings -> Maybe HlsAkamaiSettings
hlsAkamaiSettings :: Prelude.Maybe HlsAkamaiSettings,
    HlsCdnSettings -> Maybe HlsMediaStoreSettings
hlsMediaStoreSettings :: Prelude.Maybe HlsMediaStoreSettings,
    HlsCdnSettings -> Maybe HlsS3Settings
hlsS3Settings :: Prelude.Maybe HlsS3Settings,
    HlsCdnSettings -> Maybe HlsBasicPutSettings
hlsBasicPutSettings :: Prelude.Maybe HlsBasicPutSettings,
    HlsCdnSettings -> Maybe HlsWebdavSettings
hlsWebdavSettings :: Prelude.Maybe HlsWebdavSettings
  }
  deriving (HlsCdnSettings -> HlsCdnSettings -> Bool
(HlsCdnSettings -> HlsCdnSettings -> Bool)
-> (HlsCdnSettings -> HlsCdnSettings -> Bool) -> Eq HlsCdnSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HlsCdnSettings -> HlsCdnSettings -> Bool
$c/= :: HlsCdnSettings -> HlsCdnSettings -> Bool
== :: HlsCdnSettings -> HlsCdnSettings -> Bool
$c== :: HlsCdnSettings -> HlsCdnSettings -> Bool
Prelude.Eq, ReadPrec [HlsCdnSettings]
ReadPrec HlsCdnSettings
Int -> ReadS HlsCdnSettings
ReadS [HlsCdnSettings]
(Int -> ReadS HlsCdnSettings)
-> ReadS [HlsCdnSettings]
-> ReadPrec HlsCdnSettings
-> ReadPrec [HlsCdnSettings]
-> Read HlsCdnSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HlsCdnSettings]
$creadListPrec :: ReadPrec [HlsCdnSettings]
readPrec :: ReadPrec HlsCdnSettings
$creadPrec :: ReadPrec HlsCdnSettings
readList :: ReadS [HlsCdnSettings]
$creadList :: ReadS [HlsCdnSettings]
readsPrec :: Int -> ReadS HlsCdnSettings
$creadsPrec :: Int -> ReadS HlsCdnSettings
Prelude.Read, Int -> HlsCdnSettings -> ShowS
[HlsCdnSettings] -> ShowS
HlsCdnSettings -> String
(Int -> HlsCdnSettings -> ShowS)
-> (HlsCdnSettings -> String)
-> ([HlsCdnSettings] -> ShowS)
-> Show HlsCdnSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HlsCdnSettings] -> ShowS
$cshowList :: [HlsCdnSettings] -> ShowS
show :: HlsCdnSettings -> String
$cshow :: HlsCdnSettings -> String
showsPrec :: Int -> HlsCdnSettings -> ShowS
$cshowsPrec :: Int -> HlsCdnSettings -> ShowS
Prelude.Show, (forall x. HlsCdnSettings -> Rep HlsCdnSettings x)
-> (forall x. Rep HlsCdnSettings x -> HlsCdnSettings)
-> Generic HlsCdnSettings
forall x. Rep HlsCdnSettings x -> HlsCdnSettings
forall x. HlsCdnSettings -> Rep HlsCdnSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HlsCdnSettings x -> HlsCdnSettings
$cfrom :: forall x. HlsCdnSettings -> Rep HlsCdnSettings x
Prelude.Generic)

-- |
-- Create a value of 'HlsCdnSettings' 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:
--
-- 'hlsAkamaiSettings', 'hlsCdnSettings_hlsAkamaiSettings' - Undocumented member.
--
-- 'hlsMediaStoreSettings', 'hlsCdnSettings_hlsMediaStoreSettings' - Undocumented member.
--
-- 'hlsS3Settings', 'hlsCdnSettings_hlsS3Settings' - Undocumented member.
--
-- 'hlsBasicPutSettings', 'hlsCdnSettings_hlsBasicPutSettings' - Undocumented member.
--
-- 'hlsWebdavSettings', 'hlsCdnSettings_hlsWebdavSettings' - Undocumented member.
newHlsCdnSettings ::
  HlsCdnSettings
newHlsCdnSettings :: HlsCdnSettings
newHlsCdnSettings =
  HlsCdnSettings' :: Maybe HlsAkamaiSettings
-> Maybe HlsMediaStoreSettings
-> Maybe HlsS3Settings
-> Maybe HlsBasicPutSettings
-> Maybe HlsWebdavSettings
-> HlsCdnSettings
HlsCdnSettings'
    { $sel:hlsAkamaiSettings:HlsCdnSettings' :: Maybe HlsAkamaiSettings
hlsAkamaiSettings =
        Maybe HlsAkamaiSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:hlsMediaStoreSettings:HlsCdnSettings' :: Maybe HlsMediaStoreSettings
hlsMediaStoreSettings = Maybe HlsMediaStoreSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:hlsS3Settings:HlsCdnSettings' :: Maybe HlsS3Settings
hlsS3Settings = Maybe HlsS3Settings
forall a. Maybe a
Prelude.Nothing,
      $sel:hlsBasicPutSettings:HlsCdnSettings' :: Maybe HlsBasicPutSettings
hlsBasicPutSettings = Maybe HlsBasicPutSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:hlsWebdavSettings:HlsCdnSettings' :: Maybe HlsWebdavSettings
hlsWebdavSettings = Maybe HlsWebdavSettings
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
hlsCdnSettings_hlsAkamaiSettings :: Lens.Lens' HlsCdnSettings (Prelude.Maybe HlsAkamaiSettings)
hlsCdnSettings_hlsAkamaiSettings :: (Maybe HlsAkamaiSettings -> f (Maybe HlsAkamaiSettings))
-> HlsCdnSettings -> f HlsCdnSettings
hlsCdnSettings_hlsAkamaiSettings = (HlsCdnSettings -> Maybe HlsAkamaiSettings)
-> (HlsCdnSettings -> Maybe HlsAkamaiSettings -> HlsCdnSettings)
-> Lens
     HlsCdnSettings
     HlsCdnSettings
     (Maybe HlsAkamaiSettings)
     (Maybe HlsAkamaiSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsCdnSettings' {Maybe HlsAkamaiSettings
hlsAkamaiSettings :: Maybe HlsAkamaiSettings
$sel:hlsAkamaiSettings:HlsCdnSettings' :: HlsCdnSettings -> Maybe HlsAkamaiSettings
hlsAkamaiSettings} -> Maybe HlsAkamaiSettings
hlsAkamaiSettings) (\s :: HlsCdnSettings
s@HlsCdnSettings' {} Maybe HlsAkamaiSettings
a -> HlsCdnSettings
s {$sel:hlsAkamaiSettings:HlsCdnSettings' :: Maybe HlsAkamaiSettings
hlsAkamaiSettings = Maybe HlsAkamaiSettings
a} :: HlsCdnSettings)

-- | Undocumented member.
hlsCdnSettings_hlsMediaStoreSettings :: Lens.Lens' HlsCdnSettings (Prelude.Maybe HlsMediaStoreSettings)
hlsCdnSettings_hlsMediaStoreSettings :: (Maybe HlsMediaStoreSettings -> f (Maybe HlsMediaStoreSettings))
-> HlsCdnSettings -> f HlsCdnSettings
hlsCdnSettings_hlsMediaStoreSettings = (HlsCdnSettings -> Maybe HlsMediaStoreSettings)
-> (HlsCdnSettings
    -> Maybe HlsMediaStoreSettings -> HlsCdnSettings)
-> Lens
     HlsCdnSettings
     HlsCdnSettings
     (Maybe HlsMediaStoreSettings)
     (Maybe HlsMediaStoreSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsCdnSettings' {Maybe HlsMediaStoreSettings
hlsMediaStoreSettings :: Maybe HlsMediaStoreSettings
$sel:hlsMediaStoreSettings:HlsCdnSettings' :: HlsCdnSettings -> Maybe HlsMediaStoreSettings
hlsMediaStoreSettings} -> Maybe HlsMediaStoreSettings
hlsMediaStoreSettings) (\s :: HlsCdnSettings
s@HlsCdnSettings' {} Maybe HlsMediaStoreSettings
a -> HlsCdnSettings
s {$sel:hlsMediaStoreSettings:HlsCdnSettings' :: Maybe HlsMediaStoreSettings
hlsMediaStoreSettings = Maybe HlsMediaStoreSettings
a} :: HlsCdnSettings)

-- | Undocumented member.
hlsCdnSettings_hlsS3Settings :: Lens.Lens' HlsCdnSettings (Prelude.Maybe HlsS3Settings)
hlsCdnSettings_hlsS3Settings :: (Maybe HlsS3Settings -> f (Maybe HlsS3Settings))
-> HlsCdnSettings -> f HlsCdnSettings
hlsCdnSettings_hlsS3Settings = (HlsCdnSettings -> Maybe HlsS3Settings)
-> (HlsCdnSettings -> Maybe HlsS3Settings -> HlsCdnSettings)
-> Lens
     HlsCdnSettings
     HlsCdnSettings
     (Maybe HlsS3Settings)
     (Maybe HlsS3Settings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsCdnSettings' {Maybe HlsS3Settings
hlsS3Settings :: Maybe HlsS3Settings
$sel:hlsS3Settings:HlsCdnSettings' :: HlsCdnSettings -> Maybe HlsS3Settings
hlsS3Settings} -> Maybe HlsS3Settings
hlsS3Settings) (\s :: HlsCdnSettings
s@HlsCdnSettings' {} Maybe HlsS3Settings
a -> HlsCdnSettings
s {$sel:hlsS3Settings:HlsCdnSettings' :: Maybe HlsS3Settings
hlsS3Settings = Maybe HlsS3Settings
a} :: HlsCdnSettings)

-- | Undocumented member.
hlsCdnSettings_hlsBasicPutSettings :: Lens.Lens' HlsCdnSettings (Prelude.Maybe HlsBasicPutSettings)
hlsCdnSettings_hlsBasicPutSettings :: (Maybe HlsBasicPutSettings -> f (Maybe HlsBasicPutSettings))
-> HlsCdnSettings -> f HlsCdnSettings
hlsCdnSettings_hlsBasicPutSettings = (HlsCdnSettings -> Maybe HlsBasicPutSettings)
-> (HlsCdnSettings -> Maybe HlsBasicPutSettings -> HlsCdnSettings)
-> Lens
     HlsCdnSettings
     HlsCdnSettings
     (Maybe HlsBasicPutSettings)
     (Maybe HlsBasicPutSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsCdnSettings' {Maybe HlsBasicPutSettings
hlsBasicPutSettings :: Maybe HlsBasicPutSettings
$sel:hlsBasicPutSettings:HlsCdnSettings' :: HlsCdnSettings -> Maybe HlsBasicPutSettings
hlsBasicPutSettings} -> Maybe HlsBasicPutSettings
hlsBasicPutSettings) (\s :: HlsCdnSettings
s@HlsCdnSettings' {} Maybe HlsBasicPutSettings
a -> HlsCdnSettings
s {$sel:hlsBasicPutSettings:HlsCdnSettings' :: Maybe HlsBasicPutSettings
hlsBasicPutSettings = Maybe HlsBasicPutSettings
a} :: HlsCdnSettings)

-- | Undocumented member.
hlsCdnSettings_hlsWebdavSettings :: Lens.Lens' HlsCdnSettings (Prelude.Maybe HlsWebdavSettings)
hlsCdnSettings_hlsWebdavSettings :: (Maybe HlsWebdavSettings -> f (Maybe HlsWebdavSettings))
-> HlsCdnSettings -> f HlsCdnSettings
hlsCdnSettings_hlsWebdavSettings = (HlsCdnSettings -> Maybe HlsWebdavSettings)
-> (HlsCdnSettings -> Maybe HlsWebdavSettings -> HlsCdnSettings)
-> Lens
     HlsCdnSettings
     HlsCdnSettings
     (Maybe HlsWebdavSettings)
     (Maybe HlsWebdavSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsCdnSettings' {Maybe HlsWebdavSettings
hlsWebdavSettings :: Maybe HlsWebdavSettings
$sel:hlsWebdavSettings:HlsCdnSettings' :: HlsCdnSettings -> Maybe HlsWebdavSettings
hlsWebdavSettings} -> Maybe HlsWebdavSettings
hlsWebdavSettings) (\s :: HlsCdnSettings
s@HlsCdnSettings' {} Maybe HlsWebdavSettings
a -> HlsCdnSettings
s {$sel:hlsWebdavSettings:HlsCdnSettings' :: Maybe HlsWebdavSettings
hlsWebdavSettings = Maybe HlsWebdavSettings
a} :: HlsCdnSettings)

instance Core.FromJSON HlsCdnSettings where
  parseJSON :: Value -> Parser HlsCdnSettings
parseJSON =
    String
-> (Object -> Parser HlsCdnSettings)
-> Value
-> Parser HlsCdnSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"HlsCdnSettings"
      ( \Object
x ->
          Maybe HlsAkamaiSettings
-> Maybe HlsMediaStoreSettings
-> Maybe HlsS3Settings
-> Maybe HlsBasicPutSettings
-> Maybe HlsWebdavSettings
-> HlsCdnSettings
HlsCdnSettings'
            (Maybe HlsAkamaiSettings
 -> Maybe HlsMediaStoreSettings
 -> Maybe HlsS3Settings
 -> Maybe HlsBasicPutSettings
 -> Maybe HlsWebdavSettings
 -> HlsCdnSettings)
-> Parser (Maybe HlsAkamaiSettings)
-> Parser
     (Maybe HlsMediaStoreSettings
      -> Maybe HlsS3Settings
      -> Maybe HlsBasicPutSettings
      -> Maybe HlsWebdavSettings
      -> HlsCdnSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe HlsAkamaiSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hlsAkamaiSettings")
            Parser
  (Maybe HlsMediaStoreSettings
   -> Maybe HlsS3Settings
   -> Maybe HlsBasicPutSettings
   -> Maybe HlsWebdavSettings
   -> HlsCdnSettings)
-> Parser (Maybe HlsMediaStoreSettings)
-> Parser
     (Maybe HlsS3Settings
      -> Maybe HlsBasicPutSettings
      -> Maybe HlsWebdavSettings
      -> HlsCdnSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HlsMediaStoreSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hlsMediaStoreSettings")
            Parser
  (Maybe HlsS3Settings
   -> Maybe HlsBasicPutSettings
   -> Maybe HlsWebdavSettings
   -> HlsCdnSettings)
-> Parser (Maybe HlsS3Settings)
-> Parser
     (Maybe HlsBasicPutSettings
      -> Maybe HlsWebdavSettings -> HlsCdnSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HlsS3Settings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hlsS3Settings")
            Parser
  (Maybe HlsBasicPutSettings
   -> Maybe HlsWebdavSettings -> HlsCdnSettings)
-> Parser (Maybe HlsBasicPutSettings)
-> Parser (Maybe HlsWebdavSettings -> HlsCdnSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HlsBasicPutSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hlsBasicPutSettings")
            Parser (Maybe HlsWebdavSettings -> HlsCdnSettings)
-> Parser (Maybe HlsWebdavSettings) -> Parser HlsCdnSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HlsWebdavSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hlsWebdavSettings")
      )

instance Prelude.Hashable HlsCdnSettings

instance Prelude.NFData HlsCdnSettings

instance Core.ToJSON HlsCdnSettings where
  toJSON :: HlsCdnSettings -> Value
toJSON HlsCdnSettings' {Maybe HlsAkamaiSettings
Maybe HlsBasicPutSettings
Maybe HlsMediaStoreSettings
Maybe HlsWebdavSettings
Maybe HlsS3Settings
hlsWebdavSettings :: Maybe HlsWebdavSettings
hlsBasicPutSettings :: Maybe HlsBasicPutSettings
hlsS3Settings :: Maybe HlsS3Settings
hlsMediaStoreSettings :: Maybe HlsMediaStoreSettings
hlsAkamaiSettings :: Maybe HlsAkamaiSettings
$sel:hlsWebdavSettings:HlsCdnSettings' :: HlsCdnSettings -> Maybe HlsWebdavSettings
$sel:hlsBasicPutSettings:HlsCdnSettings' :: HlsCdnSettings -> Maybe HlsBasicPutSettings
$sel:hlsS3Settings:HlsCdnSettings' :: HlsCdnSettings -> Maybe HlsS3Settings
$sel:hlsMediaStoreSettings:HlsCdnSettings' :: HlsCdnSettings -> Maybe HlsMediaStoreSettings
$sel:hlsAkamaiSettings:HlsCdnSettings' :: HlsCdnSettings -> Maybe HlsAkamaiSettings
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"hlsAkamaiSettings" Text -> HlsAkamaiSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HlsAkamaiSettings -> Pair)
-> Maybe HlsAkamaiSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HlsAkamaiSettings
hlsAkamaiSettings,
            (Text
"hlsMediaStoreSettings" Text -> HlsMediaStoreSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HlsMediaStoreSettings -> Pair)
-> Maybe HlsMediaStoreSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HlsMediaStoreSettings
hlsMediaStoreSettings,
            (Text
"hlsS3Settings" Text -> HlsS3Settings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HlsS3Settings -> Pair) -> Maybe HlsS3Settings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HlsS3Settings
hlsS3Settings,
            (Text
"hlsBasicPutSettings" Text -> HlsBasicPutSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HlsBasicPutSettings -> Pair)
-> Maybe HlsBasicPutSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HlsBasicPutSettings
hlsBasicPutSettings,
            (Text
"hlsWebdavSettings" Text -> HlsWebdavSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HlsWebdavSettings -> Pair)
-> Maybe HlsWebdavSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HlsWebdavSettings
hlsWebdavSettings
          ]
      )