{-# 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.MediaLive.Types.OutputGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.Output
import Amazonka.MediaLive.Types.OutputGroupSettings
import qualified Amazonka.Prelude as Prelude
data OutputGroup = OutputGroup'
{
OutputGroup -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
OutputGroup -> [Output]
outputs :: [Output],
OutputGroup -> OutputGroupSettings
outputGroupSettings :: OutputGroupSettings
}
deriving (OutputGroup -> OutputGroup -> Bool
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]
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
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. 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 ::
OutputGroupSettings ->
OutputGroup
newOutputGroup :: OutputGroupSettings -> OutputGroup
newOutputGroup OutputGroupSettings
pOutputGroupSettings_ =
OutputGroup'
{ $sel:name:OutputGroup' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:outputs:OutputGroup' :: [Output]
outputs = forall a. Monoid a => a
Prelude.mempty,
$sel:outputGroupSettings:OutputGroup' :: OutputGroupSettings
outputGroupSettings = OutputGroupSettings
pOutputGroupSettings_
}
outputGroup_name :: Lens.Lens' OutputGroup (Prelude.Maybe Prelude.Text)
outputGroup_name :: Lens' OutputGroup (Maybe Text)
outputGroup_name = 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_outputs :: Lens.Lens' OutputGroup [Output]
outputGroup_outputs :: Lens' OutputGroup [Output]
outputGroup_outputs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputGroup' {[Output]
outputs :: [Output]
$sel:outputs:OutputGroup' :: OutputGroup -> [Output]
outputs} -> [Output]
outputs) (\s :: OutputGroup
s@OutputGroup' {} [Output]
a -> OutputGroup
s {$sel:outputs:OutputGroup' :: [Output]
outputs = [Output]
a} :: OutputGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
outputGroup_outputGroupSettings :: Lens.Lens' OutputGroup OutputGroupSettings
outputGroup_outputGroupSettings :: Lens' OutputGroup OutputGroupSettings
outputGroup_outputGroupSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputGroup' {OutputGroupSettings
outputGroupSettings :: OutputGroupSettings
$sel:outputGroupSettings:OutputGroup' :: OutputGroup -> OutputGroupSettings
outputGroupSettings} -> OutputGroupSettings
outputGroupSettings) (\s :: OutputGroup
s@OutputGroup' {} OutputGroupSettings
a -> OutputGroup
s {$sel:outputGroupSettings:OutputGroup' :: OutputGroupSettings
outputGroupSettings = OutputGroupSettings
a} :: OutputGroup)
instance Data.FromJSON OutputGroup where
parseJSON :: Value -> Parser OutputGroup
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"OutputGroup"
( \Object
x ->
Maybe Text -> [Output] -> OutputGroupSettings -> OutputGroup
OutputGroup'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"outputs" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"outputGroupSettings")
)
instance Prelude.Hashable OutputGroup where
hashWithSalt :: Int -> OutputGroup -> Int
hashWithSalt Int
_salt OutputGroup' {[Output]
Maybe Text
OutputGroupSettings
outputGroupSettings :: OutputGroupSettings
outputs :: [Output]
name :: Maybe Text
$sel:outputGroupSettings:OutputGroup' :: OutputGroup -> OutputGroupSettings
$sel:outputs:OutputGroup' :: OutputGroup -> [Output]
$sel:name:OutputGroup' :: OutputGroup -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Output]
outputs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` OutputGroupSettings
outputGroupSettings
instance Prelude.NFData OutputGroup where
rnf :: OutputGroup -> ()
rnf OutputGroup' {[Output]
Maybe Text
OutputGroupSettings
outputGroupSettings :: OutputGroupSettings
outputs :: [Output]
name :: Maybe Text
$sel:outputGroupSettings:OutputGroup' :: OutputGroup -> OutputGroupSettings
$sel:outputs:OutputGroup' :: OutputGroup -> [Output]
$sel:name:OutputGroup' :: OutputGroup -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Output]
outputs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf OutputGroupSettings
outputGroupSettings
instance Data.ToJSON OutputGroup where
toJSON :: OutputGroup -> Value
toJSON OutputGroup' {[Output]
Maybe Text
OutputGroupSettings
outputGroupSettings :: OutputGroupSettings
outputs :: [Output]
name :: Maybe Text
$sel:outputGroupSettings:OutputGroup' :: OutputGroup -> OutputGroupSettings
$sel:outputs:OutputGroup' :: OutputGroup -> [Output]
$sel:name:OutputGroup' :: OutputGroup -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
forall a. a -> Maybe a
Prelude.Just (Key
"outputs" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Output]
outputs),
forall a. a -> Maybe a
Prelude.Just
(Key
"outputGroupSettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= OutputGroupSettings
outputGroupSettings)
]
)