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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(AudioWatermarkSettings -> AudioWatermarkSettings -> Bool)
-> (AudioWatermarkSettings -> AudioWatermarkSettings -> Bool)
-> Eq AudioWatermarkSettings
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]
(Int -> ReadS AudioWatermarkSettings)
-> ReadS [AudioWatermarkSettings]
-> ReadPrec AudioWatermarkSettings
-> ReadPrec [AudioWatermarkSettings]
-> Read 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
(Int -> AudioWatermarkSettings -> ShowS)
-> (AudioWatermarkSettings -> String)
-> ([AudioWatermarkSettings] -> ShowS)
-> Show AudioWatermarkSettings
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. AudioWatermarkSettings -> Rep AudioWatermarkSettings x)
-> (forall x.
    Rep AudioWatermarkSettings x -> AudioWatermarkSettings)
-> Generic AudioWatermarkSettings
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' :: Maybe NielsenWatermarksSettings -> AudioWatermarkSettings
AudioWatermarkSettings'
    { $sel:nielsenWatermarksSettings:AudioWatermarkSettings' :: Maybe NielsenWatermarksSettings
nielsenWatermarksSettings =
        Maybe 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 :: (Maybe NielsenWatermarksSettings
 -> f (Maybe NielsenWatermarksSettings))
-> AudioWatermarkSettings -> f AudioWatermarkSettings
audioWatermarkSettings_nielsenWatermarksSettings = (AudioWatermarkSettings -> Maybe NielsenWatermarksSettings)
-> (AudioWatermarkSettings
    -> Maybe NielsenWatermarksSettings -> AudioWatermarkSettings)
-> Lens
     AudioWatermarkSettings
     AudioWatermarkSettings
     (Maybe NielsenWatermarksSettings)
     (Maybe 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 Core.FromJSON AudioWatermarkSettings where
  parseJSON :: Value -> Parser AudioWatermarkSettings
parseJSON =
    String
-> (Object -> Parser AudioWatermarkSettings)
-> Value
-> Parser AudioWatermarkSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AudioWatermarkSettings"
      ( \Object
x ->
          Maybe NielsenWatermarksSettings -> AudioWatermarkSettings
AudioWatermarkSettings'
            (Maybe NielsenWatermarksSettings -> AudioWatermarkSettings)
-> Parser (Maybe NielsenWatermarksSettings)
-> Parser AudioWatermarkSettings
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe NielsenWatermarksSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"nielsenWatermarksSettings")
      )

instance Prelude.Hashable AudioWatermarkSettings

instance Prelude.NFData AudioWatermarkSettings

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