{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types.AutomatedAbrRule
import qualified Amazonka.Prelude as Prelude
data AutomatedAbrSettings = AutomatedAbrSettings'
{
AutomatedAbrSettings -> Maybe Natural
maxAbrBitrate :: Prelude.Maybe Prelude.Natural,
AutomatedAbrSettings -> Maybe Natural
maxRenditions :: Prelude.Maybe Prelude.Natural,
AutomatedAbrSettings -> Maybe Natural
minAbrBitrate :: Prelude.Maybe Prelude.Natural,
AutomatedAbrSettings -> Maybe [AutomatedAbrRule]
rules :: Prelude.Maybe [AutomatedAbrRule]
}
deriving (AutomatedAbrSettings -> AutomatedAbrSettings -> Bool
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]
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
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. 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'
{ $sel:maxAbrBitrate:AutomatedAbrSettings' :: Maybe Natural
maxAbrBitrate =
forall a. Maybe a
Prelude.Nothing,
$sel:maxRenditions:AutomatedAbrSettings' :: Maybe Natural
maxRenditions = forall a. Maybe a
Prelude.Nothing,
$sel:minAbrBitrate:AutomatedAbrSettings' :: Maybe Natural
minAbrBitrate = forall a. Maybe a
Prelude.Nothing,
$sel:rules:AutomatedAbrSettings' :: Maybe [AutomatedAbrRule]
rules = forall a. Maybe a
Prelude.Nothing
}
automatedAbrSettings_maxAbrBitrate :: Lens.Lens' AutomatedAbrSettings (Prelude.Maybe Prelude.Natural)
automatedAbrSettings_maxAbrBitrate :: Lens' AutomatedAbrSettings (Maybe Natural)
automatedAbrSettings_maxAbrBitrate = 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_maxRenditions :: Lens.Lens' AutomatedAbrSettings (Prelude.Maybe Prelude.Natural)
automatedAbrSettings_maxRenditions :: Lens' AutomatedAbrSettings (Maybe Natural)
automatedAbrSettings_maxRenditions = 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_minAbrBitrate :: Lens.Lens' AutomatedAbrSettings (Prelude.Maybe Prelude.Natural)
automatedAbrSettings_minAbrBitrate :: Lens' AutomatedAbrSettings (Maybe Natural)
automatedAbrSettings_minAbrBitrate = 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)
automatedAbrSettings_rules :: Lens.Lens' AutomatedAbrSettings (Prelude.Maybe [AutomatedAbrRule])
automatedAbrSettings_rules :: Lens' AutomatedAbrSettings (Maybe [AutomatedAbrRule])
automatedAbrSettings_rules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutomatedAbrSettings' {Maybe [AutomatedAbrRule]
rules :: Maybe [AutomatedAbrRule]
$sel:rules:AutomatedAbrSettings' :: AutomatedAbrSettings -> Maybe [AutomatedAbrRule]
rules} -> Maybe [AutomatedAbrRule]
rules) (\s :: AutomatedAbrSettings
s@AutomatedAbrSettings' {} Maybe [AutomatedAbrRule]
a -> AutomatedAbrSettings
s {$sel:rules:AutomatedAbrSettings' :: Maybe [AutomatedAbrRule]
rules = Maybe [AutomatedAbrRule]
a} :: AutomatedAbrSettings) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON AutomatedAbrSettings where
parseJSON :: Value -> Parser AutomatedAbrSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AutomatedAbrSettings"
( \Object
x ->
Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe [AutomatedAbrRule]
-> AutomatedAbrSettings
AutomatedAbrSettings'
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
"maxAbrBitrate")
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
"maxRenditions")
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
"minAbrBitrate")
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
"rules" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable AutomatedAbrSettings where
hashWithSalt :: Int -> AutomatedAbrSettings -> Int
hashWithSalt Int
_salt AutomatedAbrSettings' {Maybe Natural
Maybe [AutomatedAbrRule]
rules :: Maybe [AutomatedAbrRule]
minAbrBitrate :: Maybe Natural
maxRenditions :: Maybe Natural
maxAbrBitrate :: Maybe Natural
$sel:rules:AutomatedAbrSettings' :: AutomatedAbrSettings -> Maybe [AutomatedAbrRule]
$sel:minAbrBitrate:AutomatedAbrSettings' :: AutomatedAbrSettings -> Maybe Natural
$sel:maxRenditions:AutomatedAbrSettings' :: AutomatedAbrSettings -> Maybe Natural
$sel:maxAbrBitrate:AutomatedAbrSettings' :: AutomatedAbrSettings -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxAbrBitrate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxRenditions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
minAbrBitrate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AutomatedAbrRule]
rules
instance Prelude.NFData AutomatedAbrSettings where
rnf :: AutomatedAbrSettings -> ()
rnf AutomatedAbrSettings' {Maybe Natural
Maybe [AutomatedAbrRule]
rules :: Maybe [AutomatedAbrRule]
minAbrBitrate :: Maybe Natural
maxRenditions :: Maybe Natural
maxAbrBitrate :: Maybe Natural
$sel:rules:AutomatedAbrSettings' :: AutomatedAbrSettings -> Maybe [AutomatedAbrRule]
$sel:minAbrBitrate:AutomatedAbrSettings' :: AutomatedAbrSettings -> Maybe Natural
$sel:maxRenditions:AutomatedAbrSettings' :: AutomatedAbrSettings -> Maybe Natural
$sel:maxAbrBitrate:AutomatedAbrSettings' :: AutomatedAbrSettings -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxAbrBitrate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxRenditions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
minAbrBitrate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [AutomatedAbrRule]
rules
instance Data.ToJSON AutomatedAbrSettings where
toJSON :: AutomatedAbrSettings -> Value
toJSON AutomatedAbrSettings' {Maybe Natural
Maybe [AutomatedAbrRule]
rules :: Maybe [AutomatedAbrRule]
minAbrBitrate :: Maybe Natural
maxRenditions :: Maybe Natural
maxAbrBitrate :: Maybe Natural
$sel:rules:AutomatedAbrSettings' :: AutomatedAbrSettings -> Maybe [AutomatedAbrRule]
$sel:minAbrBitrate:AutomatedAbrSettings' :: AutomatedAbrSettings -> Maybe Natural
$sel:maxRenditions:AutomatedAbrSettings' :: AutomatedAbrSettings -> Maybe Natural
$sel:maxAbrBitrate:AutomatedAbrSettings' :: AutomatedAbrSettings -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"maxAbrBitrate" 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 Natural
maxAbrBitrate,
(Key
"maxRenditions" 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 Natural
maxRenditions,
(Key
"minAbrBitrate" 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 Natural
minAbrBitrate,
(Key
"rules" 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 [AutomatedAbrRule]
rules
]
)