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