{-# 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.AudioWatermarkSettings
-- 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.MediaLive.Types.AudioWatermarkSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.NielsenWatermarksSettings
import qualified Amazonka.Prelude as Prelude

-- | Audio Watermark Settings
--
-- /See:/ 'newAudioWatermarkSettings' smart constructor.
data AudioWatermarkSettings = AudioWatermarkSettings'
  { -- | Settings to configure Nielsen Watermarks in the audio encode
    AudioWatermarkSettings -> Maybe NielsenWatermarksSettings
nielsenWatermarksSettings :: Prelude.Maybe NielsenWatermarksSettings
  }
  deriving (AudioWatermarkSettings -> AudioWatermarkSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AudioWatermarkSettings -> AudioWatermarkSettings -> Bool
$c/= :: AudioWatermarkSettings -> AudioWatermarkSettings -> Bool
== :: AudioWatermarkSettings -> AudioWatermarkSettings -> Bool
$c== :: AudioWatermarkSettings -> AudioWatermarkSettings -> Bool
Prelude.Eq, ReadPrec [AudioWatermarkSettings]
ReadPrec AudioWatermarkSettings
Int -> ReadS AudioWatermarkSettings
ReadS [AudioWatermarkSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AudioWatermarkSettings]
$creadListPrec :: ReadPrec [AudioWatermarkSettings]
readPrec :: ReadPrec AudioWatermarkSettings
$creadPrec :: ReadPrec AudioWatermarkSettings
readList :: ReadS [AudioWatermarkSettings]
$creadList :: ReadS [AudioWatermarkSettings]
readsPrec :: Int -> ReadS AudioWatermarkSettings
$creadsPrec :: Int -> ReadS AudioWatermarkSettings
Prelude.Read, Int -> AudioWatermarkSettings -> ShowS
[AudioWatermarkSettings] -> ShowS
AudioWatermarkSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AudioWatermarkSettings] -> ShowS
$cshowList :: [AudioWatermarkSettings] -> ShowS
show :: AudioWatermarkSettings -> String
$cshow :: AudioWatermarkSettings -> String
showsPrec :: Int -> AudioWatermarkSettings -> ShowS
$cshowsPrec :: Int -> AudioWatermarkSettings -> ShowS
Prelude.Show, forall x. Rep AudioWatermarkSettings x -> AudioWatermarkSettings
forall x. AudioWatermarkSettings -> Rep AudioWatermarkSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AudioWatermarkSettings x -> AudioWatermarkSettings
$cfrom :: forall x. AudioWatermarkSettings -> Rep AudioWatermarkSettings x
Prelude.Generic)

-- |
-- Create a value of 'AudioWatermarkSettings' 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:
--
-- 'nielsenWatermarksSettings', 'audioWatermarkSettings_nielsenWatermarksSettings' - Settings to configure Nielsen Watermarks in the audio encode
newAudioWatermarkSettings ::
  AudioWatermarkSettings
newAudioWatermarkSettings :: AudioWatermarkSettings
newAudioWatermarkSettings =
  AudioWatermarkSettings'
    { $sel:nielsenWatermarksSettings:AudioWatermarkSettings' :: Maybe NielsenWatermarksSettings
nielsenWatermarksSettings =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Settings to configure Nielsen Watermarks in the audio encode
audioWatermarkSettings_nielsenWatermarksSettings :: Lens.Lens' AudioWatermarkSettings (Prelude.Maybe NielsenWatermarksSettings)
audioWatermarkSettings_nielsenWatermarksSettings :: Lens' AudioWatermarkSettings (Maybe NielsenWatermarksSettings)
audioWatermarkSettings_nielsenWatermarksSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioWatermarkSettings' {Maybe NielsenWatermarksSettings
nielsenWatermarksSettings :: Maybe NielsenWatermarksSettings
$sel:nielsenWatermarksSettings:AudioWatermarkSettings' :: AudioWatermarkSettings -> Maybe NielsenWatermarksSettings
nielsenWatermarksSettings} -> Maybe NielsenWatermarksSettings
nielsenWatermarksSettings) (\s :: AudioWatermarkSettings
s@AudioWatermarkSettings' {} Maybe NielsenWatermarksSettings
a -> AudioWatermarkSettings
s {$sel:nielsenWatermarksSettings:AudioWatermarkSettings' :: Maybe NielsenWatermarksSettings
nielsenWatermarksSettings = Maybe NielsenWatermarksSettings
a} :: AudioWatermarkSettings)

instance Data.FromJSON AudioWatermarkSettings where
  parseJSON :: Value -> Parser AudioWatermarkSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AudioWatermarkSettings"
      ( \Object
x ->
          Maybe NielsenWatermarksSettings -> AudioWatermarkSettings
AudioWatermarkSettings'
            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
"nielsenWatermarksSettings")
      )

instance Prelude.Hashable AudioWatermarkSettings where
  hashWithSalt :: Int -> AudioWatermarkSettings -> Int
hashWithSalt Int
_salt AudioWatermarkSettings' {Maybe NielsenWatermarksSettings
nielsenWatermarksSettings :: Maybe NielsenWatermarksSettings
$sel:nielsenWatermarksSettings:AudioWatermarkSettings' :: AudioWatermarkSettings -> Maybe NielsenWatermarksSettings
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NielsenWatermarksSettings
nielsenWatermarksSettings

instance Prelude.NFData AudioWatermarkSettings where
  rnf :: AudioWatermarkSettings -> ()
rnf AudioWatermarkSettings' {Maybe NielsenWatermarksSettings
nielsenWatermarksSettings :: Maybe NielsenWatermarksSettings
$sel:nielsenWatermarksSettings:AudioWatermarkSettings' :: AudioWatermarkSettings -> Maybe NielsenWatermarksSettings
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe NielsenWatermarksSettings
nielsenWatermarksSettings

instance Data.ToJSON AudioWatermarkSettings where
  toJSON :: AudioWatermarkSettings -> Value
toJSON AudioWatermarkSettings' {Maybe NielsenWatermarksSettings
nielsenWatermarksSettings :: Maybe NielsenWatermarksSettings
$sel:nielsenWatermarksSettings:AudioWatermarkSettings' :: AudioWatermarkSettings -> Maybe NielsenWatermarksSettings
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"nielsenWatermarksSettings" 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 NielsenWatermarksSettings
nielsenWatermarksSettings
          ]
      )