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