{-# 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.MediaConvert.Types.HlsEncryptionSettings
-- 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.MediaConvert.Types.HlsEncryptionSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types.HlsEncryptionType
import Amazonka.MediaConvert.Types.HlsInitializationVectorInManifest
import Amazonka.MediaConvert.Types.HlsKeyProviderType
import Amazonka.MediaConvert.Types.HlsOfflineEncrypted
import Amazonka.MediaConvert.Types.SpekeKeyProvider
import Amazonka.MediaConvert.Types.StaticKeyProvider
import qualified Amazonka.Prelude as Prelude

-- | Settings for HLS encryption
--
-- /See:/ 'newHlsEncryptionSettings' smart constructor.
data HlsEncryptionSettings = HlsEncryptionSettings'
  { -- | This is a 128-bit, 16-byte hex value represented by a 32-character text
    -- string. If this parameter is not set then the Initialization Vector will
    -- follow the segment number by default.
    HlsEncryptionSettings -> Maybe Text
constantInitializationVector :: Prelude.Maybe Prelude.Text,
    -- | Encrypts the segments with the given encryption scheme. Leave blank to
    -- disable. Selecting \'Disabled\' in the web interface also disables
    -- encryption.
    HlsEncryptionSettings -> Maybe HlsEncryptionType
encryptionMethod :: Prelude.Maybe HlsEncryptionType,
    -- | The Initialization Vector is a 128-bit number used in conjunction with
    -- the key for encrypting blocks. If set to INCLUDE, Initialization Vector
    -- is listed in the manifest. Otherwise Initialization Vector is not in the
    -- manifest.
    HlsEncryptionSettings -> Maybe HlsInitializationVectorInManifest
initializationVectorInManifest :: Prelude.Maybe HlsInitializationVectorInManifest,
    -- | Enable this setting to insert the EXT-X-SESSION-KEY element into the
    -- master playlist. This allows for offline Apple HLS FairPlay content
    -- protection.
    HlsEncryptionSettings -> Maybe HlsOfflineEncrypted
offlineEncrypted :: Prelude.Maybe HlsOfflineEncrypted,
    -- | If your output group type is HLS, DASH, or Microsoft Smooth, use these
    -- settings when doing DRM encryption with a SPEKE-compliant key provider.
    -- If your output group type is CMAF, use the SpekeKeyProviderCmaf settings
    -- instead.
    HlsEncryptionSettings -> Maybe SpekeKeyProvider
spekeKeyProvider :: Prelude.Maybe SpekeKeyProvider,
    -- | Use these settings to set up encryption with a static key provider.
    HlsEncryptionSettings -> Maybe StaticKeyProvider
staticKeyProvider :: Prelude.Maybe StaticKeyProvider,
    -- | Specify whether your DRM encryption key is static or from a key provider
    -- that follows the SPEKE standard. For more information about SPEKE, see
    -- https:\/\/docs.aws.amazon.com\/speke\/latest\/documentation\/what-is-speke.html.
    HlsEncryptionSettings -> Maybe HlsKeyProviderType
type' :: Prelude.Maybe HlsKeyProviderType
  }
  deriving (HlsEncryptionSettings -> HlsEncryptionSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HlsEncryptionSettings -> HlsEncryptionSettings -> Bool
$c/= :: HlsEncryptionSettings -> HlsEncryptionSettings -> Bool
== :: HlsEncryptionSettings -> HlsEncryptionSettings -> Bool
$c== :: HlsEncryptionSettings -> HlsEncryptionSettings -> Bool
Prelude.Eq, ReadPrec [HlsEncryptionSettings]
ReadPrec HlsEncryptionSettings
Int -> ReadS HlsEncryptionSettings
ReadS [HlsEncryptionSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HlsEncryptionSettings]
$creadListPrec :: ReadPrec [HlsEncryptionSettings]
readPrec :: ReadPrec HlsEncryptionSettings
$creadPrec :: ReadPrec HlsEncryptionSettings
readList :: ReadS [HlsEncryptionSettings]
$creadList :: ReadS [HlsEncryptionSettings]
readsPrec :: Int -> ReadS HlsEncryptionSettings
$creadsPrec :: Int -> ReadS HlsEncryptionSettings
Prelude.Read, Int -> HlsEncryptionSettings -> ShowS
[HlsEncryptionSettings] -> ShowS
HlsEncryptionSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HlsEncryptionSettings] -> ShowS
$cshowList :: [HlsEncryptionSettings] -> ShowS
show :: HlsEncryptionSettings -> String
$cshow :: HlsEncryptionSettings -> String
showsPrec :: Int -> HlsEncryptionSettings -> ShowS
$cshowsPrec :: Int -> HlsEncryptionSettings -> ShowS
Prelude.Show, forall x. Rep HlsEncryptionSettings x -> HlsEncryptionSettings
forall x. HlsEncryptionSettings -> Rep HlsEncryptionSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HlsEncryptionSettings x -> HlsEncryptionSettings
$cfrom :: forall x. HlsEncryptionSettings -> Rep HlsEncryptionSettings x
Prelude.Generic)

-- |
-- Create a value of 'HlsEncryptionSettings' 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:
--
-- 'constantInitializationVector', 'hlsEncryptionSettings_constantInitializationVector' - This is a 128-bit, 16-byte hex value represented by a 32-character text
-- string. If this parameter is not set then the Initialization Vector will
-- follow the segment number by default.
--
-- 'encryptionMethod', 'hlsEncryptionSettings_encryptionMethod' - Encrypts the segments with the given encryption scheme. Leave blank to
-- disable. Selecting \'Disabled\' in the web interface also disables
-- encryption.
--
-- 'initializationVectorInManifest', 'hlsEncryptionSettings_initializationVectorInManifest' - The Initialization Vector is a 128-bit number used in conjunction with
-- the key for encrypting blocks. If set to INCLUDE, Initialization Vector
-- is listed in the manifest. Otherwise Initialization Vector is not in the
-- manifest.
--
-- 'offlineEncrypted', 'hlsEncryptionSettings_offlineEncrypted' - Enable this setting to insert the EXT-X-SESSION-KEY element into the
-- master playlist. This allows for offline Apple HLS FairPlay content
-- protection.
--
-- 'spekeKeyProvider', 'hlsEncryptionSettings_spekeKeyProvider' - If your output group type is HLS, DASH, or Microsoft Smooth, use these
-- settings when doing DRM encryption with a SPEKE-compliant key provider.
-- If your output group type is CMAF, use the SpekeKeyProviderCmaf settings
-- instead.
--
-- 'staticKeyProvider', 'hlsEncryptionSettings_staticKeyProvider' - Use these settings to set up encryption with a static key provider.
--
-- 'type'', 'hlsEncryptionSettings_type' - Specify whether your DRM encryption key is static or from a key provider
-- that follows the SPEKE standard. For more information about SPEKE, see
-- https:\/\/docs.aws.amazon.com\/speke\/latest\/documentation\/what-is-speke.html.
newHlsEncryptionSettings ::
  HlsEncryptionSettings
newHlsEncryptionSettings :: HlsEncryptionSettings
newHlsEncryptionSettings =
  HlsEncryptionSettings'
    { $sel:constantInitializationVector:HlsEncryptionSettings' :: Maybe Text
constantInitializationVector =
        forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionMethod:HlsEncryptionSettings' :: Maybe HlsEncryptionType
encryptionMethod = forall a. Maybe a
Prelude.Nothing,
      $sel:initializationVectorInManifest:HlsEncryptionSettings' :: Maybe HlsInitializationVectorInManifest
initializationVectorInManifest = forall a. Maybe a
Prelude.Nothing,
      $sel:offlineEncrypted:HlsEncryptionSettings' :: Maybe HlsOfflineEncrypted
offlineEncrypted = forall a. Maybe a
Prelude.Nothing,
      $sel:spekeKeyProvider:HlsEncryptionSettings' :: Maybe SpekeKeyProvider
spekeKeyProvider = forall a. Maybe a
Prelude.Nothing,
      $sel:staticKeyProvider:HlsEncryptionSettings' :: Maybe StaticKeyProvider
staticKeyProvider = forall a. Maybe a
Prelude.Nothing,
      $sel:type':HlsEncryptionSettings' :: Maybe HlsKeyProviderType
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | This is a 128-bit, 16-byte hex value represented by a 32-character text
-- string. If this parameter is not set then the Initialization Vector will
-- follow the segment number by default.
hlsEncryptionSettings_constantInitializationVector :: Lens.Lens' HlsEncryptionSettings (Prelude.Maybe Prelude.Text)
hlsEncryptionSettings_constantInitializationVector :: Lens' HlsEncryptionSettings (Maybe Text)
hlsEncryptionSettings_constantInitializationVector = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsEncryptionSettings' {Maybe Text
constantInitializationVector :: Maybe Text
$sel:constantInitializationVector:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe Text
constantInitializationVector} -> Maybe Text
constantInitializationVector) (\s :: HlsEncryptionSettings
s@HlsEncryptionSettings' {} Maybe Text
a -> HlsEncryptionSettings
s {$sel:constantInitializationVector:HlsEncryptionSettings' :: Maybe Text
constantInitializationVector = Maybe Text
a} :: HlsEncryptionSettings)

-- | Encrypts the segments with the given encryption scheme. Leave blank to
-- disable. Selecting \'Disabled\' in the web interface also disables
-- encryption.
hlsEncryptionSettings_encryptionMethod :: Lens.Lens' HlsEncryptionSettings (Prelude.Maybe HlsEncryptionType)
hlsEncryptionSettings_encryptionMethod :: Lens' HlsEncryptionSettings (Maybe HlsEncryptionType)
hlsEncryptionSettings_encryptionMethod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsEncryptionSettings' {Maybe HlsEncryptionType
encryptionMethod :: Maybe HlsEncryptionType
$sel:encryptionMethod:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsEncryptionType
encryptionMethod} -> Maybe HlsEncryptionType
encryptionMethod) (\s :: HlsEncryptionSettings
s@HlsEncryptionSettings' {} Maybe HlsEncryptionType
a -> HlsEncryptionSettings
s {$sel:encryptionMethod:HlsEncryptionSettings' :: Maybe HlsEncryptionType
encryptionMethod = Maybe HlsEncryptionType
a} :: HlsEncryptionSettings)

-- | The Initialization Vector is a 128-bit number used in conjunction with
-- the key for encrypting blocks. If set to INCLUDE, Initialization Vector
-- is listed in the manifest. Otherwise Initialization Vector is not in the
-- manifest.
hlsEncryptionSettings_initializationVectorInManifest :: Lens.Lens' HlsEncryptionSettings (Prelude.Maybe HlsInitializationVectorInManifest)
hlsEncryptionSettings_initializationVectorInManifest :: Lens'
  HlsEncryptionSettings (Maybe HlsInitializationVectorInManifest)
hlsEncryptionSettings_initializationVectorInManifest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsEncryptionSettings' {Maybe HlsInitializationVectorInManifest
initializationVectorInManifest :: Maybe HlsInitializationVectorInManifest
$sel:initializationVectorInManifest:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsInitializationVectorInManifest
initializationVectorInManifest} -> Maybe HlsInitializationVectorInManifest
initializationVectorInManifest) (\s :: HlsEncryptionSettings
s@HlsEncryptionSettings' {} Maybe HlsInitializationVectorInManifest
a -> HlsEncryptionSettings
s {$sel:initializationVectorInManifest:HlsEncryptionSettings' :: Maybe HlsInitializationVectorInManifest
initializationVectorInManifest = Maybe HlsInitializationVectorInManifest
a} :: HlsEncryptionSettings)

-- | Enable this setting to insert the EXT-X-SESSION-KEY element into the
-- master playlist. This allows for offline Apple HLS FairPlay content
-- protection.
hlsEncryptionSettings_offlineEncrypted :: Lens.Lens' HlsEncryptionSettings (Prelude.Maybe HlsOfflineEncrypted)
hlsEncryptionSettings_offlineEncrypted :: Lens' HlsEncryptionSettings (Maybe HlsOfflineEncrypted)
hlsEncryptionSettings_offlineEncrypted = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsEncryptionSettings' {Maybe HlsOfflineEncrypted
offlineEncrypted :: Maybe HlsOfflineEncrypted
$sel:offlineEncrypted:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsOfflineEncrypted
offlineEncrypted} -> Maybe HlsOfflineEncrypted
offlineEncrypted) (\s :: HlsEncryptionSettings
s@HlsEncryptionSettings' {} Maybe HlsOfflineEncrypted
a -> HlsEncryptionSettings
s {$sel:offlineEncrypted:HlsEncryptionSettings' :: Maybe HlsOfflineEncrypted
offlineEncrypted = Maybe HlsOfflineEncrypted
a} :: HlsEncryptionSettings)

-- | If your output group type is HLS, DASH, or Microsoft Smooth, use these
-- settings when doing DRM encryption with a SPEKE-compliant key provider.
-- If your output group type is CMAF, use the SpekeKeyProviderCmaf settings
-- instead.
hlsEncryptionSettings_spekeKeyProvider :: Lens.Lens' HlsEncryptionSettings (Prelude.Maybe SpekeKeyProvider)
hlsEncryptionSettings_spekeKeyProvider :: Lens' HlsEncryptionSettings (Maybe SpekeKeyProvider)
hlsEncryptionSettings_spekeKeyProvider = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsEncryptionSettings' {Maybe SpekeKeyProvider
spekeKeyProvider :: Maybe SpekeKeyProvider
$sel:spekeKeyProvider:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe SpekeKeyProvider
spekeKeyProvider} -> Maybe SpekeKeyProvider
spekeKeyProvider) (\s :: HlsEncryptionSettings
s@HlsEncryptionSettings' {} Maybe SpekeKeyProvider
a -> HlsEncryptionSettings
s {$sel:spekeKeyProvider:HlsEncryptionSettings' :: Maybe SpekeKeyProvider
spekeKeyProvider = Maybe SpekeKeyProvider
a} :: HlsEncryptionSettings)

-- | Use these settings to set up encryption with a static key provider.
hlsEncryptionSettings_staticKeyProvider :: Lens.Lens' HlsEncryptionSettings (Prelude.Maybe StaticKeyProvider)
hlsEncryptionSettings_staticKeyProvider :: Lens' HlsEncryptionSettings (Maybe StaticKeyProvider)
hlsEncryptionSettings_staticKeyProvider = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsEncryptionSettings' {Maybe StaticKeyProvider
staticKeyProvider :: Maybe StaticKeyProvider
$sel:staticKeyProvider:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe StaticKeyProvider
staticKeyProvider} -> Maybe StaticKeyProvider
staticKeyProvider) (\s :: HlsEncryptionSettings
s@HlsEncryptionSettings' {} Maybe StaticKeyProvider
a -> HlsEncryptionSettings
s {$sel:staticKeyProvider:HlsEncryptionSettings' :: Maybe StaticKeyProvider
staticKeyProvider = Maybe StaticKeyProvider
a} :: HlsEncryptionSettings)

-- | Specify whether your DRM encryption key is static or from a key provider
-- that follows the SPEKE standard. For more information about SPEKE, see
-- https:\/\/docs.aws.amazon.com\/speke\/latest\/documentation\/what-is-speke.html.
hlsEncryptionSettings_type :: Lens.Lens' HlsEncryptionSettings (Prelude.Maybe HlsKeyProviderType)
hlsEncryptionSettings_type :: Lens' HlsEncryptionSettings (Maybe HlsKeyProviderType)
hlsEncryptionSettings_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsEncryptionSettings' {Maybe HlsKeyProviderType
type' :: Maybe HlsKeyProviderType
$sel:type':HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsKeyProviderType
type'} -> Maybe HlsKeyProviderType
type') (\s :: HlsEncryptionSettings
s@HlsEncryptionSettings' {} Maybe HlsKeyProviderType
a -> HlsEncryptionSettings
s {$sel:type':HlsEncryptionSettings' :: Maybe HlsKeyProviderType
type' = Maybe HlsKeyProviderType
a} :: HlsEncryptionSettings)

instance Data.FromJSON HlsEncryptionSettings where
  parseJSON :: Value -> Parser HlsEncryptionSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HlsEncryptionSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe HlsEncryptionType
-> Maybe HlsInitializationVectorInManifest
-> Maybe HlsOfflineEncrypted
-> Maybe SpekeKeyProvider
-> Maybe StaticKeyProvider
-> Maybe HlsKeyProviderType
-> HlsEncryptionSettings
HlsEncryptionSettings'
            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
"constantInitializationVector")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"encryptionMethod")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"initializationVectorInManifest")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"offlineEncrypted")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"spekeKeyProvider")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"staticKeyProvider")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"type")
      )

instance Prelude.Hashable HlsEncryptionSettings where
  hashWithSalt :: Int -> HlsEncryptionSettings -> Int
hashWithSalt Int
_salt HlsEncryptionSettings' {Maybe Text
Maybe HlsEncryptionType
Maybe HlsInitializationVectorInManifest
Maybe HlsKeyProviderType
Maybe HlsOfflineEncrypted
Maybe SpekeKeyProvider
Maybe StaticKeyProvider
type' :: Maybe HlsKeyProviderType
staticKeyProvider :: Maybe StaticKeyProvider
spekeKeyProvider :: Maybe SpekeKeyProvider
offlineEncrypted :: Maybe HlsOfflineEncrypted
initializationVectorInManifest :: Maybe HlsInitializationVectorInManifest
encryptionMethod :: Maybe HlsEncryptionType
constantInitializationVector :: Maybe Text
$sel:type':HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsKeyProviderType
$sel:staticKeyProvider:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe StaticKeyProvider
$sel:spekeKeyProvider:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe SpekeKeyProvider
$sel:offlineEncrypted:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsOfflineEncrypted
$sel:initializationVectorInManifest:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsInitializationVectorInManifest
$sel:encryptionMethod:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsEncryptionType
$sel:constantInitializationVector:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
constantInitializationVector
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HlsEncryptionType
encryptionMethod
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HlsInitializationVectorInManifest
initializationVectorInManifest
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HlsOfflineEncrypted
offlineEncrypted
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SpekeKeyProvider
spekeKeyProvider
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StaticKeyProvider
staticKeyProvider
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HlsKeyProviderType
type'

instance Prelude.NFData HlsEncryptionSettings where
  rnf :: HlsEncryptionSettings -> ()
rnf HlsEncryptionSettings' {Maybe Text
Maybe HlsEncryptionType
Maybe HlsInitializationVectorInManifest
Maybe HlsKeyProviderType
Maybe HlsOfflineEncrypted
Maybe SpekeKeyProvider
Maybe StaticKeyProvider
type' :: Maybe HlsKeyProviderType
staticKeyProvider :: Maybe StaticKeyProvider
spekeKeyProvider :: Maybe SpekeKeyProvider
offlineEncrypted :: Maybe HlsOfflineEncrypted
initializationVectorInManifest :: Maybe HlsInitializationVectorInManifest
encryptionMethod :: Maybe HlsEncryptionType
constantInitializationVector :: Maybe Text
$sel:type':HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsKeyProviderType
$sel:staticKeyProvider:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe StaticKeyProvider
$sel:spekeKeyProvider:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe SpekeKeyProvider
$sel:offlineEncrypted:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsOfflineEncrypted
$sel:initializationVectorInManifest:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsInitializationVectorInManifest
$sel:encryptionMethod:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsEncryptionType
$sel:constantInitializationVector:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
constantInitializationVector
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HlsEncryptionType
encryptionMethod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HlsInitializationVectorInManifest
initializationVectorInManifest
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HlsOfflineEncrypted
offlineEncrypted
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SpekeKeyProvider
spekeKeyProvider
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StaticKeyProvider
staticKeyProvider
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HlsKeyProviderType
type'

instance Data.ToJSON HlsEncryptionSettings where
  toJSON :: HlsEncryptionSettings -> Value
toJSON HlsEncryptionSettings' {Maybe Text
Maybe HlsEncryptionType
Maybe HlsInitializationVectorInManifest
Maybe HlsKeyProviderType
Maybe HlsOfflineEncrypted
Maybe SpekeKeyProvider
Maybe StaticKeyProvider
type' :: Maybe HlsKeyProviderType
staticKeyProvider :: Maybe StaticKeyProvider
spekeKeyProvider :: Maybe SpekeKeyProvider
offlineEncrypted :: Maybe HlsOfflineEncrypted
initializationVectorInManifest :: Maybe HlsInitializationVectorInManifest
encryptionMethod :: Maybe HlsEncryptionType
constantInitializationVector :: Maybe Text
$sel:type':HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsKeyProviderType
$sel:staticKeyProvider:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe StaticKeyProvider
$sel:spekeKeyProvider:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe SpekeKeyProvider
$sel:offlineEncrypted:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsOfflineEncrypted
$sel:initializationVectorInManifest:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsInitializationVectorInManifest
$sel:encryptionMethod:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe HlsEncryptionType
$sel:constantInitializationVector:HlsEncryptionSettings' :: HlsEncryptionSettings -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"constantInitializationVector" 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
constantInitializationVector,
            (Key
"encryptionMethod" 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 HlsEncryptionType
encryptionMethod,
            (Key
"initializationVectorInManifest" 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 HlsInitializationVectorInManifest
initializationVectorInManifest,
            (Key
"offlineEncrypted" 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 HlsOfflineEncrypted
offlineEncrypted,
            (Key
"spekeKeyProvider" 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 SpekeKeyProvider
spekeKeyProvider,
            (Key
"staticKeyProvider" 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 StaticKeyProvider
staticKeyProvider,
            (Key
"type" 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 HlsKeyProviderType
type'
          ]
      )