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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Nielsen Naes Ii Nw
--
-- /See:/ 'newNielsenNaesIiNw' smart constructor.
data NielsenNaesIiNw = NielsenNaesIiNw'
  { -- | Enter the check digit string for the watermark
    NielsenNaesIiNw -> Text
checkDigitString :: Prelude.Text,
    -- | Enter the Nielsen Source ID (SID) to include in the watermark
    NielsenNaesIiNw -> Double
sid :: Prelude.Double
  }
  deriving (NielsenNaesIiNw -> NielsenNaesIiNw -> Bool
(NielsenNaesIiNw -> NielsenNaesIiNw -> Bool)
-> (NielsenNaesIiNw -> NielsenNaesIiNw -> Bool)
-> Eq NielsenNaesIiNw
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NielsenNaesIiNw -> NielsenNaesIiNw -> Bool
$c/= :: NielsenNaesIiNw -> NielsenNaesIiNw -> Bool
== :: NielsenNaesIiNw -> NielsenNaesIiNw -> Bool
$c== :: NielsenNaesIiNw -> NielsenNaesIiNw -> Bool
Prelude.Eq, ReadPrec [NielsenNaesIiNw]
ReadPrec NielsenNaesIiNw
Int -> ReadS NielsenNaesIiNw
ReadS [NielsenNaesIiNw]
(Int -> ReadS NielsenNaesIiNw)
-> ReadS [NielsenNaesIiNw]
-> ReadPrec NielsenNaesIiNw
-> ReadPrec [NielsenNaesIiNw]
-> Read NielsenNaesIiNw
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NielsenNaesIiNw]
$creadListPrec :: ReadPrec [NielsenNaesIiNw]
readPrec :: ReadPrec NielsenNaesIiNw
$creadPrec :: ReadPrec NielsenNaesIiNw
readList :: ReadS [NielsenNaesIiNw]
$creadList :: ReadS [NielsenNaesIiNw]
readsPrec :: Int -> ReadS NielsenNaesIiNw
$creadsPrec :: Int -> ReadS NielsenNaesIiNw
Prelude.Read, Int -> NielsenNaesIiNw -> ShowS
[NielsenNaesIiNw] -> ShowS
NielsenNaesIiNw -> String
(Int -> NielsenNaesIiNw -> ShowS)
-> (NielsenNaesIiNw -> String)
-> ([NielsenNaesIiNw] -> ShowS)
-> Show NielsenNaesIiNw
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NielsenNaesIiNw] -> ShowS
$cshowList :: [NielsenNaesIiNw] -> ShowS
show :: NielsenNaesIiNw -> String
$cshow :: NielsenNaesIiNw -> String
showsPrec :: Int -> NielsenNaesIiNw -> ShowS
$cshowsPrec :: Int -> NielsenNaesIiNw -> ShowS
Prelude.Show, (forall x. NielsenNaesIiNw -> Rep NielsenNaesIiNw x)
-> (forall x. Rep NielsenNaesIiNw x -> NielsenNaesIiNw)
-> Generic NielsenNaesIiNw
forall x. Rep NielsenNaesIiNw x -> NielsenNaesIiNw
forall x. NielsenNaesIiNw -> Rep NielsenNaesIiNw x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NielsenNaesIiNw x -> NielsenNaesIiNw
$cfrom :: forall x. NielsenNaesIiNw -> Rep NielsenNaesIiNw x
Prelude.Generic)

-- |
-- Create a value of 'NielsenNaesIiNw' 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:
--
-- 'checkDigitString', 'nielsenNaesIiNw_checkDigitString' - Enter the check digit string for the watermark
--
-- 'sid', 'nielsenNaesIiNw_sid' - Enter the Nielsen Source ID (SID) to include in the watermark
newNielsenNaesIiNw ::
  -- | 'checkDigitString'
  Prelude.Text ->
  -- | 'sid'
  Prelude.Double ->
  NielsenNaesIiNw
newNielsenNaesIiNw :: Text -> Double -> NielsenNaesIiNw
newNielsenNaesIiNw Text
pCheckDigitString_ Double
pSid_ =
  NielsenNaesIiNw' :: Text -> Double -> NielsenNaesIiNw
NielsenNaesIiNw'
    { $sel:checkDigitString:NielsenNaesIiNw' :: Text
checkDigitString =
        Text
pCheckDigitString_,
      $sel:sid:NielsenNaesIiNw' :: Double
sid = Double
pSid_
    }

-- | Enter the check digit string for the watermark
nielsenNaesIiNw_checkDigitString :: Lens.Lens' NielsenNaesIiNw Prelude.Text
nielsenNaesIiNw_checkDigitString :: (Text -> f Text) -> NielsenNaesIiNw -> f NielsenNaesIiNw
nielsenNaesIiNw_checkDigitString = (NielsenNaesIiNw -> Text)
-> (NielsenNaesIiNw -> Text -> NielsenNaesIiNw)
-> Lens NielsenNaesIiNw NielsenNaesIiNw Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NielsenNaesIiNw' {Text
checkDigitString :: Text
$sel:checkDigitString:NielsenNaesIiNw' :: NielsenNaesIiNw -> Text
checkDigitString} -> Text
checkDigitString) (\s :: NielsenNaesIiNw
s@NielsenNaesIiNw' {} Text
a -> NielsenNaesIiNw
s {$sel:checkDigitString:NielsenNaesIiNw' :: Text
checkDigitString = Text
a} :: NielsenNaesIiNw)

-- | Enter the Nielsen Source ID (SID) to include in the watermark
nielsenNaesIiNw_sid :: Lens.Lens' NielsenNaesIiNw Prelude.Double
nielsenNaesIiNw_sid :: (Double -> f Double) -> NielsenNaesIiNw -> f NielsenNaesIiNw
nielsenNaesIiNw_sid = (NielsenNaesIiNw -> Double)
-> (NielsenNaesIiNw -> Double -> NielsenNaesIiNw)
-> Lens NielsenNaesIiNw NielsenNaesIiNw Double Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NielsenNaesIiNw' {Double
sid :: Double
$sel:sid:NielsenNaesIiNw' :: NielsenNaesIiNw -> Double
sid} -> Double
sid) (\s :: NielsenNaesIiNw
s@NielsenNaesIiNw' {} Double
a -> NielsenNaesIiNw
s {$sel:sid:NielsenNaesIiNw' :: Double
sid = Double
a} :: NielsenNaesIiNw)

instance Core.FromJSON NielsenNaesIiNw where
  parseJSON :: Value -> Parser NielsenNaesIiNw
parseJSON =
    String
-> (Object -> Parser NielsenNaesIiNw)
-> Value
-> Parser NielsenNaesIiNw
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"NielsenNaesIiNw"
      ( \Object
x ->
          Text -> Double -> NielsenNaesIiNw
NielsenNaesIiNw'
            (Text -> Double -> NielsenNaesIiNw)
-> Parser Text -> Parser (Double -> NielsenNaesIiNw)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"checkDigitString")
            Parser (Double -> NielsenNaesIiNw)
-> Parser Double -> Parser NielsenNaesIiNw
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"sid")
      )

instance Prelude.Hashable NielsenNaesIiNw

instance Prelude.NFData NielsenNaesIiNw

instance Core.ToJSON NielsenNaesIiNw where
  toJSON :: NielsenNaesIiNw -> Value
toJSON NielsenNaesIiNw' {Double
Text
sid :: Double
checkDigitString :: Text
$sel:sid:NielsenNaesIiNw' :: NielsenNaesIiNw -> Double
$sel:checkDigitString:NielsenNaesIiNw' :: NielsenNaesIiNw -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"checkDigitString" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
checkDigitString),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"sid" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Double
sid)
          ]
      )