{-# 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.VideoDescription 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.VideoCodecSettings
import Amazonka.MediaLive.Types.VideoDescriptionRespondToAfd
import Amazonka.MediaLive.Types.VideoDescriptionScalingBehavior
import qualified Amazonka.Prelude as Prelude
data VideoDescription = VideoDescription'
{
VideoDescription -> Maybe VideoCodecSettings
codecSettings :: Prelude.Maybe VideoCodecSettings,
VideoDescription -> Maybe Int
height :: Prelude.Maybe Prelude.Int,
VideoDescription -> Maybe VideoDescriptionRespondToAfd
respondToAfd :: Prelude.Maybe VideoDescriptionRespondToAfd,
VideoDescription -> Maybe VideoDescriptionScalingBehavior
scalingBehavior :: Prelude.Maybe VideoDescriptionScalingBehavior,
VideoDescription -> Maybe Natural
sharpness :: Prelude.Maybe Prelude.Natural,
VideoDescription -> Maybe Int
width :: Prelude.Maybe Prelude.Int,
VideoDescription -> Text
name :: Prelude.Text
}
deriving (VideoDescription -> VideoDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VideoDescription -> VideoDescription -> Bool
$c/= :: VideoDescription -> VideoDescription -> Bool
== :: VideoDescription -> VideoDescription -> Bool
$c== :: VideoDescription -> VideoDescription -> Bool
Prelude.Eq, ReadPrec [VideoDescription]
ReadPrec VideoDescription
Int -> ReadS VideoDescription
ReadS [VideoDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VideoDescription]
$creadListPrec :: ReadPrec [VideoDescription]
readPrec :: ReadPrec VideoDescription
$creadPrec :: ReadPrec VideoDescription
readList :: ReadS [VideoDescription]
$creadList :: ReadS [VideoDescription]
readsPrec :: Int -> ReadS VideoDescription
$creadsPrec :: Int -> ReadS VideoDescription
Prelude.Read, Int -> VideoDescription -> ShowS
[VideoDescription] -> ShowS
VideoDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VideoDescription] -> ShowS
$cshowList :: [VideoDescription] -> ShowS
show :: VideoDescription -> String
$cshow :: VideoDescription -> String
showsPrec :: Int -> VideoDescription -> ShowS
$cshowsPrec :: Int -> VideoDescription -> ShowS
Prelude.Show, forall x. Rep VideoDescription x -> VideoDescription
forall x. VideoDescription -> Rep VideoDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VideoDescription x -> VideoDescription
$cfrom :: forall x. VideoDescription -> Rep VideoDescription x
Prelude.Generic)
newVideoDescription ::
Prelude.Text ->
VideoDescription
newVideoDescription :: Text -> VideoDescription
newVideoDescription Text
pName_ =
VideoDescription'
{ $sel:codecSettings:VideoDescription' :: Maybe VideoCodecSettings
codecSettings = forall a. Maybe a
Prelude.Nothing,
$sel:height:VideoDescription' :: Maybe Int
height = forall a. Maybe a
Prelude.Nothing,
$sel:respondToAfd:VideoDescription' :: Maybe VideoDescriptionRespondToAfd
respondToAfd = forall a. Maybe a
Prelude.Nothing,
$sel:scalingBehavior:VideoDescription' :: Maybe VideoDescriptionScalingBehavior
scalingBehavior = forall a. Maybe a
Prelude.Nothing,
$sel:sharpness:VideoDescription' :: Maybe Natural
sharpness = forall a. Maybe a
Prelude.Nothing,
$sel:width:VideoDescription' :: Maybe Int
width = forall a. Maybe a
Prelude.Nothing,
$sel:name:VideoDescription' :: Text
name = Text
pName_
}
videoDescription_codecSettings :: Lens.Lens' VideoDescription (Prelude.Maybe VideoCodecSettings)
videoDescription_codecSettings :: Lens' VideoDescription (Maybe VideoCodecSettings)
videoDescription_codecSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoDescription' {Maybe VideoCodecSettings
codecSettings :: Maybe VideoCodecSettings
$sel:codecSettings:VideoDescription' :: VideoDescription -> Maybe VideoCodecSettings
codecSettings} -> Maybe VideoCodecSettings
codecSettings) (\s :: VideoDescription
s@VideoDescription' {} Maybe VideoCodecSettings
a -> VideoDescription
s {$sel:codecSettings:VideoDescription' :: Maybe VideoCodecSettings
codecSettings = Maybe VideoCodecSettings
a} :: VideoDescription)
videoDescription_height :: Lens.Lens' VideoDescription (Prelude.Maybe Prelude.Int)
videoDescription_height :: Lens' VideoDescription (Maybe Int)
videoDescription_height = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoDescription' {Maybe Int
height :: Maybe Int
$sel:height:VideoDescription' :: VideoDescription -> Maybe Int
height} -> Maybe Int
height) (\s :: VideoDescription
s@VideoDescription' {} Maybe Int
a -> VideoDescription
s {$sel:height:VideoDescription' :: Maybe Int
height = Maybe Int
a} :: VideoDescription)
videoDescription_respondToAfd :: Lens.Lens' VideoDescription (Prelude.Maybe VideoDescriptionRespondToAfd)
videoDescription_respondToAfd :: Lens' VideoDescription (Maybe VideoDescriptionRespondToAfd)
videoDescription_respondToAfd = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoDescription' {Maybe VideoDescriptionRespondToAfd
respondToAfd :: Maybe VideoDescriptionRespondToAfd
$sel:respondToAfd:VideoDescription' :: VideoDescription -> Maybe VideoDescriptionRespondToAfd
respondToAfd} -> Maybe VideoDescriptionRespondToAfd
respondToAfd) (\s :: VideoDescription
s@VideoDescription' {} Maybe VideoDescriptionRespondToAfd
a -> VideoDescription
s {$sel:respondToAfd:VideoDescription' :: Maybe VideoDescriptionRespondToAfd
respondToAfd = Maybe VideoDescriptionRespondToAfd
a} :: VideoDescription)
videoDescription_scalingBehavior :: Lens.Lens' VideoDescription (Prelude.Maybe VideoDescriptionScalingBehavior)
videoDescription_scalingBehavior :: Lens' VideoDescription (Maybe VideoDescriptionScalingBehavior)
videoDescription_scalingBehavior = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoDescription' {Maybe VideoDescriptionScalingBehavior
scalingBehavior :: Maybe VideoDescriptionScalingBehavior
$sel:scalingBehavior:VideoDescription' :: VideoDescription -> Maybe VideoDescriptionScalingBehavior
scalingBehavior} -> Maybe VideoDescriptionScalingBehavior
scalingBehavior) (\s :: VideoDescription
s@VideoDescription' {} Maybe VideoDescriptionScalingBehavior
a -> VideoDescription
s {$sel:scalingBehavior:VideoDescription' :: Maybe VideoDescriptionScalingBehavior
scalingBehavior = Maybe VideoDescriptionScalingBehavior
a} :: VideoDescription)
videoDescription_sharpness :: Lens.Lens' VideoDescription (Prelude.Maybe Prelude.Natural)
videoDescription_sharpness :: Lens' VideoDescription (Maybe Natural)
videoDescription_sharpness = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoDescription' {Maybe Natural
sharpness :: Maybe Natural
$sel:sharpness:VideoDescription' :: VideoDescription -> Maybe Natural
sharpness} -> Maybe Natural
sharpness) (\s :: VideoDescription
s@VideoDescription' {} Maybe Natural
a -> VideoDescription
s {$sel:sharpness:VideoDescription' :: Maybe Natural
sharpness = Maybe Natural
a} :: VideoDescription)
videoDescription_width :: Lens.Lens' VideoDescription (Prelude.Maybe Prelude.Int)
videoDescription_width :: Lens' VideoDescription (Maybe Int)
videoDescription_width = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoDescription' {Maybe Int
width :: Maybe Int
$sel:width:VideoDescription' :: VideoDescription -> Maybe Int
width} -> Maybe Int
width) (\s :: VideoDescription
s@VideoDescription' {} Maybe Int
a -> VideoDescription
s {$sel:width:VideoDescription' :: Maybe Int
width = Maybe Int
a} :: VideoDescription)
videoDescription_name :: Lens.Lens' VideoDescription Prelude.Text
videoDescription_name :: Lens' VideoDescription Text
videoDescription_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoDescription' {Text
name :: Text
$sel:name:VideoDescription' :: VideoDescription -> Text
name} -> Text
name) (\s :: VideoDescription
s@VideoDescription' {} Text
a -> VideoDescription
s {$sel:name:VideoDescription' :: Text
name = Text
a} :: VideoDescription)
instance Data.FromJSON VideoDescription where
parseJSON :: Value -> Parser VideoDescription
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"VideoDescription"
( \Object
x ->
Maybe VideoCodecSettings
-> Maybe Int
-> Maybe VideoDescriptionRespondToAfd
-> Maybe VideoDescriptionScalingBehavior
-> Maybe Natural
-> Maybe Int
-> Text
-> VideoDescription
VideoDescription'
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
"codecSettings")
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
"height")
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
"respondToAfd")
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
"scalingBehavior")
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
"sharpness")
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
"width")
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
"name")
)
instance Prelude.Hashable VideoDescription where
hashWithSalt :: Int -> VideoDescription -> Int
hashWithSalt Int
_salt VideoDescription' {Maybe Int
Maybe Natural
Maybe VideoCodecSettings
Maybe VideoDescriptionRespondToAfd
Maybe VideoDescriptionScalingBehavior
Text
name :: Text
width :: Maybe Int
sharpness :: Maybe Natural
scalingBehavior :: Maybe VideoDescriptionScalingBehavior
respondToAfd :: Maybe VideoDescriptionRespondToAfd
height :: Maybe Int
codecSettings :: Maybe VideoCodecSettings
$sel:name:VideoDescription' :: VideoDescription -> Text
$sel:width:VideoDescription' :: VideoDescription -> Maybe Int
$sel:sharpness:VideoDescription' :: VideoDescription -> Maybe Natural
$sel:scalingBehavior:VideoDescription' :: VideoDescription -> Maybe VideoDescriptionScalingBehavior
$sel:respondToAfd:VideoDescription' :: VideoDescription -> Maybe VideoDescriptionRespondToAfd
$sel:height:VideoDescription' :: VideoDescription -> Maybe Int
$sel:codecSettings:VideoDescription' :: VideoDescription -> Maybe VideoCodecSettings
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VideoCodecSettings
codecSettings
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
height
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VideoDescriptionRespondToAfd
respondToAfd
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VideoDescriptionScalingBehavior
scalingBehavior
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
sharpness
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
width
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData VideoDescription where
rnf :: VideoDescription -> ()
rnf VideoDescription' {Maybe Int
Maybe Natural
Maybe VideoCodecSettings
Maybe VideoDescriptionRespondToAfd
Maybe VideoDescriptionScalingBehavior
Text
name :: Text
width :: Maybe Int
sharpness :: Maybe Natural
scalingBehavior :: Maybe VideoDescriptionScalingBehavior
respondToAfd :: Maybe VideoDescriptionRespondToAfd
height :: Maybe Int
codecSettings :: Maybe VideoCodecSettings
$sel:name:VideoDescription' :: VideoDescription -> Text
$sel:width:VideoDescription' :: VideoDescription -> Maybe Int
$sel:sharpness:VideoDescription' :: VideoDescription -> Maybe Natural
$sel:scalingBehavior:VideoDescription' :: VideoDescription -> Maybe VideoDescriptionScalingBehavior
$sel:respondToAfd:VideoDescription' :: VideoDescription -> Maybe VideoDescriptionRespondToAfd
$sel:height:VideoDescription' :: VideoDescription -> Maybe Int
$sel:codecSettings:VideoDescription' :: VideoDescription -> Maybe VideoCodecSettings
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe VideoCodecSettings
codecSettings
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
height
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VideoDescriptionRespondToAfd
respondToAfd
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VideoDescriptionScalingBehavior
scalingBehavior
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
sharpness
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
width
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToJSON VideoDescription where
toJSON :: VideoDescription -> Value
toJSON VideoDescription' {Maybe Int
Maybe Natural
Maybe VideoCodecSettings
Maybe VideoDescriptionRespondToAfd
Maybe VideoDescriptionScalingBehavior
Text
name :: Text
width :: Maybe Int
sharpness :: Maybe Natural
scalingBehavior :: Maybe VideoDescriptionScalingBehavior
respondToAfd :: Maybe VideoDescriptionRespondToAfd
height :: Maybe Int
codecSettings :: Maybe VideoCodecSettings
$sel:name:VideoDescription' :: VideoDescription -> Text
$sel:width:VideoDescription' :: VideoDescription -> Maybe Int
$sel:sharpness:VideoDescription' :: VideoDescription -> Maybe Natural
$sel:scalingBehavior:VideoDescription' :: VideoDescription -> Maybe VideoDescriptionScalingBehavior
$sel:respondToAfd:VideoDescription' :: VideoDescription -> Maybe VideoDescriptionRespondToAfd
$sel:height:VideoDescription' :: VideoDescription -> Maybe Int
$sel:codecSettings:VideoDescription' :: VideoDescription -> Maybe VideoCodecSettings
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"codecSettings" 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 VideoCodecSettings
codecSettings,
(Key
"height" 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 Int
height,
(Key
"respondToAfd" 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 VideoDescriptionRespondToAfd
respondToAfd,
(Key
"scalingBehavior" 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 VideoDescriptionScalingBehavior
scalingBehavior,
(Key
"sharpness" 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
sharpness,
(Key
"width" 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 Int
width,
forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
]
)