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