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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | 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,
    -- | 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,
    -- | 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
  }
  deriving (NexGuardFileMarkerSettings -> NexGuardFileMarkerSettings -> Bool
(NexGuardFileMarkerSettings -> NexGuardFileMarkerSettings -> Bool)
-> (NexGuardFileMarkerSettings
    -> NexGuardFileMarkerSettings -> Bool)
-> Eq NexGuardFileMarkerSettings
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]
(Int -> ReadS NexGuardFileMarkerSettings)
-> ReadS [NexGuardFileMarkerSettings]
-> ReadPrec NexGuardFileMarkerSettings
-> ReadPrec [NexGuardFileMarkerSettings]
-> Read 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
(Int -> NexGuardFileMarkerSettings -> ShowS)
-> (NexGuardFileMarkerSettings -> String)
-> ([NexGuardFileMarkerSettings] -> ShowS)
-> Show NexGuardFileMarkerSettings
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.
 NexGuardFileMarkerSettings -> Rep NexGuardFileMarkerSettings x)
-> (forall x.
    Rep NexGuardFileMarkerSettings x -> NexGuardFileMarkerSettings)
-> Generic NexGuardFileMarkerSettings
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:
--
-- '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.
--
-- '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.
--
-- '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.
newNexGuardFileMarkerSettings ::
  NexGuardFileMarkerSettings
newNexGuardFileMarkerSettings :: NexGuardFileMarkerSettings
newNexGuardFileMarkerSettings =
  NexGuardFileMarkerSettings' :: Maybe WatermarkingStrength
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> NexGuardFileMarkerSettings
NexGuardFileMarkerSettings'
    { $sel:strength:NexGuardFileMarkerSettings' :: Maybe WatermarkingStrength
strength =
        Maybe WatermarkingStrength
forall a. Maybe a
Prelude.Nothing,
      $sel:payload:NexGuardFileMarkerSettings' :: Maybe Natural
payload = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:preset:NexGuardFileMarkerSettings' :: Maybe Text
preset = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:license:NexGuardFileMarkerSettings' :: Maybe Text
license = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe WatermarkingStrength -> f (Maybe WatermarkingStrength))
-> NexGuardFileMarkerSettings -> f NexGuardFileMarkerSettings
nexGuardFileMarkerSettings_strength = (NexGuardFileMarkerSettings -> Maybe WatermarkingStrength)
-> (NexGuardFileMarkerSettings
    -> Maybe WatermarkingStrength -> NexGuardFileMarkerSettings)
-> Lens
     NexGuardFileMarkerSettings
     NexGuardFileMarkerSettings
     (Maybe WatermarkingStrength)
     (Maybe WatermarkingStrength)
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)

-- | 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 :: (Maybe Natural -> f (Maybe Natural))
-> NexGuardFileMarkerSettings -> f NexGuardFileMarkerSettings
nexGuardFileMarkerSettings_payload = (NexGuardFileMarkerSettings -> Maybe Natural)
-> (NexGuardFileMarkerSettings
    -> Maybe Natural -> NexGuardFileMarkerSettings)
-> Lens
     NexGuardFileMarkerSettings
     NexGuardFileMarkerSettings
     (Maybe Natural)
     (Maybe Natural)
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 :: (Maybe Text -> f (Maybe Text))
-> NexGuardFileMarkerSettings -> f NexGuardFileMarkerSettings
nexGuardFileMarkerSettings_preset = (NexGuardFileMarkerSettings -> Maybe Text)
-> (NexGuardFileMarkerSettings
    -> Maybe Text -> NexGuardFileMarkerSettings)
-> Lens
     NexGuardFileMarkerSettings
     NexGuardFileMarkerSettings
     (Maybe Text)
     (Maybe Text)
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)

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

instance Core.FromJSON NexGuardFileMarkerSettings where
  parseJSON :: Value -> Parser NexGuardFileMarkerSettings
parseJSON =
    String
-> (Object -> Parser NexGuardFileMarkerSettings)
-> Value
-> Parser NexGuardFileMarkerSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"NexGuardFileMarkerSettings"
      ( \Object
x ->
          Maybe WatermarkingStrength
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> NexGuardFileMarkerSettings
NexGuardFileMarkerSettings'
            (Maybe WatermarkingStrength
 -> Maybe Natural
 -> Maybe Text
 -> Maybe Text
 -> NexGuardFileMarkerSettings)
-> Parser (Maybe WatermarkingStrength)
-> Parser
     (Maybe Natural
      -> Maybe Text -> Maybe Text -> NexGuardFileMarkerSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe WatermarkingStrength)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"strength")
            Parser
  (Maybe Natural
   -> Maybe Text -> Maybe Text -> NexGuardFileMarkerSettings)
-> Parser (Maybe Natural)
-> Parser (Maybe Text -> Maybe Text -> NexGuardFileMarkerSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"payload")
            Parser (Maybe Text -> Maybe Text -> NexGuardFileMarkerSettings)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> NexGuardFileMarkerSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"preset")
            Parser (Maybe Text -> NexGuardFileMarkerSettings)
-> Parser (Maybe Text) -> Parser NexGuardFileMarkerSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"license")
      )

instance Prelude.Hashable NexGuardFileMarkerSettings

instance Prelude.NFData NexGuardFileMarkerSettings

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