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