{-# 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.AudioOnlyHlsSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.AudioOnlyHlsSegmentType
import Amazonka.MediaLive.Types.AudioOnlyHlsTrackType
import Amazonka.MediaLive.Types.InputLocation
import qualified Amazonka.Prelude as Prelude
data AudioOnlyHlsSettings = AudioOnlyHlsSettings'
{
AudioOnlyHlsSettings -> Maybe InputLocation
audioOnlyImage :: Prelude.Maybe InputLocation,
AudioOnlyHlsSettings -> Maybe AudioOnlyHlsSegmentType
segmentType :: Prelude.Maybe AudioOnlyHlsSegmentType,
AudioOnlyHlsSettings -> Maybe Text
audioGroupId :: Prelude.Maybe Prelude.Text,
AudioOnlyHlsSettings -> Maybe AudioOnlyHlsTrackType
audioTrackType :: Prelude.Maybe AudioOnlyHlsTrackType
}
deriving (AudioOnlyHlsSettings -> AudioOnlyHlsSettings -> Bool
(AudioOnlyHlsSettings -> AudioOnlyHlsSettings -> Bool)
-> (AudioOnlyHlsSettings -> AudioOnlyHlsSettings -> Bool)
-> Eq AudioOnlyHlsSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AudioOnlyHlsSettings -> AudioOnlyHlsSettings -> Bool
$c/= :: AudioOnlyHlsSettings -> AudioOnlyHlsSettings -> Bool
== :: AudioOnlyHlsSettings -> AudioOnlyHlsSettings -> Bool
$c== :: AudioOnlyHlsSettings -> AudioOnlyHlsSettings -> Bool
Prelude.Eq, ReadPrec [AudioOnlyHlsSettings]
ReadPrec AudioOnlyHlsSettings
Int -> ReadS AudioOnlyHlsSettings
ReadS [AudioOnlyHlsSettings]
(Int -> ReadS AudioOnlyHlsSettings)
-> ReadS [AudioOnlyHlsSettings]
-> ReadPrec AudioOnlyHlsSettings
-> ReadPrec [AudioOnlyHlsSettings]
-> Read AudioOnlyHlsSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AudioOnlyHlsSettings]
$creadListPrec :: ReadPrec [AudioOnlyHlsSettings]
readPrec :: ReadPrec AudioOnlyHlsSettings
$creadPrec :: ReadPrec AudioOnlyHlsSettings
readList :: ReadS [AudioOnlyHlsSettings]
$creadList :: ReadS [AudioOnlyHlsSettings]
readsPrec :: Int -> ReadS AudioOnlyHlsSettings
$creadsPrec :: Int -> ReadS AudioOnlyHlsSettings
Prelude.Read, Int -> AudioOnlyHlsSettings -> ShowS
[AudioOnlyHlsSettings] -> ShowS
AudioOnlyHlsSettings -> String
(Int -> AudioOnlyHlsSettings -> ShowS)
-> (AudioOnlyHlsSettings -> String)
-> ([AudioOnlyHlsSettings] -> ShowS)
-> Show AudioOnlyHlsSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AudioOnlyHlsSettings] -> ShowS
$cshowList :: [AudioOnlyHlsSettings] -> ShowS
show :: AudioOnlyHlsSettings -> String
$cshow :: AudioOnlyHlsSettings -> String
showsPrec :: Int -> AudioOnlyHlsSettings -> ShowS
$cshowsPrec :: Int -> AudioOnlyHlsSettings -> ShowS
Prelude.Show, (forall x. AudioOnlyHlsSettings -> Rep AudioOnlyHlsSettings x)
-> (forall x. Rep AudioOnlyHlsSettings x -> AudioOnlyHlsSettings)
-> Generic AudioOnlyHlsSettings
forall x. Rep AudioOnlyHlsSettings x -> AudioOnlyHlsSettings
forall x. AudioOnlyHlsSettings -> Rep AudioOnlyHlsSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AudioOnlyHlsSettings x -> AudioOnlyHlsSettings
$cfrom :: forall x. AudioOnlyHlsSettings -> Rep AudioOnlyHlsSettings x
Prelude.Generic)
newAudioOnlyHlsSettings ::
AudioOnlyHlsSettings
newAudioOnlyHlsSettings :: AudioOnlyHlsSettings
newAudioOnlyHlsSettings =
AudioOnlyHlsSettings' :: Maybe InputLocation
-> Maybe AudioOnlyHlsSegmentType
-> Maybe Text
-> Maybe AudioOnlyHlsTrackType
-> AudioOnlyHlsSettings
AudioOnlyHlsSettings'
{ $sel:audioOnlyImage:AudioOnlyHlsSettings' :: Maybe InputLocation
audioOnlyImage =
Maybe InputLocation
forall a. Maybe a
Prelude.Nothing,
$sel:segmentType:AudioOnlyHlsSettings' :: Maybe AudioOnlyHlsSegmentType
segmentType = Maybe AudioOnlyHlsSegmentType
forall a. Maybe a
Prelude.Nothing,
$sel:audioGroupId:AudioOnlyHlsSettings' :: Maybe Text
audioGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:audioTrackType:AudioOnlyHlsSettings' :: Maybe AudioOnlyHlsTrackType
audioTrackType = Maybe AudioOnlyHlsTrackType
forall a. Maybe a
Prelude.Nothing
}
audioOnlyHlsSettings_audioOnlyImage :: Lens.Lens' AudioOnlyHlsSettings (Prelude.Maybe InputLocation)
audioOnlyHlsSettings_audioOnlyImage :: (Maybe InputLocation -> f (Maybe InputLocation))
-> AudioOnlyHlsSettings -> f AudioOnlyHlsSettings
audioOnlyHlsSettings_audioOnlyImage = (AudioOnlyHlsSettings -> Maybe InputLocation)
-> (AudioOnlyHlsSettings
-> Maybe InputLocation -> AudioOnlyHlsSettings)
-> Lens
AudioOnlyHlsSettings
AudioOnlyHlsSettings
(Maybe InputLocation)
(Maybe InputLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioOnlyHlsSettings' {Maybe InputLocation
audioOnlyImage :: Maybe InputLocation
$sel:audioOnlyImage:AudioOnlyHlsSettings' :: AudioOnlyHlsSettings -> Maybe InputLocation
audioOnlyImage} -> Maybe InputLocation
audioOnlyImage) (\s :: AudioOnlyHlsSettings
s@AudioOnlyHlsSettings' {} Maybe InputLocation
a -> AudioOnlyHlsSettings
s {$sel:audioOnlyImage:AudioOnlyHlsSettings' :: Maybe InputLocation
audioOnlyImage = Maybe InputLocation
a} :: AudioOnlyHlsSettings)
audioOnlyHlsSettings_segmentType :: Lens.Lens' AudioOnlyHlsSettings (Prelude.Maybe AudioOnlyHlsSegmentType)
audioOnlyHlsSettings_segmentType :: (Maybe AudioOnlyHlsSegmentType
-> f (Maybe AudioOnlyHlsSegmentType))
-> AudioOnlyHlsSettings -> f AudioOnlyHlsSettings
audioOnlyHlsSettings_segmentType = (AudioOnlyHlsSettings -> Maybe AudioOnlyHlsSegmentType)
-> (AudioOnlyHlsSettings
-> Maybe AudioOnlyHlsSegmentType -> AudioOnlyHlsSettings)
-> Lens
AudioOnlyHlsSettings
AudioOnlyHlsSettings
(Maybe AudioOnlyHlsSegmentType)
(Maybe AudioOnlyHlsSegmentType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioOnlyHlsSettings' {Maybe AudioOnlyHlsSegmentType
segmentType :: Maybe AudioOnlyHlsSegmentType
$sel:segmentType:AudioOnlyHlsSettings' :: AudioOnlyHlsSettings -> Maybe AudioOnlyHlsSegmentType
segmentType} -> Maybe AudioOnlyHlsSegmentType
segmentType) (\s :: AudioOnlyHlsSettings
s@AudioOnlyHlsSettings' {} Maybe AudioOnlyHlsSegmentType
a -> AudioOnlyHlsSettings
s {$sel:segmentType:AudioOnlyHlsSettings' :: Maybe AudioOnlyHlsSegmentType
segmentType = Maybe AudioOnlyHlsSegmentType
a} :: AudioOnlyHlsSettings)
audioOnlyHlsSettings_audioGroupId :: Lens.Lens' AudioOnlyHlsSettings (Prelude.Maybe Prelude.Text)
audioOnlyHlsSettings_audioGroupId :: (Maybe Text -> f (Maybe Text))
-> AudioOnlyHlsSettings -> f AudioOnlyHlsSettings
audioOnlyHlsSettings_audioGroupId = (AudioOnlyHlsSettings -> Maybe Text)
-> (AudioOnlyHlsSettings -> Maybe Text -> AudioOnlyHlsSettings)
-> Lens
AudioOnlyHlsSettings AudioOnlyHlsSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioOnlyHlsSettings' {Maybe Text
audioGroupId :: Maybe Text
$sel:audioGroupId:AudioOnlyHlsSettings' :: AudioOnlyHlsSettings -> Maybe Text
audioGroupId} -> Maybe Text
audioGroupId) (\s :: AudioOnlyHlsSettings
s@AudioOnlyHlsSettings' {} Maybe Text
a -> AudioOnlyHlsSettings
s {$sel:audioGroupId:AudioOnlyHlsSettings' :: Maybe Text
audioGroupId = Maybe Text
a} :: AudioOnlyHlsSettings)
audioOnlyHlsSettings_audioTrackType :: Lens.Lens' AudioOnlyHlsSettings (Prelude.Maybe AudioOnlyHlsTrackType)
audioOnlyHlsSettings_audioTrackType :: (Maybe AudioOnlyHlsTrackType -> f (Maybe AudioOnlyHlsTrackType))
-> AudioOnlyHlsSettings -> f AudioOnlyHlsSettings
audioOnlyHlsSettings_audioTrackType = (AudioOnlyHlsSettings -> Maybe AudioOnlyHlsTrackType)
-> (AudioOnlyHlsSettings
-> Maybe AudioOnlyHlsTrackType -> AudioOnlyHlsSettings)
-> Lens
AudioOnlyHlsSettings
AudioOnlyHlsSettings
(Maybe AudioOnlyHlsTrackType)
(Maybe AudioOnlyHlsTrackType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioOnlyHlsSettings' {Maybe AudioOnlyHlsTrackType
audioTrackType :: Maybe AudioOnlyHlsTrackType
$sel:audioTrackType:AudioOnlyHlsSettings' :: AudioOnlyHlsSettings -> Maybe AudioOnlyHlsTrackType
audioTrackType} -> Maybe AudioOnlyHlsTrackType
audioTrackType) (\s :: AudioOnlyHlsSettings
s@AudioOnlyHlsSettings' {} Maybe AudioOnlyHlsTrackType
a -> AudioOnlyHlsSettings
s {$sel:audioTrackType:AudioOnlyHlsSettings' :: Maybe AudioOnlyHlsTrackType
audioTrackType = Maybe AudioOnlyHlsTrackType
a} :: AudioOnlyHlsSettings)
instance Core.FromJSON AudioOnlyHlsSettings where
parseJSON :: Value -> Parser AudioOnlyHlsSettings
parseJSON =
String
-> (Object -> Parser AudioOnlyHlsSettings)
-> Value
-> Parser AudioOnlyHlsSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AudioOnlyHlsSettings"
( \Object
x ->
Maybe InputLocation
-> Maybe AudioOnlyHlsSegmentType
-> Maybe Text
-> Maybe AudioOnlyHlsTrackType
-> AudioOnlyHlsSettings
AudioOnlyHlsSettings'
(Maybe InputLocation
-> Maybe AudioOnlyHlsSegmentType
-> Maybe Text
-> Maybe AudioOnlyHlsTrackType
-> AudioOnlyHlsSettings)
-> Parser (Maybe InputLocation)
-> Parser
(Maybe AudioOnlyHlsSegmentType
-> Maybe Text
-> Maybe AudioOnlyHlsTrackType
-> AudioOnlyHlsSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InputLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioOnlyImage")
Parser
(Maybe AudioOnlyHlsSegmentType
-> Maybe Text
-> Maybe AudioOnlyHlsTrackType
-> AudioOnlyHlsSettings)
-> Parser (Maybe AudioOnlyHlsSegmentType)
-> Parser
(Maybe Text -> Maybe AudioOnlyHlsTrackType -> AudioOnlyHlsSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioOnlyHlsSegmentType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"segmentType")
Parser
(Maybe Text -> Maybe AudioOnlyHlsTrackType -> AudioOnlyHlsSettings)
-> Parser (Maybe Text)
-> Parser (Maybe AudioOnlyHlsTrackType -> AudioOnlyHlsSettings)
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
"audioGroupId")
Parser (Maybe AudioOnlyHlsTrackType -> AudioOnlyHlsSettings)
-> Parser (Maybe AudioOnlyHlsTrackType)
-> Parser AudioOnlyHlsSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioOnlyHlsTrackType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioTrackType")
)
instance Prelude.Hashable AudioOnlyHlsSettings
instance Prelude.NFData AudioOnlyHlsSettings
instance Core.ToJSON AudioOnlyHlsSettings where
toJSON :: AudioOnlyHlsSettings -> Value
toJSON AudioOnlyHlsSettings' {Maybe Text
Maybe AudioOnlyHlsSegmentType
Maybe AudioOnlyHlsTrackType
Maybe InputLocation
audioTrackType :: Maybe AudioOnlyHlsTrackType
audioGroupId :: Maybe Text
segmentType :: Maybe AudioOnlyHlsSegmentType
audioOnlyImage :: Maybe InputLocation
$sel:audioTrackType:AudioOnlyHlsSettings' :: AudioOnlyHlsSettings -> Maybe AudioOnlyHlsTrackType
$sel:audioGroupId:AudioOnlyHlsSettings' :: AudioOnlyHlsSettings -> Maybe Text
$sel:segmentType:AudioOnlyHlsSettings' :: AudioOnlyHlsSettings -> Maybe AudioOnlyHlsSegmentType
$sel:audioOnlyImage:AudioOnlyHlsSettings' :: AudioOnlyHlsSettings -> Maybe InputLocation
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"audioOnlyImage" Text -> InputLocation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(InputLocation -> Pair) -> Maybe InputLocation -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputLocation
audioOnlyImage,
(Text
"segmentType" Text -> AudioOnlyHlsSegmentType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AudioOnlyHlsSegmentType -> Pair)
-> Maybe AudioOnlyHlsSegmentType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioOnlyHlsSegmentType
segmentType,
(Text
"audioGroupId" 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
audioGroupId,
(Text
"audioTrackType" Text -> AudioOnlyHlsTrackType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AudioOnlyHlsTrackType -> Pair)
-> Maybe AudioOnlyHlsTrackType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioOnlyHlsTrackType
audioTrackType
]
)