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