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