{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
nameModifier :: Prelude.Maybe Prelude.Text,
HlsOutputSettings -> Maybe Text
segmentModifier :: Prelude.Maybe Prelude.Text,
HlsOutputSettings -> HlsSettings
hlsSettings :: HlsSettings
}
deriving (HlsOutputSettings -> HlsOutputSettings -> Bool
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]
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
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. 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'
{ $sel:h265PackagingType:HlsOutputSettings' :: Maybe HlsH265PackagingType
h265PackagingType =
forall a. Maybe a
Prelude.Nothing,
$sel:nameModifier:HlsOutputSettings' :: Maybe Text
nameModifier = forall a. Maybe a
Prelude.Nothing,
$sel:segmentModifier:HlsOutputSettings' :: Maybe Text
segmentModifier = forall a. Maybe a
Prelude.Nothing,
$sel:hlsSettings:HlsOutputSettings' :: HlsSettings
hlsSettings = HlsSettings
pHlsSettings_
}
hlsOutputSettings_h265PackagingType :: Lens.Lens' HlsOutputSettings (Prelude.Maybe HlsH265PackagingType)
hlsOutputSettings_h265PackagingType :: Lens' HlsOutputSettings (Maybe HlsH265PackagingType)
hlsOutputSettings_h265PackagingType = 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_nameModifier :: Lens.Lens' HlsOutputSettings (Prelude.Maybe Prelude.Text)
hlsOutputSettings_nameModifier :: Lens' HlsOutputSettings (Maybe Text)
hlsOutputSettings_nameModifier = 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_segmentModifier :: Lens.Lens' HlsOutputSettings (Prelude.Maybe Prelude.Text)
hlsOutputSettings_segmentModifier :: Lens' HlsOutputSettings (Maybe Text)
hlsOutputSettings_segmentModifier = 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_hlsSettings :: Lens.Lens' HlsOutputSettings HlsSettings
hlsOutputSettings_hlsSettings :: Lens' HlsOutputSettings HlsSettings
hlsOutputSettings_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 Data.FromJSON HlsOutputSettings where
parseJSON :: Value -> Parser HlsOutputSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"HlsOutputSettings"
( \Object
x ->
Maybe HlsH265PackagingType
-> Maybe Text -> Maybe Text -> HlsSettings -> HlsOutputSettings
HlsOutputSettings'
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
"h265PackagingType")
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
"nameModifier")
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
"segmentModifier")
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
"hlsSettings")
)
instance Prelude.Hashable HlsOutputSettings where
hashWithSalt :: Int -> HlsOutputSettings -> Int
hashWithSalt Int
_salt HlsOutputSettings' {Maybe Text
Maybe HlsH265PackagingType
HlsSettings
hlsSettings :: HlsSettings
segmentModifier :: Maybe Text
nameModifier :: Maybe Text
h265PackagingType :: Maybe HlsH265PackagingType
$sel:hlsSettings:HlsOutputSettings' :: HlsOutputSettings -> HlsSettings
$sel:segmentModifier:HlsOutputSettings' :: HlsOutputSettings -> Maybe Text
$sel:nameModifier:HlsOutputSettings' :: HlsOutputSettings -> Maybe Text
$sel:h265PackagingType:HlsOutputSettings' :: HlsOutputSettings -> Maybe HlsH265PackagingType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HlsH265PackagingType
h265PackagingType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nameModifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
segmentModifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HlsSettings
hlsSettings
instance Prelude.NFData HlsOutputSettings where
rnf :: HlsOutputSettings -> ()
rnf HlsOutputSettings' {Maybe Text
Maybe HlsH265PackagingType
HlsSettings
hlsSettings :: HlsSettings
segmentModifier :: Maybe Text
nameModifier :: Maybe Text
h265PackagingType :: Maybe HlsH265PackagingType
$sel:hlsSettings:HlsOutputSettings' :: HlsOutputSettings -> HlsSettings
$sel:segmentModifier:HlsOutputSettings' :: HlsOutputSettings -> Maybe Text
$sel:nameModifier:HlsOutputSettings' :: HlsOutputSettings -> Maybe Text
$sel:h265PackagingType:HlsOutputSettings' :: HlsOutputSettings -> Maybe HlsH265PackagingType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe HlsH265PackagingType
h265PackagingType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nameModifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
segmentModifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HlsSettings
hlsSettings
instance Data.ToJSON HlsOutputSettings where
toJSON :: HlsOutputSettings -> Value
toJSON HlsOutputSettings' {Maybe Text
Maybe HlsH265PackagingType
HlsSettings
hlsSettings :: HlsSettings
segmentModifier :: Maybe Text
nameModifier :: Maybe Text
h265PackagingType :: Maybe HlsH265PackagingType
$sel:hlsSettings:HlsOutputSettings' :: HlsOutputSettings -> HlsSettings
$sel:segmentModifier:HlsOutputSettings' :: HlsOutputSettings -> Maybe Text
$sel:nameModifier:HlsOutputSettings' :: HlsOutputSettings -> Maybe Text
$sel:h265PackagingType:HlsOutputSettings' :: HlsOutputSettings -> Maybe HlsH265PackagingType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"h265PackagingType" 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 HlsH265PackagingType
h265PackagingType,
(Key
"nameModifier" 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
nameModifier,
(Key
"segmentModifier" 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
segmentModifier,
forall a. a -> Maybe a
Prelude.Just (Key
"hlsSettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HlsSettings
hlsSettings)
]
)