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