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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
    { $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 :: Lens' NielsenNaesIiNw Text
nielsenNaesIiNw_checkDigitString = 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 :: Lens' NielsenNaesIiNw Double
nielsenNaesIiNw_sid = 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 Data.FromJSON NielsenNaesIiNw where
  parseJSON :: Value -> Parser NielsenNaesIiNw
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"NielsenNaesIiNw"
      ( \Object
x ->
          Text -> Double -> NielsenNaesIiNw
NielsenNaesIiNw'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"checkDigitString")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"sid")
      )

instance Prelude.Hashable NielsenNaesIiNw where
  hashWithSalt :: Int -> NielsenNaesIiNw -> Int
hashWithSalt Int
_salt NielsenNaesIiNw' {Double
Text
sid :: Double
checkDigitString :: Text
$sel:sid:NielsenNaesIiNw' :: NielsenNaesIiNw -> Double
$sel:checkDigitString:NielsenNaesIiNw' :: NielsenNaesIiNw -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
checkDigitString
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
sid

instance Prelude.NFData NielsenNaesIiNw where
  rnf :: NielsenNaesIiNw -> ()
rnf NielsenNaesIiNw' {Double
Text
sid :: Double
checkDigitString :: Text
$sel:sid:NielsenNaesIiNw' :: NielsenNaesIiNw -> Double
$sel:checkDigitString:NielsenNaesIiNw' :: NielsenNaesIiNw -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
checkDigitString
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
sid

instance Data.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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"checkDigitString" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
checkDigitString),
            forall a. a -> Maybe a
Prelude.Just (Key
"sid" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Double
sid)
          ]
      )