{-# 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 #-}
module Amazonka.MediaLive.Types.NielsenConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.NielsenPcmToId3TaggingState
import qualified Amazonka.Prelude as Prelude
data NielsenConfiguration = NielsenConfiguration'
{
NielsenConfiguration -> Maybe Text
distributorId :: Prelude.Maybe Prelude.Text,
NielsenConfiguration -> Maybe NielsenPcmToId3TaggingState
nielsenPcmToId3Tagging :: Prelude.Maybe NielsenPcmToId3TaggingState
}
deriving (NielsenConfiguration -> NielsenConfiguration -> Bool
(NielsenConfiguration -> NielsenConfiguration -> Bool)
-> (NielsenConfiguration -> NielsenConfiguration -> Bool)
-> Eq NielsenConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NielsenConfiguration -> NielsenConfiguration -> Bool
$c/= :: NielsenConfiguration -> NielsenConfiguration -> Bool
== :: NielsenConfiguration -> NielsenConfiguration -> Bool
$c== :: NielsenConfiguration -> NielsenConfiguration -> Bool
Prelude.Eq, ReadPrec [NielsenConfiguration]
ReadPrec NielsenConfiguration
Int -> ReadS NielsenConfiguration
ReadS [NielsenConfiguration]
(Int -> ReadS NielsenConfiguration)
-> ReadS [NielsenConfiguration]
-> ReadPrec NielsenConfiguration
-> ReadPrec [NielsenConfiguration]
-> Read NielsenConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NielsenConfiguration]
$creadListPrec :: ReadPrec [NielsenConfiguration]
readPrec :: ReadPrec NielsenConfiguration
$creadPrec :: ReadPrec NielsenConfiguration
readList :: ReadS [NielsenConfiguration]
$creadList :: ReadS [NielsenConfiguration]
readsPrec :: Int -> ReadS NielsenConfiguration
$creadsPrec :: Int -> ReadS NielsenConfiguration
Prelude.Read, Int -> NielsenConfiguration -> ShowS
[NielsenConfiguration] -> ShowS
NielsenConfiguration -> String
(Int -> NielsenConfiguration -> ShowS)
-> (NielsenConfiguration -> String)
-> ([NielsenConfiguration] -> ShowS)
-> Show NielsenConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NielsenConfiguration] -> ShowS
$cshowList :: [NielsenConfiguration] -> ShowS
show :: NielsenConfiguration -> String
$cshow :: NielsenConfiguration -> String
showsPrec :: Int -> NielsenConfiguration -> ShowS
$cshowsPrec :: Int -> NielsenConfiguration -> ShowS
Prelude.Show, (forall x. NielsenConfiguration -> Rep NielsenConfiguration x)
-> (forall x. Rep NielsenConfiguration x -> NielsenConfiguration)
-> Generic NielsenConfiguration
forall x. Rep NielsenConfiguration x -> NielsenConfiguration
forall x. NielsenConfiguration -> Rep NielsenConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NielsenConfiguration x -> NielsenConfiguration
$cfrom :: forall x. NielsenConfiguration -> Rep NielsenConfiguration x
Prelude.Generic)
newNielsenConfiguration ::
NielsenConfiguration
newNielsenConfiguration :: NielsenConfiguration
newNielsenConfiguration =
NielsenConfiguration' :: Maybe Text
-> Maybe NielsenPcmToId3TaggingState -> NielsenConfiguration
NielsenConfiguration'
{ $sel:distributorId:NielsenConfiguration' :: Maybe Text
distributorId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nielsenPcmToId3Tagging:NielsenConfiguration' :: Maybe NielsenPcmToId3TaggingState
nielsenPcmToId3Tagging = Maybe NielsenPcmToId3TaggingState
forall a. Maybe a
Prelude.Nothing
}
nielsenConfiguration_distributorId :: Lens.Lens' NielsenConfiguration (Prelude.Maybe Prelude.Text)
nielsenConfiguration_distributorId :: (Maybe Text -> f (Maybe Text))
-> NielsenConfiguration -> f NielsenConfiguration
nielsenConfiguration_distributorId = (NielsenConfiguration -> Maybe Text)
-> (NielsenConfiguration -> Maybe Text -> NielsenConfiguration)
-> Lens
NielsenConfiguration NielsenConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NielsenConfiguration' {Maybe Text
distributorId :: Maybe Text
$sel:distributorId:NielsenConfiguration' :: NielsenConfiguration -> Maybe Text
distributorId} -> Maybe Text
distributorId) (\s :: NielsenConfiguration
s@NielsenConfiguration' {} Maybe Text
a -> NielsenConfiguration
s {$sel:distributorId:NielsenConfiguration' :: Maybe Text
distributorId = Maybe Text
a} :: NielsenConfiguration)
nielsenConfiguration_nielsenPcmToId3Tagging :: Lens.Lens' NielsenConfiguration (Prelude.Maybe NielsenPcmToId3TaggingState)
nielsenConfiguration_nielsenPcmToId3Tagging :: (Maybe NielsenPcmToId3TaggingState
-> f (Maybe NielsenPcmToId3TaggingState))
-> NielsenConfiguration -> f NielsenConfiguration
nielsenConfiguration_nielsenPcmToId3Tagging = (NielsenConfiguration -> Maybe NielsenPcmToId3TaggingState)
-> (NielsenConfiguration
-> Maybe NielsenPcmToId3TaggingState -> NielsenConfiguration)
-> Lens
NielsenConfiguration
NielsenConfiguration
(Maybe NielsenPcmToId3TaggingState)
(Maybe NielsenPcmToId3TaggingState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NielsenConfiguration' {Maybe NielsenPcmToId3TaggingState
nielsenPcmToId3Tagging :: Maybe NielsenPcmToId3TaggingState
$sel:nielsenPcmToId3Tagging:NielsenConfiguration' :: NielsenConfiguration -> Maybe NielsenPcmToId3TaggingState
nielsenPcmToId3Tagging} -> Maybe NielsenPcmToId3TaggingState
nielsenPcmToId3Tagging) (\s :: NielsenConfiguration
s@NielsenConfiguration' {} Maybe NielsenPcmToId3TaggingState
a -> NielsenConfiguration
s {$sel:nielsenPcmToId3Tagging:NielsenConfiguration' :: Maybe NielsenPcmToId3TaggingState
nielsenPcmToId3Tagging = Maybe NielsenPcmToId3TaggingState
a} :: NielsenConfiguration)
instance Core.FromJSON NielsenConfiguration where
parseJSON :: Value -> Parser NielsenConfiguration
parseJSON =
String
-> (Object -> Parser NielsenConfiguration)
-> Value
-> Parser NielsenConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NielsenConfiguration"
( \Object
x ->
Maybe Text
-> Maybe NielsenPcmToId3TaggingState -> NielsenConfiguration
NielsenConfiguration'
(Maybe Text
-> Maybe NielsenPcmToId3TaggingState -> NielsenConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe NielsenPcmToId3TaggingState -> NielsenConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"distributorId")
Parser (Maybe NielsenPcmToId3TaggingState -> NielsenConfiguration)
-> Parser (Maybe NielsenPcmToId3TaggingState)
-> Parser NielsenConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NielsenPcmToId3TaggingState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"nielsenPcmToId3Tagging")
)
instance Prelude.Hashable NielsenConfiguration
instance Prelude.NFData NielsenConfiguration
instance Core.ToJSON NielsenConfiguration where
toJSON :: NielsenConfiguration -> Value
toJSON NielsenConfiguration' {Maybe Text
Maybe NielsenPcmToId3TaggingState
nielsenPcmToId3Tagging :: Maybe NielsenPcmToId3TaggingState
distributorId :: Maybe Text
$sel:nielsenPcmToId3Tagging:NielsenConfiguration' :: NielsenConfiguration -> Maybe NielsenPcmToId3TaggingState
$sel:distributorId:NielsenConfiguration' :: NielsenConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"distributorId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
distributorId,
(Text
"nielsenPcmToId3Tagging" Text -> NielsenPcmToId3TaggingState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NielsenPcmToId3TaggingState -> Pair)
-> Maybe NielsenPcmToId3TaggingState -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NielsenPcmToId3TaggingState
nielsenPcmToId3Tagging
]
)