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