{-# 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.CmafEncryptionSettings
-- 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.CmafEncryptionSettings 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.CmafEncryptionType
import Amazonka.MediaConvert.Types.CmafInitializationVectorInManifest
import Amazonka.MediaConvert.Types.CmafKeyProviderType
import Amazonka.MediaConvert.Types.SpekeKeyProviderCmaf
import Amazonka.MediaConvert.Types.StaticKeyProvider
import qualified Amazonka.Prelude as Prelude

-- | Settings for CMAF encryption
--
-- /See:/ 'newCmafEncryptionSettings' smart constructor.
data CmafEncryptionSettings = CmafEncryptionSettings'
  { -- | 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.
    CmafEncryptionSettings -> Maybe Text
constantInitializationVector :: Prelude.Maybe Prelude.Text,
    -- | Specify the encryption scheme that you want the service to use when
    -- encrypting your CMAF segments. Choose AES-CBC subsample (SAMPLE-AES) or
    -- AES_CTR (AES-CTR).
    CmafEncryptionSettings -> Maybe CmafEncryptionType
encryptionMethod :: Prelude.Maybe CmafEncryptionType,
    -- | When you use DRM with CMAF outputs, choose whether the service writes
    -- the 128-bit encryption initialization vector in the HLS and DASH
    -- manifests.
    CmafEncryptionSettings -> Maybe CmafInitializationVectorInManifest
initializationVectorInManifest :: Prelude.Maybe CmafInitializationVectorInManifest,
    -- | If your output group type is CMAF, use these settings when doing DRM
    -- encryption with a SPEKE-compliant key provider. If your output group
    -- type is HLS, DASH, or Microsoft Smooth, use the SpekeKeyProvider
    -- settings instead.
    CmafEncryptionSettings -> Maybe SpekeKeyProviderCmaf
spekeKeyProvider :: Prelude.Maybe SpekeKeyProviderCmaf,
    -- | Use these settings to set up encryption with a static key provider.
    CmafEncryptionSettings -> 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.
    CmafEncryptionSettings -> Maybe CmafKeyProviderType
type' :: Prelude.Maybe CmafKeyProviderType
  }
  deriving (CmafEncryptionSettings -> CmafEncryptionSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CmafEncryptionSettings -> CmafEncryptionSettings -> Bool
$c/= :: CmafEncryptionSettings -> CmafEncryptionSettings -> Bool
== :: CmafEncryptionSettings -> CmafEncryptionSettings -> Bool
$c== :: CmafEncryptionSettings -> CmafEncryptionSettings -> Bool
Prelude.Eq, ReadPrec [CmafEncryptionSettings]
ReadPrec CmafEncryptionSettings
Int -> ReadS CmafEncryptionSettings
ReadS [CmafEncryptionSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CmafEncryptionSettings]
$creadListPrec :: ReadPrec [CmafEncryptionSettings]
readPrec :: ReadPrec CmafEncryptionSettings
$creadPrec :: ReadPrec CmafEncryptionSettings
readList :: ReadS [CmafEncryptionSettings]
$creadList :: ReadS [CmafEncryptionSettings]
readsPrec :: Int -> ReadS CmafEncryptionSettings
$creadsPrec :: Int -> ReadS CmafEncryptionSettings
Prelude.Read, Int -> CmafEncryptionSettings -> ShowS
[CmafEncryptionSettings] -> ShowS
CmafEncryptionSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CmafEncryptionSettings] -> ShowS
$cshowList :: [CmafEncryptionSettings] -> ShowS
show :: CmafEncryptionSettings -> String
$cshow :: CmafEncryptionSettings -> String
showsPrec :: Int -> CmafEncryptionSettings -> ShowS
$cshowsPrec :: Int -> CmafEncryptionSettings -> ShowS
Prelude.Show, forall x. Rep CmafEncryptionSettings x -> CmafEncryptionSettings
forall x. CmafEncryptionSettings -> Rep CmafEncryptionSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CmafEncryptionSettings x -> CmafEncryptionSettings
$cfrom :: forall x. CmafEncryptionSettings -> Rep CmafEncryptionSettings x
Prelude.Generic)

-- |
-- Create a value of 'CmafEncryptionSettings' 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', 'cmafEncryptionSettings_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', 'cmafEncryptionSettings_encryptionMethod' - Specify the encryption scheme that you want the service to use when
-- encrypting your CMAF segments. Choose AES-CBC subsample (SAMPLE-AES) or
-- AES_CTR (AES-CTR).
--
-- 'initializationVectorInManifest', 'cmafEncryptionSettings_initializationVectorInManifest' - When you use DRM with CMAF outputs, choose whether the service writes
-- the 128-bit encryption initialization vector in the HLS and DASH
-- manifests.
--
-- 'spekeKeyProvider', 'cmafEncryptionSettings_spekeKeyProvider' - If your output group type is CMAF, use these settings when doing DRM
-- encryption with a SPEKE-compliant key provider. If your output group
-- type is HLS, DASH, or Microsoft Smooth, use the SpekeKeyProvider
-- settings instead.
--
-- 'staticKeyProvider', 'cmafEncryptionSettings_staticKeyProvider' - Use these settings to set up encryption with a static key provider.
--
-- 'type'', 'cmafEncryptionSettings_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.
newCmafEncryptionSettings ::
  CmafEncryptionSettings
newCmafEncryptionSettings :: CmafEncryptionSettings
newCmafEncryptionSettings =
  CmafEncryptionSettings'
    { $sel:constantInitializationVector:CmafEncryptionSettings' :: Maybe Text
constantInitializationVector =
        forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionMethod:CmafEncryptionSettings' :: Maybe CmafEncryptionType
encryptionMethod = forall a. Maybe a
Prelude.Nothing,
      $sel:initializationVectorInManifest:CmafEncryptionSettings' :: Maybe CmafInitializationVectorInManifest
initializationVectorInManifest = forall a. Maybe a
Prelude.Nothing,
      $sel:spekeKeyProvider:CmafEncryptionSettings' :: Maybe SpekeKeyProviderCmaf
spekeKeyProvider = forall a. Maybe a
Prelude.Nothing,
      $sel:staticKeyProvider:CmafEncryptionSettings' :: Maybe StaticKeyProvider
staticKeyProvider = forall a. Maybe a
Prelude.Nothing,
      $sel:type':CmafEncryptionSettings' :: Maybe CmafKeyProviderType
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.
cmafEncryptionSettings_constantInitializationVector :: Lens.Lens' CmafEncryptionSettings (Prelude.Maybe Prelude.Text)
cmafEncryptionSettings_constantInitializationVector :: Lens' CmafEncryptionSettings (Maybe Text)
cmafEncryptionSettings_constantInitializationVector = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafEncryptionSettings' {Maybe Text
constantInitializationVector :: Maybe Text
$sel:constantInitializationVector:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe Text
constantInitializationVector} -> Maybe Text
constantInitializationVector) (\s :: CmafEncryptionSettings
s@CmafEncryptionSettings' {} Maybe Text
a -> CmafEncryptionSettings
s {$sel:constantInitializationVector:CmafEncryptionSettings' :: Maybe Text
constantInitializationVector = Maybe Text
a} :: CmafEncryptionSettings)

-- | Specify the encryption scheme that you want the service to use when
-- encrypting your CMAF segments. Choose AES-CBC subsample (SAMPLE-AES) or
-- AES_CTR (AES-CTR).
cmafEncryptionSettings_encryptionMethod :: Lens.Lens' CmafEncryptionSettings (Prelude.Maybe CmafEncryptionType)
cmafEncryptionSettings_encryptionMethod :: Lens' CmafEncryptionSettings (Maybe CmafEncryptionType)
cmafEncryptionSettings_encryptionMethod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafEncryptionSettings' {Maybe CmafEncryptionType
encryptionMethod :: Maybe CmafEncryptionType
$sel:encryptionMethod:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafEncryptionType
encryptionMethod} -> Maybe CmafEncryptionType
encryptionMethod) (\s :: CmafEncryptionSettings
s@CmafEncryptionSettings' {} Maybe CmafEncryptionType
a -> CmafEncryptionSettings
s {$sel:encryptionMethod:CmafEncryptionSettings' :: Maybe CmafEncryptionType
encryptionMethod = Maybe CmafEncryptionType
a} :: CmafEncryptionSettings)

-- | When you use DRM with CMAF outputs, choose whether the service writes
-- the 128-bit encryption initialization vector in the HLS and DASH
-- manifests.
cmafEncryptionSettings_initializationVectorInManifest :: Lens.Lens' CmafEncryptionSettings (Prelude.Maybe CmafInitializationVectorInManifest)
cmafEncryptionSettings_initializationVectorInManifest :: Lens'
  CmafEncryptionSettings (Maybe CmafInitializationVectorInManifest)
cmafEncryptionSettings_initializationVectorInManifest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafEncryptionSettings' {Maybe CmafInitializationVectorInManifest
initializationVectorInManifest :: Maybe CmafInitializationVectorInManifest
$sel:initializationVectorInManifest:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafInitializationVectorInManifest
initializationVectorInManifest} -> Maybe CmafInitializationVectorInManifest
initializationVectorInManifest) (\s :: CmafEncryptionSettings
s@CmafEncryptionSettings' {} Maybe CmafInitializationVectorInManifest
a -> CmafEncryptionSettings
s {$sel:initializationVectorInManifest:CmafEncryptionSettings' :: Maybe CmafInitializationVectorInManifest
initializationVectorInManifest = Maybe CmafInitializationVectorInManifest
a} :: CmafEncryptionSettings)

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

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

-- | 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.
cmafEncryptionSettings_type :: Lens.Lens' CmafEncryptionSettings (Prelude.Maybe CmafKeyProviderType)
cmafEncryptionSettings_type :: Lens' CmafEncryptionSettings (Maybe CmafKeyProviderType)
cmafEncryptionSettings_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CmafEncryptionSettings' {Maybe CmafKeyProviderType
type' :: Maybe CmafKeyProviderType
$sel:type':CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafKeyProviderType
type'} -> Maybe CmafKeyProviderType
type') (\s :: CmafEncryptionSettings
s@CmafEncryptionSettings' {} Maybe CmafKeyProviderType
a -> CmafEncryptionSettings
s {$sel:type':CmafEncryptionSettings' :: Maybe CmafKeyProviderType
type' = Maybe CmafKeyProviderType
a} :: CmafEncryptionSettings)

instance Data.FromJSON CmafEncryptionSettings where
  parseJSON :: Value -> Parser CmafEncryptionSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CmafEncryptionSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe CmafEncryptionType
-> Maybe CmafInitializationVectorInManifest
-> Maybe SpekeKeyProviderCmaf
-> Maybe StaticKeyProvider
-> Maybe CmafKeyProviderType
-> CmafEncryptionSettings
CmafEncryptionSettings'
            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
"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 CmafEncryptionSettings where
  hashWithSalt :: Int -> CmafEncryptionSettings -> Int
hashWithSalt Int
_salt CmafEncryptionSettings' {Maybe Text
Maybe CmafEncryptionType
Maybe CmafInitializationVectorInManifest
Maybe CmafKeyProviderType
Maybe SpekeKeyProviderCmaf
Maybe StaticKeyProvider
type' :: Maybe CmafKeyProviderType
staticKeyProvider :: Maybe StaticKeyProvider
spekeKeyProvider :: Maybe SpekeKeyProviderCmaf
initializationVectorInManifest :: Maybe CmafInitializationVectorInManifest
encryptionMethod :: Maybe CmafEncryptionType
constantInitializationVector :: Maybe Text
$sel:type':CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafKeyProviderType
$sel:staticKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe StaticKeyProvider
$sel:spekeKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe SpekeKeyProviderCmaf
$sel:initializationVectorInManifest:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafInitializationVectorInManifest
$sel:encryptionMethod:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafEncryptionType
$sel:constantInitializationVector:CmafEncryptionSettings' :: CmafEncryptionSettings -> 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 CmafEncryptionType
encryptionMethod
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CmafInitializationVectorInManifest
initializationVectorInManifest
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SpekeKeyProviderCmaf
spekeKeyProvider
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StaticKeyProvider
staticKeyProvider
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CmafKeyProviderType
type'

instance Prelude.NFData CmafEncryptionSettings where
  rnf :: CmafEncryptionSettings -> ()
rnf CmafEncryptionSettings' {Maybe Text
Maybe CmafEncryptionType
Maybe CmafInitializationVectorInManifest
Maybe CmafKeyProviderType
Maybe SpekeKeyProviderCmaf
Maybe StaticKeyProvider
type' :: Maybe CmafKeyProviderType
staticKeyProvider :: Maybe StaticKeyProvider
spekeKeyProvider :: Maybe SpekeKeyProviderCmaf
initializationVectorInManifest :: Maybe CmafInitializationVectorInManifest
encryptionMethod :: Maybe CmafEncryptionType
constantInitializationVector :: Maybe Text
$sel:type':CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafKeyProviderType
$sel:staticKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe StaticKeyProvider
$sel:spekeKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe SpekeKeyProviderCmaf
$sel:initializationVectorInManifest:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafInitializationVectorInManifest
$sel:encryptionMethod:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafEncryptionType
$sel:constantInitializationVector:CmafEncryptionSettings' :: CmafEncryptionSettings -> 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 CmafEncryptionType
encryptionMethod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CmafInitializationVectorInManifest
initializationVectorInManifest
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SpekeKeyProviderCmaf
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 CmafKeyProviderType
type'

instance Data.ToJSON CmafEncryptionSettings where
  toJSON :: CmafEncryptionSettings -> Value
toJSON CmafEncryptionSettings' {Maybe Text
Maybe CmafEncryptionType
Maybe CmafInitializationVectorInManifest
Maybe CmafKeyProviderType
Maybe SpekeKeyProviderCmaf
Maybe StaticKeyProvider
type' :: Maybe CmafKeyProviderType
staticKeyProvider :: Maybe StaticKeyProvider
spekeKeyProvider :: Maybe SpekeKeyProviderCmaf
initializationVectorInManifest :: Maybe CmafInitializationVectorInManifest
encryptionMethod :: Maybe CmafEncryptionType
constantInitializationVector :: Maybe Text
$sel:type':CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafKeyProviderType
$sel:staticKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe StaticKeyProvider
$sel:spekeKeyProvider:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe SpekeKeyProviderCmaf
$sel:initializationVectorInManifest:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafInitializationVectorInManifest
$sel:encryptionMethod:CmafEncryptionSettings' :: CmafEncryptionSettings -> Maybe CmafEncryptionType
$sel:constantInitializationVector:CmafEncryptionSettings' :: CmafEncryptionSettings -> 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 CmafEncryptionType
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 CmafInitializationVectorInManifest
initializationVectorInManifest,
            (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 SpekeKeyProviderCmaf
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 CmafKeyProviderType
type'
          ]
      )