{-# 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.MediaConvert.Types.NielsenConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data NielsenConfiguration = NielsenConfiguration'
{
NielsenConfiguration -> Maybe Natural
breakoutCode :: Prelude.Maybe Prelude.Natural,
NielsenConfiguration -> Maybe Text
distributorId :: Prelude.Maybe Prelude.Text
}
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 Natural -> Maybe Text -> NielsenConfiguration
NielsenConfiguration'
{ $sel:breakoutCode:NielsenConfiguration' :: Maybe Natural
breakoutCode =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:distributorId:NielsenConfiguration' :: Maybe Text
distributorId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
nielsenConfiguration_breakoutCode :: Lens.Lens' NielsenConfiguration (Prelude.Maybe Prelude.Natural)
nielsenConfiguration_breakoutCode :: (Maybe Natural -> f (Maybe Natural))
-> NielsenConfiguration -> f NielsenConfiguration
nielsenConfiguration_breakoutCode = (NielsenConfiguration -> Maybe Natural)
-> (NielsenConfiguration -> Maybe Natural -> NielsenConfiguration)
-> Lens
NielsenConfiguration
NielsenConfiguration
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NielsenConfiguration' {Maybe Natural
breakoutCode :: Maybe Natural
$sel:breakoutCode:NielsenConfiguration' :: NielsenConfiguration -> Maybe Natural
breakoutCode} -> Maybe Natural
breakoutCode) (\s :: NielsenConfiguration
s@NielsenConfiguration' {} Maybe Natural
a -> NielsenConfiguration
s {$sel:breakoutCode:NielsenConfiguration' :: Maybe Natural
breakoutCode = Maybe Natural
a} :: NielsenConfiguration)
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)
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 Natural -> Maybe Text -> NielsenConfiguration
NielsenConfiguration'
(Maybe Natural -> Maybe Text -> NielsenConfiguration)
-> Parser (Maybe Natural)
-> Parser (Maybe Text -> NielsenConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"breakoutCode")
Parser (Maybe Text -> NielsenConfiguration)
-> Parser (Maybe Text) -> Parser NielsenConfiguration
forall (f :: * -> *) a b. Applicative f => 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")
)
instance Prelude.Hashable NielsenConfiguration
instance Prelude.NFData NielsenConfiguration
instance Core.ToJSON NielsenConfiguration where
toJSON :: NielsenConfiguration -> Value
toJSON NielsenConfiguration' {Maybe Natural
Maybe Text
distributorId :: Maybe Text
breakoutCode :: Maybe Natural
$sel:distributorId:NielsenConfiguration' :: NielsenConfiguration -> Maybe Text
$sel:breakoutCode:NielsenConfiguration' :: NielsenConfiguration -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"breakoutCode" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
breakoutCode,
(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
]
)