{-# 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.NielsenWatermarksSettings
-- 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.NielsenWatermarksSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.NielsenCBET
import Amazonka.MediaLive.Types.NielsenNaesIiNw
import Amazonka.MediaLive.Types.NielsenWatermarksDistributionTypes
import qualified Amazonka.Prelude as Prelude

-- | Nielsen Watermarks Settings
--
-- /See:/ 'newNielsenWatermarksSettings' smart constructor.
data NielsenWatermarksSettings = NielsenWatermarksSettings'
  { -- | Complete these fields only if you want to insert watermarks of type
    -- Nielsen CBET
    NielsenWatermarksSettings -> Maybe NielsenCBET
nielsenCbetSettings :: Prelude.Maybe NielsenCBET,
    -- | Complete these fields only if you want to insert watermarks of type
    -- Nielsen NAES II (N2) and Nielsen NAES VI (NW).
    NielsenWatermarksSettings -> Maybe NielsenNaesIiNw
nielsenNaesIiNwSettings :: Prelude.Maybe NielsenNaesIiNw,
    -- | Choose the distribution types that you want to assign to the watermarks:
    -- - PROGRAM_CONTENT - FINAL_DISTRIBUTOR
    NielsenWatermarksSettings
-> Maybe NielsenWatermarksDistributionTypes
nielsenDistributionType :: Prelude.Maybe NielsenWatermarksDistributionTypes
  }
  deriving (NielsenWatermarksSettings -> NielsenWatermarksSettings -> Bool
(NielsenWatermarksSettings -> NielsenWatermarksSettings -> Bool)
-> (NielsenWatermarksSettings -> NielsenWatermarksSettings -> Bool)
-> Eq NielsenWatermarksSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NielsenWatermarksSettings -> NielsenWatermarksSettings -> Bool
$c/= :: NielsenWatermarksSettings -> NielsenWatermarksSettings -> Bool
== :: NielsenWatermarksSettings -> NielsenWatermarksSettings -> Bool
$c== :: NielsenWatermarksSettings -> NielsenWatermarksSettings -> Bool
Prelude.Eq, ReadPrec [NielsenWatermarksSettings]
ReadPrec NielsenWatermarksSettings
Int -> ReadS NielsenWatermarksSettings
ReadS [NielsenWatermarksSettings]
(Int -> ReadS NielsenWatermarksSettings)
-> ReadS [NielsenWatermarksSettings]
-> ReadPrec NielsenWatermarksSettings
-> ReadPrec [NielsenWatermarksSettings]
-> Read NielsenWatermarksSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NielsenWatermarksSettings]
$creadListPrec :: ReadPrec [NielsenWatermarksSettings]
readPrec :: ReadPrec NielsenWatermarksSettings
$creadPrec :: ReadPrec NielsenWatermarksSettings
readList :: ReadS [NielsenWatermarksSettings]
$creadList :: ReadS [NielsenWatermarksSettings]
readsPrec :: Int -> ReadS NielsenWatermarksSettings
$creadsPrec :: Int -> ReadS NielsenWatermarksSettings
Prelude.Read, Int -> NielsenWatermarksSettings -> ShowS
[NielsenWatermarksSettings] -> ShowS
NielsenWatermarksSettings -> String
(Int -> NielsenWatermarksSettings -> ShowS)
-> (NielsenWatermarksSettings -> String)
-> ([NielsenWatermarksSettings] -> ShowS)
-> Show NielsenWatermarksSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NielsenWatermarksSettings] -> ShowS
$cshowList :: [NielsenWatermarksSettings] -> ShowS
show :: NielsenWatermarksSettings -> String
$cshow :: NielsenWatermarksSettings -> String
showsPrec :: Int -> NielsenWatermarksSettings -> ShowS
$cshowsPrec :: Int -> NielsenWatermarksSettings -> ShowS
Prelude.Show, (forall x.
 NielsenWatermarksSettings -> Rep NielsenWatermarksSettings x)
-> (forall x.
    Rep NielsenWatermarksSettings x -> NielsenWatermarksSettings)
-> Generic NielsenWatermarksSettings
forall x.
Rep NielsenWatermarksSettings x -> NielsenWatermarksSettings
forall x.
NielsenWatermarksSettings -> Rep NielsenWatermarksSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NielsenWatermarksSettings x -> NielsenWatermarksSettings
$cfrom :: forall x.
NielsenWatermarksSettings -> Rep NielsenWatermarksSettings x
Prelude.Generic)

-- |
-- Create a value of 'NielsenWatermarksSettings' 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:
--
-- 'nielsenCbetSettings', 'nielsenWatermarksSettings_nielsenCbetSettings' - Complete these fields only if you want to insert watermarks of type
-- Nielsen CBET
--
-- 'nielsenNaesIiNwSettings', 'nielsenWatermarksSettings_nielsenNaesIiNwSettings' - Complete these fields only if you want to insert watermarks of type
-- Nielsen NAES II (N2) and Nielsen NAES VI (NW).
--
-- 'nielsenDistributionType', 'nielsenWatermarksSettings_nielsenDistributionType' - Choose the distribution types that you want to assign to the watermarks:
-- - PROGRAM_CONTENT - FINAL_DISTRIBUTOR
newNielsenWatermarksSettings ::
  NielsenWatermarksSettings
newNielsenWatermarksSettings :: NielsenWatermarksSettings
newNielsenWatermarksSettings =
  NielsenWatermarksSettings' :: Maybe NielsenCBET
-> Maybe NielsenNaesIiNw
-> Maybe NielsenWatermarksDistributionTypes
-> NielsenWatermarksSettings
NielsenWatermarksSettings'
    { $sel:nielsenCbetSettings:NielsenWatermarksSettings' :: Maybe NielsenCBET
nielsenCbetSettings =
        Maybe NielsenCBET
forall a. Maybe a
Prelude.Nothing,
      $sel:nielsenNaesIiNwSettings:NielsenWatermarksSettings' :: Maybe NielsenNaesIiNw
nielsenNaesIiNwSettings = Maybe NielsenNaesIiNw
forall a. Maybe a
Prelude.Nothing,
      $sel:nielsenDistributionType:NielsenWatermarksSettings' :: Maybe NielsenWatermarksDistributionTypes
nielsenDistributionType = Maybe NielsenWatermarksDistributionTypes
forall a. Maybe a
Prelude.Nothing
    }

-- | Complete these fields only if you want to insert watermarks of type
-- Nielsen CBET
nielsenWatermarksSettings_nielsenCbetSettings :: Lens.Lens' NielsenWatermarksSettings (Prelude.Maybe NielsenCBET)
nielsenWatermarksSettings_nielsenCbetSettings :: (Maybe NielsenCBET -> f (Maybe NielsenCBET))
-> NielsenWatermarksSettings -> f NielsenWatermarksSettings
nielsenWatermarksSettings_nielsenCbetSettings = (NielsenWatermarksSettings -> Maybe NielsenCBET)
-> (NielsenWatermarksSettings
    -> Maybe NielsenCBET -> NielsenWatermarksSettings)
-> Lens
     NielsenWatermarksSettings
     NielsenWatermarksSettings
     (Maybe NielsenCBET)
     (Maybe NielsenCBET)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NielsenWatermarksSettings' {Maybe NielsenCBET
nielsenCbetSettings :: Maybe NielsenCBET
$sel:nielsenCbetSettings:NielsenWatermarksSettings' :: NielsenWatermarksSettings -> Maybe NielsenCBET
nielsenCbetSettings} -> Maybe NielsenCBET
nielsenCbetSettings) (\s :: NielsenWatermarksSettings
s@NielsenWatermarksSettings' {} Maybe NielsenCBET
a -> NielsenWatermarksSettings
s {$sel:nielsenCbetSettings:NielsenWatermarksSettings' :: Maybe NielsenCBET
nielsenCbetSettings = Maybe NielsenCBET
a} :: NielsenWatermarksSettings)

-- | Complete these fields only if you want to insert watermarks of type
-- Nielsen NAES II (N2) and Nielsen NAES VI (NW).
nielsenWatermarksSettings_nielsenNaesIiNwSettings :: Lens.Lens' NielsenWatermarksSettings (Prelude.Maybe NielsenNaesIiNw)
nielsenWatermarksSettings_nielsenNaesIiNwSettings :: (Maybe NielsenNaesIiNw -> f (Maybe NielsenNaesIiNw))
-> NielsenWatermarksSettings -> f NielsenWatermarksSettings
nielsenWatermarksSettings_nielsenNaesIiNwSettings = (NielsenWatermarksSettings -> Maybe NielsenNaesIiNw)
-> (NielsenWatermarksSettings
    -> Maybe NielsenNaesIiNw -> NielsenWatermarksSettings)
-> Lens
     NielsenWatermarksSettings
     NielsenWatermarksSettings
     (Maybe NielsenNaesIiNw)
     (Maybe NielsenNaesIiNw)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NielsenWatermarksSettings' {Maybe NielsenNaesIiNw
nielsenNaesIiNwSettings :: Maybe NielsenNaesIiNw
$sel:nielsenNaesIiNwSettings:NielsenWatermarksSettings' :: NielsenWatermarksSettings -> Maybe NielsenNaesIiNw
nielsenNaesIiNwSettings} -> Maybe NielsenNaesIiNw
nielsenNaesIiNwSettings) (\s :: NielsenWatermarksSettings
s@NielsenWatermarksSettings' {} Maybe NielsenNaesIiNw
a -> NielsenWatermarksSettings
s {$sel:nielsenNaesIiNwSettings:NielsenWatermarksSettings' :: Maybe NielsenNaesIiNw
nielsenNaesIiNwSettings = Maybe NielsenNaesIiNw
a} :: NielsenWatermarksSettings)

-- | Choose the distribution types that you want to assign to the watermarks:
-- - PROGRAM_CONTENT - FINAL_DISTRIBUTOR
nielsenWatermarksSettings_nielsenDistributionType :: Lens.Lens' NielsenWatermarksSettings (Prelude.Maybe NielsenWatermarksDistributionTypes)
nielsenWatermarksSettings_nielsenDistributionType :: (Maybe NielsenWatermarksDistributionTypes
 -> f (Maybe NielsenWatermarksDistributionTypes))
-> NielsenWatermarksSettings -> f NielsenWatermarksSettings
nielsenWatermarksSettings_nielsenDistributionType = (NielsenWatermarksSettings
 -> Maybe NielsenWatermarksDistributionTypes)
-> (NielsenWatermarksSettings
    -> Maybe NielsenWatermarksDistributionTypes
    -> NielsenWatermarksSettings)
-> Lens
     NielsenWatermarksSettings
     NielsenWatermarksSettings
     (Maybe NielsenWatermarksDistributionTypes)
     (Maybe NielsenWatermarksDistributionTypes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NielsenWatermarksSettings' {Maybe NielsenWatermarksDistributionTypes
nielsenDistributionType :: Maybe NielsenWatermarksDistributionTypes
$sel:nielsenDistributionType:NielsenWatermarksSettings' :: NielsenWatermarksSettings
-> Maybe NielsenWatermarksDistributionTypes
nielsenDistributionType} -> Maybe NielsenWatermarksDistributionTypes
nielsenDistributionType) (\s :: NielsenWatermarksSettings
s@NielsenWatermarksSettings' {} Maybe NielsenWatermarksDistributionTypes
a -> NielsenWatermarksSettings
s {$sel:nielsenDistributionType:NielsenWatermarksSettings' :: Maybe NielsenWatermarksDistributionTypes
nielsenDistributionType = Maybe NielsenWatermarksDistributionTypes
a} :: NielsenWatermarksSettings)

instance Core.FromJSON NielsenWatermarksSettings where
  parseJSON :: Value -> Parser NielsenWatermarksSettings
parseJSON =
    String
-> (Object -> Parser NielsenWatermarksSettings)
-> Value
-> Parser NielsenWatermarksSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"NielsenWatermarksSettings"
      ( \Object
x ->
          Maybe NielsenCBET
-> Maybe NielsenNaesIiNw
-> Maybe NielsenWatermarksDistributionTypes
-> NielsenWatermarksSettings
NielsenWatermarksSettings'
            (Maybe NielsenCBET
 -> Maybe NielsenNaesIiNw
 -> Maybe NielsenWatermarksDistributionTypes
 -> NielsenWatermarksSettings)
-> Parser (Maybe NielsenCBET)
-> Parser
     (Maybe NielsenNaesIiNw
      -> Maybe NielsenWatermarksDistributionTypes
      -> NielsenWatermarksSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe NielsenCBET)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"nielsenCbetSettings")
            Parser
  (Maybe NielsenNaesIiNw
   -> Maybe NielsenWatermarksDistributionTypes
   -> NielsenWatermarksSettings)
-> Parser (Maybe NielsenNaesIiNw)
-> Parser
     (Maybe NielsenWatermarksDistributionTypes
      -> NielsenWatermarksSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NielsenNaesIiNw)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"nielsenNaesIiNwSettings")
            Parser
  (Maybe NielsenWatermarksDistributionTypes
   -> NielsenWatermarksSettings)
-> Parser (Maybe NielsenWatermarksDistributionTypes)
-> Parser NielsenWatermarksSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NielsenWatermarksDistributionTypes)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"nielsenDistributionType")
      )

instance Prelude.Hashable NielsenWatermarksSettings

instance Prelude.NFData NielsenWatermarksSettings

instance Core.ToJSON NielsenWatermarksSettings where
  toJSON :: NielsenWatermarksSettings -> Value
toJSON NielsenWatermarksSettings' {Maybe NielsenNaesIiNw
Maybe NielsenCBET
Maybe NielsenWatermarksDistributionTypes
nielsenDistributionType :: Maybe NielsenWatermarksDistributionTypes
nielsenNaesIiNwSettings :: Maybe NielsenNaesIiNw
nielsenCbetSettings :: Maybe NielsenCBET
$sel:nielsenDistributionType:NielsenWatermarksSettings' :: NielsenWatermarksSettings
-> Maybe NielsenWatermarksDistributionTypes
$sel:nielsenNaesIiNwSettings:NielsenWatermarksSettings' :: NielsenWatermarksSettings -> Maybe NielsenNaesIiNw
$sel:nielsenCbetSettings:NielsenWatermarksSettings' :: NielsenWatermarksSettings -> Maybe NielsenCBET
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"nielsenCbetSettings" Text -> NielsenCBET -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NielsenCBET -> Pair) -> Maybe NielsenCBET -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NielsenCBET
nielsenCbetSettings,
            (Text
"nielsenNaesIiNwSettings" Text -> NielsenNaesIiNw -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NielsenNaesIiNw -> Pair) -> Maybe NielsenNaesIiNw -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NielsenNaesIiNw
nielsenNaesIiNwSettings,
            (Text
"nielsenDistributionType" Text -> NielsenWatermarksDistributionTypes -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NielsenWatermarksDistributionTypes -> Pair)
-> Maybe NielsenWatermarksDistributionTypes -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NielsenWatermarksDistributionTypes
nielsenDistributionType
          ]
      )