{-# 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.NexGuardFileMarkerSettings
-- 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.NexGuardFileMarkerSettings 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.WatermarkingStrength
import qualified Amazonka.Prelude as Prelude

-- | For forensic video watermarking, MediaConvert supports Nagra NexGuard
-- File Marker watermarking. MediaConvert supports both PreRelease Content
-- (NGPR\/G2) and OTT Streaming workflows.
--
-- /See:/ 'newNexGuardFileMarkerSettings' smart constructor.
data NexGuardFileMarkerSettings = NexGuardFileMarkerSettings'
  { -- | Use the base64 license string that Nagra provides you. Enter it directly
    -- in your JSON job specification or in the console. Required when you
    -- include Nagra NexGuard File Marker watermarking
    -- (NexGuardWatermarkingSettings) in your job.
    NexGuardFileMarkerSettings -> Maybe Text
license :: Prelude.Maybe Prelude.Text,
    -- | Specify the payload ID that you want associated with this output. Valid
    -- values vary depending on your Nagra NexGuard forensic watermarking
    -- workflow. Required when you include Nagra NexGuard File Marker
    -- watermarking (NexGuardWatermarkingSettings) in your job. For PreRelease
    -- Content (NGPR\/G2), specify an integer from 1 through 4,194,303. You
    -- must generate a unique ID for each asset you watermark, and keep a
    -- record of which ID you have assigned to each asset. Neither Nagra nor
    -- MediaConvert keep track of the relationship between output files and
    -- your IDs. For OTT Streaming, create two adaptive bitrate (ABR) stacks
    -- for each asset. Do this by setting up two output groups. For one output
    -- group, set the value of Payload ID (payload) to 0 in every output. For
    -- the other output group, set Payload ID (payload) to 1 in every output.
    NexGuardFileMarkerSettings -> Maybe Natural
payload :: Prelude.Maybe Prelude.Natural,
    -- | Enter one of the watermarking preset strings that Nagra provides you.
    -- Required when you include Nagra NexGuard File Marker watermarking
    -- (NexGuardWatermarkingSettings) in your job.
    NexGuardFileMarkerSettings -> Maybe Text
preset :: Prelude.Maybe Prelude.Text,
    -- | Optional. Ignore this setting unless Nagra support directs you to
    -- specify a value. When you don\'t specify a value here, the Nagra
    -- NexGuard library uses its default value.
    NexGuardFileMarkerSettings -> Maybe WatermarkingStrength
strength :: Prelude.Maybe WatermarkingStrength
  }
  deriving (NexGuardFileMarkerSettings -> NexGuardFileMarkerSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NexGuardFileMarkerSettings -> NexGuardFileMarkerSettings -> Bool
$c/= :: NexGuardFileMarkerSettings -> NexGuardFileMarkerSettings -> Bool
== :: NexGuardFileMarkerSettings -> NexGuardFileMarkerSettings -> Bool
$c== :: NexGuardFileMarkerSettings -> NexGuardFileMarkerSettings -> Bool
Prelude.Eq, ReadPrec [NexGuardFileMarkerSettings]
ReadPrec NexGuardFileMarkerSettings
Int -> ReadS NexGuardFileMarkerSettings
ReadS [NexGuardFileMarkerSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NexGuardFileMarkerSettings]
$creadListPrec :: ReadPrec [NexGuardFileMarkerSettings]
readPrec :: ReadPrec NexGuardFileMarkerSettings
$creadPrec :: ReadPrec NexGuardFileMarkerSettings
readList :: ReadS [NexGuardFileMarkerSettings]
$creadList :: ReadS [NexGuardFileMarkerSettings]
readsPrec :: Int -> ReadS NexGuardFileMarkerSettings
$creadsPrec :: Int -> ReadS NexGuardFileMarkerSettings
Prelude.Read, Int -> NexGuardFileMarkerSettings -> ShowS
[NexGuardFileMarkerSettings] -> ShowS
NexGuardFileMarkerSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NexGuardFileMarkerSettings] -> ShowS
$cshowList :: [NexGuardFileMarkerSettings] -> ShowS
show :: NexGuardFileMarkerSettings -> String
$cshow :: NexGuardFileMarkerSettings -> String
showsPrec :: Int -> NexGuardFileMarkerSettings -> ShowS
$cshowsPrec :: Int -> NexGuardFileMarkerSettings -> ShowS
Prelude.Show, forall x.
Rep NexGuardFileMarkerSettings x -> NexGuardFileMarkerSettings
forall x.
NexGuardFileMarkerSettings -> Rep NexGuardFileMarkerSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NexGuardFileMarkerSettings x -> NexGuardFileMarkerSettings
$cfrom :: forall x.
NexGuardFileMarkerSettings -> Rep NexGuardFileMarkerSettings x
Prelude.Generic)

-- |
-- Create a value of 'NexGuardFileMarkerSettings' 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:
--
-- 'license', 'nexGuardFileMarkerSettings_license' - Use the base64 license string that Nagra provides you. Enter it directly
-- in your JSON job specification or in the console. Required when you
-- include Nagra NexGuard File Marker watermarking
-- (NexGuardWatermarkingSettings) in your job.
--
-- 'payload', 'nexGuardFileMarkerSettings_payload' - Specify the payload ID that you want associated with this output. Valid
-- values vary depending on your Nagra NexGuard forensic watermarking
-- workflow. Required when you include Nagra NexGuard File Marker
-- watermarking (NexGuardWatermarkingSettings) in your job. For PreRelease
-- Content (NGPR\/G2), specify an integer from 1 through 4,194,303. You
-- must generate a unique ID for each asset you watermark, and keep a
-- record of which ID you have assigned to each asset. Neither Nagra nor
-- MediaConvert keep track of the relationship between output files and
-- your IDs. For OTT Streaming, create two adaptive bitrate (ABR) stacks
-- for each asset. Do this by setting up two output groups. For one output
-- group, set the value of Payload ID (payload) to 0 in every output. For
-- the other output group, set Payload ID (payload) to 1 in every output.
--
-- 'preset', 'nexGuardFileMarkerSettings_preset' - Enter one of the watermarking preset strings that Nagra provides you.
-- Required when you include Nagra NexGuard File Marker watermarking
-- (NexGuardWatermarkingSettings) in your job.
--
-- 'strength', 'nexGuardFileMarkerSettings_strength' - Optional. Ignore this setting unless Nagra support directs you to
-- specify a value. When you don\'t specify a value here, the Nagra
-- NexGuard library uses its default value.
newNexGuardFileMarkerSettings ::
  NexGuardFileMarkerSettings
newNexGuardFileMarkerSettings :: NexGuardFileMarkerSettings
newNexGuardFileMarkerSettings =
  NexGuardFileMarkerSettings'
    { $sel:license:NexGuardFileMarkerSettings' :: Maybe Text
license =
        forall a. Maybe a
Prelude.Nothing,
      $sel:payload:NexGuardFileMarkerSettings' :: Maybe Natural
payload = forall a. Maybe a
Prelude.Nothing,
      $sel:preset:NexGuardFileMarkerSettings' :: Maybe Text
preset = forall a. Maybe a
Prelude.Nothing,
      $sel:strength:NexGuardFileMarkerSettings' :: Maybe WatermarkingStrength
strength = forall a. Maybe a
Prelude.Nothing
    }

-- | Use the base64 license string that Nagra provides you. Enter it directly
-- in your JSON job specification or in the console. Required when you
-- include Nagra NexGuard File Marker watermarking
-- (NexGuardWatermarkingSettings) in your job.
nexGuardFileMarkerSettings_license :: Lens.Lens' NexGuardFileMarkerSettings (Prelude.Maybe Prelude.Text)
nexGuardFileMarkerSettings_license :: Lens' NexGuardFileMarkerSettings (Maybe Text)
nexGuardFileMarkerSettings_license = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NexGuardFileMarkerSettings' {Maybe Text
license :: Maybe Text
$sel:license:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe Text
license} -> Maybe Text
license) (\s :: NexGuardFileMarkerSettings
s@NexGuardFileMarkerSettings' {} Maybe Text
a -> NexGuardFileMarkerSettings
s {$sel:license:NexGuardFileMarkerSettings' :: Maybe Text
license = Maybe Text
a} :: NexGuardFileMarkerSettings)

-- | Specify the payload ID that you want associated with this output. Valid
-- values vary depending on your Nagra NexGuard forensic watermarking
-- workflow. Required when you include Nagra NexGuard File Marker
-- watermarking (NexGuardWatermarkingSettings) in your job. For PreRelease
-- Content (NGPR\/G2), specify an integer from 1 through 4,194,303. You
-- must generate a unique ID for each asset you watermark, and keep a
-- record of which ID you have assigned to each asset. Neither Nagra nor
-- MediaConvert keep track of the relationship between output files and
-- your IDs. For OTT Streaming, create two adaptive bitrate (ABR) stacks
-- for each asset. Do this by setting up two output groups. For one output
-- group, set the value of Payload ID (payload) to 0 in every output. For
-- the other output group, set Payload ID (payload) to 1 in every output.
nexGuardFileMarkerSettings_payload :: Lens.Lens' NexGuardFileMarkerSettings (Prelude.Maybe Prelude.Natural)
nexGuardFileMarkerSettings_payload :: Lens' NexGuardFileMarkerSettings (Maybe Natural)
nexGuardFileMarkerSettings_payload = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NexGuardFileMarkerSettings' {Maybe Natural
payload :: Maybe Natural
$sel:payload:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe Natural
payload} -> Maybe Natural
payload) (\s :: NexGuardFileMarkerSettings
s@NexGuardFileMarkerSettings' {} Maybe Natural
a -> NexGuardFileMarkerSettings
s {$sel:payload:NexGuardFileMarkerSettings' :: Maybe Natural
payload = Maybe Natural
a} :: NexGuardFileMarkerSettings)

-- | Enter one of the watermarking preset strings that Nagra provides you.
-- Required when you include Nagra NexGuard File Marker watermarking
-- (NexGuardWatermarkingSettings) in your job.
nexGuardFileMarkerSettings_preset :: Lens.Lens' NexGuardFileMarkerSettings (Prelude.Maybe Prelude.Text)
nexGuardFileMarkerSettings_preset :: Lens' NexGuardFileMarkerSettings (Maybe Text)
nexGuardFileMarkerSettings_preset = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NexGuardFileMarkerSettings' {Maybe Text
preset :: Maybe Text
$sel:preset:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe Text
preset} -> Maybe Text
preset) (\s :: NexGuardFileMarkerSettings
s@NexGuardFileMarkerSettings' {} Maybe Text
a -> NexGuardFileMarkerSettings
s {$sel:preset:NexGuardFileMarkerSettings' :: Maybe Text
preset = Maybe Text
a} :: NexGuardFileMarkerSettings)

-- | Optional. Ignore this setting unless Nagra support directs you to
-- specify a value. When you don\'t specify a value here, the Nagra
-- NexGuard library uses its default value.
nexGuardFileMarkerSettings_strength :: Lens.Lens' NexGuardFileMarkerSettings (Prelude.Maybe WatermarkingStrength)
nexGuardFileMarkerSettings_strength :: Lens' NexGuardFileMarkerSettings (Maybe WatermarkingStrength)
nexGuardFileMarkerSettings_strength = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NexGuardFileMarkerSettings' {Maybe WatermarkingStrength
strength :: Maybe WatermarkingStrength
$sel:strength:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe WatermarkingStrength
strength} -> Maybe WatermarkingStrength
strength) (\s :: NexGuardFileMarkerSettings
s@NexGuardFileMarkerSettings' {} Maybe WatermarkingStrength
a -> NexGuardFileMarkerSettings
s {$sel:strength:NexGuardFileMarkerSettings' :: Maybe WatermarkingStrength
strength = Maybe WatermarkingStrength
a} :: NexGuardFileMarkerSettings)

instance Data.FromJSON NexGuardFileMarkerSettings where
  parseJSON :: Value -> Parser NexGuardFileMarkerSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"NexGuardFileMarkerSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe WatermarkingStrength
-> NexGuardFileMarkerSettings
NexGuardFileMarkerSettings'
            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
"license")
            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
"payload")
            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
"preset")
            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
"strength")
      )

instance Prelude.Hashable NexGuardFileMarkerSettings where
  hashWithSalt :: Int -> NexGuardFileMarkerSettings -> Int
hashWithSalt Int
_salt NexGuardFileMarkerSettings' {Maybe Natural
Maybe Text
Maybe WatermarkingStrength
strength :: Maybe WatermarkingStrength
preset :: Maybe Text
payload :: Maybe Natural
license :: Maybe Text
$sel:strength:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe WatermarkingStrength
$sel:preset:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe Text
$sel:payload:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe Natural
$sel:license:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
license
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
payload
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
preset
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WatermarkingStrength
strength

instance Prelude.NFData NexGuardFileMarkerSettings where
  rnf :: NexGuardFileMarkerSettings -> ()
rnf NexGuardFileMarkerSettings' {Maybe Natural
Maybe Text
Maybe WatermarkingStrength
strength :: Maybe WatermarkingStrength
preset :: Maybe Text
payload :: Maybe Natural
license :: Maybe Text
$sel:strength:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe WatermarkingStrength
$sel:preset:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe Text
$sel:payload:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe Natural
$sel:license:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
license
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
payload
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
preset
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WatermarkingStrength
strength

instance Data.ToJSON NexGuardFileMarkerSettings where
  toJSON :: NexGuardFileMarkerSettings -> Value
toJSON NexGuardFileMarkerSettings' {Maybe Natural
Maybe Text
Maybe WatermarkingStrength
strength :: Maybe WatermarkingStrength
preset :: Maybe Text
payload :: Maybe Natural
license :: Maybe Text
$sel:strength:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe WatermarkingStrength
$sel:preset:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe Text
$sel:payload:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe Natural
$sel:license:NexGuardFileMarkerSettings' :: NexGuardFileMarkerSettings -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"license" 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
license,
            (Key
"payload" 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 Natural
payload,
            (Key
"preset" 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
preset,
            (Key
"strength" 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 WatermarkingStrength
strength
          ]
      )