{-# 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.Lens as Lens
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 Int
height :: Prelude.Maybe Prelude.Int,
VideoDescription -> Maybe Natural
sharpness :: Prelude.Maybe Prelude.Natural,
VideoDescription -> Maybe Int
width :: Prelude.Maybe Prelude.Int,
VideoDescription -> Maybe VideoDescriptionScalingBehavior
scalingBehavior :: Prelude.Maybe VideoDescriptionScalingBehavior,
VideoDescription -> Maybe VideoDescriptionRespondToAfd
respondToAfd :: Prelude.Maybe VideoDescriptionRespondToAfd,
VideoDescription -> Maybe VideoCodecSettings
codecSettings :: Prelude.Maybe VideoCodecSettings,
VideoDescription -> Text
name :: Prelude.Text
}
deriving (VideoDescription -> VideoDescription -> Bool
(VideoDescription -> VideoDescription -> Bool)
-> (VideoDescription -> VideoDescription -> Bool)
-> Eq VideoDescription
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]
(Int -> ReadS VideoDescription)
-> ReadS [VideoDescription]
-> ReadPrec VideoDescription
-> ReadPrec [VideoDescription]
-> Read 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
(Int -> VideoDescription -> ShowS)
-> (VideoDescription -> String)
-> ([VideoDescription] -> ShowS)
-> Show VideoDescription
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. VideoDescription -> Rep VideoDescription x)
-> (forall x. Rep VideoDescription x -> VideoDescription)
-> Generic VideoDescription
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' :: Maybe Int
-> Maybe Natural
-> Maybe Int
-> Maybe VideoDescriptionScalingBehavior
-> Maybe VideoDescriptionRespondToAfd
-> Maybe VideoCodecSettings
-> Text
-> VideoDescription
VideoDescription'
{ $sel:height:VideoDescription' :: Maybe Int
height = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:sharpness:VideoDescription' :: Maybe Natural
sharpness = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:width:VideoDescription' :: Maybe Int
width = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:scalingBehavior:VideoDescription' :: Maybe VideoDescriptionScalingBehavior
scalingBehavior = Maybe VideoDescriptionScalingBehavior
forall a. Maybe a
Prelude.Nothing,
$sel:respondToAfd:VideoDescription' :: Maybe VideoDescriptionRespondToAfd
respondToAfd = Maybe VideoDescriptionRespondToAfd
forall a. Maybe a
Prelude.Nothing,
$sel:codecSettings:VideoDescription' :: Maybe VideoCodecSettings
codecSettings = Maybe VideoCodecSettings
forall a. Maybe a
Prelude.Nothing,
$sel:name:VideoDescription' :: Text
name = Text
pName_
}
videoDescription_height :: Lens.Lens' VideoDescription (Prelude.Maybe Prelude.Int)
videoDescription_height :: (Maybe Int -> f (Maybe Int))
-> VideoDescription -> f VideoDescription
videoDescription_height = (VideoDescription -> Maybe Int)
-> (VideoDescription -> Maybe Int -> VideoDescription)
-> Lens VideoDescription VideoDescription (Maybe Int) (Maybe Int)
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_sharpness :: Lens.Lens' VideoDescription (Prelude.Maybe Prelude.Natural)
videoDescription_sharpness :: (Maybe Natural -> f (Maybe Natural))
-> VideoDescription -> f VideoDescription
videoDescription_sharpness = (VideoDescription -> Maybe Natural)
-> (VideoDescription -> Maybe Natural -> VideoDescription)
-> Lens
VideoDescription VideoDescription (Maybe Natural) (Maybe Natural)
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 :: (Maybe Int -> f (Maybe Int))
-> VideoDescription -> f VideoDescription
videoDescription_width = (VideoDescription -> Maybe Int)
-> (VideoDescription -> Maybe Int -> VideoDescription)
-> Lens VideoDescription VideoDescription (Maybe Int) (Maybe Int)
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_scalingBehavior :: Lens.Lens' VideoDescription (Prelude.Maybe VideoDescriptionScalingBehavior)
videoDescription_scalingBehavior :: (Maybe VideoDescriptionScalingBehavior
-> f (Maybe VideoDescriptionScalingBehavior))
-> VideoDescription -> f VideoDescription
videoDescription_scalingBehavior = (VideoDescription -> Maybe VideoDescriptionScalingBehavior)
-> (VideoDescription
-> Maybe VideoDescriptionScalingBehavior -> VideoDescription)
-> Lens
VideoDescription
VideoDescription
(Maybe VideoDescriptionScalingBehavior)
(Maybe VideoDescriptionScalingBehavior)
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_respondToAfd :: Lens.Lens' VideoDescription (Prelude.Maybe VideoDescriptionRespondToAfd)
videoDescription_respondToAfd :: (Maybe VideoDescriptionRespondToAfd
-> f (Maybe VideoDescriptionRespondToAfd))
-> VideoDescription -> f VideoDescription
videoDescription_respondToAfd = (VideoDescription -> Maybe VideoDescriptionRespondToAfd)
-> (VideoDescription
-> Maybe VideoDescriptionRespondToAfd -> VideoDescription)
-> Lens
VideoDescription
VideoDescription
(Maybe VideoDescriptionRespondToAfd)
(Maybe VideoDescriptionRespondToAfd)
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_codecSettings :: Lens.Lens' VideoDescription (Prelude.Maybe VideoCodecSettings)
videoDescription_codecSettings :: (Maybe VideoCodecSettings -> f (Maybe VideoCodecSettings))
-> VideoDescription -> f VideoDescription
videoDescription_codecSettings = (VideoDescription -> Maybe VideoCodecSettings)
-> (VideoDescription
-> Maybe VideoCodecSettings -> VideoDescription)
-> Lens
VideoDescription
VideoDescription
(Maybe VideoCodecSettings)
(Maybe VideoCodecSettings)
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_name :: Lens.Lens' VideoDescription Prelude.Text
videoDescription_name :: (Text -> f Text) -> VideoDescription -> f VideoDescription
videoDescription_name = (VideoDescription -> Text)
-> (VideoDescription -> Text -> VideoDescription)
-> Lens VideoDescription VideoDescription Text Text
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 Core.FromJSON VideoDescription where
parseJSON :: Value -> Parser VideoDescription
parseJSON =
String
-> (Object -> Parser VideoDescription)
-> Value
-> Parser VideoDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"VideoDescription"
( \Object
x ->
Maybe Int
-> Maybe Natural
-> Maybe Int
-> Maybe VideoDescriptionScalingBehavior
-> Maybe VideoDescriptionRespondToAfd
-> Maybe VideoCodecSettings
-> Text
-> VideoDescription
VideoDescription'
(Maybe Int
-> Maybe Natural
-> Maybe Int
-> Maybe VideoDescriptionScalingBehavior
-> Maybe VideoDescriptionRespondToAfd
-> Maybe VideoCodecSettings
-> Text
-> VideoDescription)
-> Parser (Maybe Int)
-> Parser
(Maybe Natural
-> Maybe Int
-> Maybe VideoDescriptionScalingBehavior
-> Maybe VideoDescriptionRespondToAfd
-> Maybe VideoCodecSettings
-> Text
-> VideoDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"height")
Parser
(Maybe Natural
-> Maybe Int
-> Maybe VideoDescriptionScalingBehavior
-> Maybe VideoDescriptionRespondToAfd
-> Maybe VideoCodecSettings
-> Text
-> VideoDescription)
-> Parser (Maybe Natural)
-> Parser
(Maybe Int
-> Maybe VideoDescriptionScalingBehavior
-> Maybe VideoDescriptionRespondToAfd
-> Maybe VideoCodecSettings
-> Text
-> VideoDescription)
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
"sharpness")
Parser
(Maybe Int
-> Maybe VideoDescriptionScalingBehavior
-> Maybe VideoDescriptionRespondToAfd
-> Maybe VideoCodecSettings
-> Text
-> VideoDescription)
-> Parser (Maybe Int)
-> Parser
(Maybe VideoDescriptionScalingBehavior
-> Maybe VideoDescriptionRespondToAfd
-> Maybe VideoCodecSettings
-> Text
-> VideoDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"width")
Parser
(Maybe VideoDescriptionScalingBehavior
-> Maybe VideoDescriptionRespondToAfd
-> Maybe VideoCodecSettings
-> Text
-> VideoDescription)
-> Parser (Maybe VideoDescriptionScalingBehavior)
-> Parser
(Maybe VideoDescriptionRespondToAfd
-> Maybe VideoCodecSettings -> Text -> VideoDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VideoDescriptionScalingBehavior)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scalingBehavior")
Parser
(Maybe VideoDescriptionRespondToAfd
-> Maybe VideoCodecSettings -> Text -> VideoDescription)
-> Parser (Maybe VideoDescriptionRespondToAfd)
-> Parser (Maybe VideoCodecSettings -> Text -> VideoDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VideoDescriptionRespondToAfd)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"respondToAfd")
Parser (Maybe VideoCodecSettings -> Text -> VideoDescription)
-> Parser (Maybe VideoCodecSettings)
-> Parser (Text -> VideoDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VideoCodecSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"codecSettings")
Parser (Text -> VideoDescription)
-> Parser Text -> Parser VideoDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
)
instance Prelude.Hashable VideoDescription
instance Prelude.NFData VideoDescription
instance Core.ToJSON VideoDescription where
toJSON :: VideoDescription -> Value
toJSON VideoDescription' {Maybe Int
Maybe Natural
Maybe VideoCodecSettings
Maybe VideoDescriptionRespondToAfd
Maybe VideoDescriptionScalingBehavior
Text
name :: Text
codecSettings :: Maybe VideoCodecSettings
respondToAfd :: Maybe VideoDescriptionRespondToAfd
scalingBehavior :: Maybe VideoDescriptionScalingBehavior
width :: Maybe Int
sharpness :: Maybe Natural
height :: Maybe Int
$sel:name:VideoDescription' :: VideoDescription -> Text
$sel:codecSettings:VideoDescription' :: VideoDescription -> Maybe VideoCodecSettings
$sel:respondToAfd:VideoDescription' :: VideoDescription -> Maybe VideoDescriptionRespondToAfd
$sel:scalingBehavior:VideoDescription' :: VideoDescription -> Maybe VideoDescriptionScalingBehavior
$sel:width:VideoDescription' :: VideoDescription -> Maybe Int
$sel:sharpness:VideoDescription' :: VideoDescription -> Maybe Natural
$sel:height:VideoDescription' :: VideoDescription -> Maybe Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"height" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
height,
(Text
"sharpness" 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
sharpness,
(Text
"width" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
width,
(Text
"scalingBehavior" Text -> VideoDescriptionScalingBehavior -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(VideoDescriptionScalingBehavior -> Pair)
-> Maybe VideoDescriptionScalingBehavior -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VideoDescriptionScalingBehavior
scalingBehavior,
(Text
"respondToAfd" Text -> VideoDescriptionRespondToAfd -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VideoDescriptionRespondToAfd -> Pair)
-> Maybe VideoDescriptionRespondToAfd -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VideoDescriptionRespondToAfd
respondToAfd,
(Text
"codecSettings" Text -> VideoCodecSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VideoCodecSettings -> Pair)
-> Maybe VideoCodecSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VideoCodecSettings
codecSettings,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
]
)