{-# 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.HlsOutputSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.HlsH265PackagingType
import Amazonka.MediaLive.Types.HlsSettings
import qualified Amazonka.Prelude as Prelude
data HlsOutputSettings = HlsOutputSettings'
{
HlsOutputSettings -> Maybe HlsH265PackagingType
h265PackagingType :: Prelude.Maybe HlsH265PackagingType,
HlsOutputSettings -> Maybe Text
segmentModifier :: Prelude.Maybe Prelude.Text,
HlsOutputSettings -> Maybe Text
nameModifier :: Prelude.Maybe Prelude.Text,
HlsOutputSettings -> HlsSettings
hlsSettings :: HlsSettings
}
deriving (HlsOutputSettings -> HlsOutputSettings -> Bool
(HlsOutputSettings -> HlsOutputSettings -> Bool)
-> (HlsOutputSettings -> HlsOutputSettings -> Bool)
-> Eq HlsOutputSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HlsOutputSettings -> HlsOutputSettings -> Bool
$c/= :: HlsOutputSettings -> HlsOutputSettings -> Bool
== :: HlsOutputSettings -> HlsOutputSettings -> Bool
$c== :: HlsOutputSettings -> HlsOutputSettings -> Bool
Prelude.Eq, ReadPrec [HlsOutputSettings]
ReadPrec HlsOutputSettings
Int -> ReadS HlsOutputSettings
ReadS [HlsOutputSettings]
(Int -> ReadS HlsOutputSettings)
-> ReadS [HlsOutputSettings]
-> ReadPrec HlsOutputSettings
-> ReadPrec [HlsOutputSettings]
-> Read HlsOutputSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HlsOutputSettings]
$creadListPrec :: ReadPrec [HlsOutputSettings]
readPrec :: ReadPrec HlsOutputSettings
$creadPrec :: ReadPrec HlsOutputSettings
readList :: ReadS [HlsOutputSettings]
$creadList :: ReadS [HlsOutputSettings]
readsPrec :: Int -> ReadS HlsOutputSettings
$creadsPrec :: Int -> ReadS HlsOutputSettings
Prelude.Read, Int -> HlsOutputSettings -> ShowS
[HlsOutputSettings] -> ShowS
HlsOutputSettings -> String
(Int -> HlsOutputSettings -> ShowS)
-> (HlsOutputSettings -> String)
-> ([HlsOutputSettings] -> ShowS)
-> Show HlsOutputSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HlsOutputSettings] -> ShowS
$cshowList :: [HlsOutputSettings] -> ShowS
show :: HlsOutputSettings -> String
$cshow :: HlsOutputSettings -> String
showsPrec :: Int -> HlsOutputSettings -> ShowS
$cshowsPrec :: Int -> HlsOutputSettings -> ShowS
Prelude.Show, (forall x. HlsOutputSettings -> Rep HlsOutputSettings x)
-> (forall x. Rep HlsOutputSettings x -> HlsOutputSettings)
-> Generic HlsOutputSettings
forall x. Rep HlsOutputSettings x -> HlsOutputSettings
forall x. HlsOutputSettings -> Rep HlsOutputSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HlsOutputSettings x -> HlsOutputSettings
$cfrom :: forall x. HlsOutputSettings -> Rep HlsOutputSettings x
Prelude.Generic)
newHlsOutputSettings ::
HlsSettings ->
HlsOutputSettings
newHlsOutputSettings :: HlsSettings -> HlsOutputSettings
newHlsOutputSettings HlsSettings
pHlsSettings_ =
HlsOutputSettings' :: Maybe HlsH265PackagingType
-> Maybe Text -> Maybe Text -> HlsSettings -> HlsOutputSettings
HlsOutputSettings'
{ $sel:h265PackagingType:HlsOutputSettings' :: Maybe HlsH265PackagingType
h265PackagingType =
Maybe HlsH265PackagingType
forall a. Maybe a
Prelude.Nothing,
$sel:segmentModifier:HlsOutputSettings' :: Maybe Text
segmentModifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nameModifier:HlsOutputSettings' :: Maybe Text
nameModifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:hlsSettings:HlsOutputSettings' :: HlsSettings
hlsSettings = HlsSettings
pHlsSettings_
}
hlsOutputSettings_h265PackagingType :: Lens.Lens' HlsOutputSettings (Prelude.Maybe HlsH265PackagingType)
hlsOutputSettings_h265PackagingType :: (Maybe HlsH265PackagingType -> f (Maybe HlsH265PackagingType))
-> HlsOutputSettings -> f HlsOutputSettings
hlsOutputSettings_h265PackagingType = (HlsOutputSettings -> Maybe HlsH265PackagingType)
-> (HlsOutputSettings
-> Maybe HlsH265PackagingType -> HlsOutputSettings)
-> Lens
HlsOutputSettings
HlsOutputSettings
(Maybe HlsH265PackagingType)
(Maybe HlsH265PackagingType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsOutputSettings' {Maybe HlsH265PackagingType
h265PackagingType :: Maybe HlsH265PackagingType
$sel:h265PackagingType:HlsOutputSettings' :: HlsOutputSettings -> Maybe HlsH265PackagingType
h265PackagingType} -> Maybe HlsH265PackagingType
h265PackagingType) (\s :: HlsOutputSettings
s@HlsOutputSettings' {} Maybe HlsH265PackagingType
a -> HlsOutputSettings
s {$sel:h265PackagingType:HlsOutputSettings' :: Maybe HlsH265PackagingType
h265PackagingType = Maybe HlsH265PackagingType
a} :: HlsOutputSettings)
hlsOutputSettings_segmentModifier :: Lens.Lens' HlsOutputSettings (Prelude.Maybe Prelude.Text)
hlsOutputSettings_segmentModifier :: (Maybe Text -> f (Maybe Text))
-> HlsOutputSettings -> f HlsOutputSettings
hlsOutputSettings_segmentModifier = (HlsOutputSettings -> Maybe Text)
-> (HlsOutputSettings -> Maybe Text -> HlsOutputSettings)
-> Lens
HlsOutputSettings HlsOutputSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsOutputSettings' {Maybe Text
segmentModifier :: Maybe Text
$sel:segmentModifier:HlsOutputSettings' :: HlsOutputSettings -> Maybe Text
segmentModifier} -> Maybe Text
segmentModifier) (\s :: HlsOutputSettings
s@HlsOutputSettings' {} Maybe Text
a -> HlsOutputSettings
s {$sel:segmentModifier:HlsOutputSettings' :: Maybe Text
segmentModifier = Maybe Text
a} :: HlsOutputSettings)
hlsOutputSettings_nameModifier :: Lens.Lens' HlsOutputSettings (Prelude.Maybe Prelude.Text)
hlsOutputSettings_nameModifier :: (Maybe Text -> f (Maybe Text))
-> HlsOutputSettings -> f HlsOutputSettings
hlsOutputSettings_nameModifier = (HlsOutputSettings -> Maybe Text)
-> (HlsOutputSettings -> Maybe Text -> HlsOutputSettings)
-> Lens
HlsOutputSettings HlsOutputSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsOutputSettings' {Maybe Text
nameModifier :: Maybe Text
$sel:nameModifier:HlsOutputSettings' :: HlsOutputSettings -> Maybe Text
nameModifier} -> Maybe Text
nameModifier) (\s :: HlsOutputSettings
s@HlsOutputSettings' {} Maybe Text
a -> HlsOutputSettings
s {$sel:nameModifier:HlsOutputSettings' :: Maybe Text
nameModifier = Maybe Text
a} :: HlsOutputSettings)
hlsOutputSettings_hlsSettings :: Lens.Lens' HlsOutputSettings HlsSettings
hlsOutputSettings_hlsSettings :: (HlsSettings -> f HlsSettings)
-> HlsOutputSettings -> f HlsOutputSettings
hlsOutputSettings_hlsSettings = (HlsOutputSettings -> HlsSettings)
-> (HlsOutputSettings -> HlsSettings -> HlsOutputSettings)
-> Lens HlsOutputSettings HlsOutputSettings HlsSettings HlsSettings
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsOutputSettings' {HlsSettings
hlsSettings :: HlsSettings
$sel:hlsSettings:HlsOutputSettings' :: HlsOutputSettings -> HlsSettings
hlsSettings} -> HlsSettings
hlsSettings) (\s :: HlsOutputSettings
s@HlsOutputSettings' {} HlsSettings
a -> HlsOutputSettings
s {$sel:hlsSettings:HlsOutputSettings' :: HlsSettings
hlsSettings = HlsSettings
a} :: HlsOutputSettings)
instance Core.FromJSON HlsOutputSettings where
parseJSON :: Value -> Parser HlsOutputSettings
parseJSON =
String
-> (Object -> Parser HlsOutputSettings)
-> Value
-> Parser HlsOutputSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HlsOutputSettings"
( \Object
x ->
Maybe HlsH265PackagingType
-> Maybe Text -> Maybe Text -> HlsSettings -> HlsOutputSettings
HlsOutputSettings'
(Maybe HlsH265PackagingType
-> Maybe Text -> Maybe Text -> HlsSettings -> HlsOutputSettings)
-> Parser (Maybe HlsH265PackagingType)
-> Parser
(Maybe Text -> Maybe Text -> HlsSettings -> HlsOutputSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe HlsH265PackagingType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"h265PackagingType")
Parser
(Maybe Text -> Maybe Text -> HlsSettings -> HlsOutputSettings)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> HlsSettings -> HlsOutputSettings)
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
"segmentModifier")
Parser (Maybe Text -> HlsSettings -> HlsOutputSettings)
-> Parser (Maybe Text) -> Parser (HlsSettings -> HlsOutputSettings)
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
"nameModifier")
Parser (HlsSettings -> HlsOutputSettings)
-> Parser HlsSettings -> Parser HlsOutputSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser HlsSettings
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"hlsSettings")
)
instance Prelude.Hashable HlsOutputSettings
instance Prelude.NFData HlsOutputSettings
instance Core.ToJSON HlsOutputSettings where
toJSON :: HlsOutputSettings -> Value
toJSON HlsOutputSettings' {Maybe Text
Maybe HlsH265PackagingType
HlsSettings
hlsSettings :: HlsSettings
nameModifier :: Maybe Text
segmentModifier :: Maybe Text
h265PackagingType :: Maybe HlsH265PackagingType
$sel:hlsSettings:HlsOutputSettings' :: HlsOutputSettings -> HlsSettings
$sel:nameModifier:HlsOutputSettings' :: HlsOutputSettings -> Maybe Text
$sel:segmentModifier:HlsOutputSettings' :: HlsOutputSettings -> Maybe Text
$sel:h265PackagingType:HlsOutputSettings' :: HlsOutputSettings -> Maybe HlsH265PackagingType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"h265PackagingType" Text -> HlsH265PackagingType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HlsH265PackagingType -> Pair)
-> Maybe HlsH265PackagingType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HlsH265PackagingType
h265PackagingType,
(Text
"segmentModifier" 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
segmentModifier,
(Text
"nameModifier" 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
nameModifier,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"hlsSettings" Text -> HlsSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HlsSettings
hlsSettings)
]
)