{-# 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.CaptionRectangle where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CaptionRectangle = CaptionRectangle'
{
CaptionRectangle -> Double
topOffset :: Prelude.Double,
CaptionRectangle -> Double
height :: Prelude.Double,
CaptionRectangle -> Double
width :: Prelude.Double,
CaptionRectangle -> Double
leftOffset :: Prelude.Double
}
deriving (CaptionRectangle -> CaptionRectangle -> Bool
(CaptionRectangle -> CaptionRectangle -> Bool)
-> (CaptionRectangle -> CaptionRectangle -> Bool)
-> Eq CaptionRectangle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CaptionRectangle -> CaptionRectangle -> Bool
$c/= :: CaptionRectangle -> CaptionRectangle -> Bool
== :: CaptionRectangle -> CaptionRectangle -> Bool
$c== :: CaptionRectangle -> CaptionRectangle -> Bool
Prelude.Eq, ReadPrec [CaptionRectangle]
ReadPrec CaptionRectangle
Int -> ReadS CaptionRectangle
ReadS [CaptionRectangle]
(Int -> ReadS CaptionRectangle)
-> ReadS [CaptionRectangle]
-> ReadPrec CaptionRectangle
-> ReadPrec [CaptionRectangle]
-> Read CaptionRectangle
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CaptionRectangle]
$creadListPrec :: ReadPrec [CaptionRectangle]
readPrec :: ReadPrec CaptionRectangle
$creadPrec :: ReadPrec CaptionRectangle
readList :: ReadS [CaptionRectangle]
$creadList :: ReadS [CaptionRectangle]
readsPrec :: Int -> ReadS CaptionRectangle
$creadsPrec :: Int -> ReadS CaptionRectangle
Prelude.Read, Int -> CaptionRectangle -> ShowS
[CaptionRectangle] -> ShowS
CaptionRectangle -> String
(Int -> CaptionRectangle -> ShowS)
-> (CaptionRectangle -> String)
-> ([CaptionRectangle] -> ShowS)
-> Show CaptionRectangle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CaptionRectangle] -> ShowS
$cshowList :: [CaptionRectangle] -> ShowS
show :: CaptionRectangle -> String
$cshow :: CaptionRectangle -> String
showsPrec :: Int -> CaptionRectangle -> ShowS
$cshowsPrec :: Int -> CaptionRectangle -> ShowS
Prelude.Show, (forall x. CaptionRectangle -> Rep CaptionRectangle x)
-> (forall x. Rep CaptionRectangle x -> CaptionRectangle)
-> Generic CaptionRectangle
forall x. Rep CaptionRectangle x -> CaptionRectangle
forall x. CaptionRectangle -> Rep CaptionRectangle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CaptionRectangle x -> CaptionRectangle
$cfrom :: forall x. CaptionRectangle -> Rep CaptionRectangle x
Prelude.Generic)
newCaptionRectangle ::
Prelude.Double ->
Prelude.Double ->
Prelude.Double ->
Prelude.Double ->
CaptionRectangle
newCaptionRectangle :: Double -> Double -> Double -> Double -> CaptionRectangle
newCaptionRectangle
Double
pTopOffset_
Double
pHeight_
Double
pWidth_
Double
pLeftOffset_ =
CaptionRectangle' :: Double -> Double -> Double -> Double -> CaptionRectangle
CaptionRectangle'
{ $sel:topOffset:CaptionRectangle' :: Double
topOffset = Double
pTopOffset_,
$sel:height:CaptionRectangle' :: Double
height = Double
pHeight_,
$sel:width:CaptionRectangle' :: Double
width = Double
pWidth_,
$sel:leftOffset:CaptionRectangle' :: Double
leftOffset = Double
pLeftOffset_
}
captionRectangle_topOffset :: Lens.Lens' CaptionRectangle Prelude.Double
captionRectangle_topOffset :: (Double -> f Double) -> CaptionRectangle -> f CaptionRectangle
captionRectangle_topOffset = (CaptionRectangle -> Double)
-> (CaptionRectangle -> Double -> CaptionRectangle)
-> Lens CaptionRectangle CaptionRectangle Double Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionRectangle' {Double
topOffset :: Double
$sel:topOffset:CaptionRectangle' :: CaptionRectangle -> Double
topOffset} -> Double
topOffset) (\s :: CaptionRectangle
s@CaptionRectangle' {} Double
a -> CaptionRectangle
s {$sel:topOffset:CaptionRectangle' :: Double
topOffset = Double
a} :: CaptionRectangle)
captionRectangle_height :: Lens.Lens' CaptionRectangle Prelude.Double
captionRectangle_height :: (Double -> f Double) -> CaptionRectangle -> f CaptionRectangle
captionRectangle_height = (CaptionRectangle -> Double)
-> (CaptionRectangle -> Double -> CaptionRectangle)
-> Lens CaptionRectangle CaptionRectangle Double Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionRectangle' {Double
height :: Double
$sel:height:CaptionRectangle' :: CaptionRectangle -> Double
height} -> Double
height) (\s :: CaptionRectangle
s@CaptionRectangle' {} Double
a -> CaptionRectangle
s {$sel:height:CaptionRectangle' :: Double
height = Double
a} :: CaptionRectangle)
captionRectangle_width :: Lens.Lens' CaptionRectangle Prelude.Double
captionRectangle_width :: (Double -> f Double) -> CaptionRectangle -> f CaptionRectangle
captionRectangle_width = (CaptionRectangle -> Double)
-> (CaptionRectangle -> Double -> CaptionRectangle)
-> Lens CaptionRectangle CaptionRectangle Double Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionRectangle' {Double
width :: Double
$sel:width:CaptionRectangle' :: CaptionRectangle -> Double
width} -> Double
width) (\s :: CaptionRectangle
s@CaptionRectangle' {} Double
a -> CaptionRectangle
s {$sel:width:CaptionRectangle' :: Double
width = Double
a} :: CaptionRectangle)
captionRectangle_leftOffset :: Lens.Lens' CaptionRectangle Prelude.Double
captionRectangle_leftOffset :: (Double -> f Double) -> CaptionRectangle -> f CaptionRectangle
captionRectangle_leftOffset = (CaptionRectangle -> Double)
-> (CaptionRectangle -> Double -> CaptionRectangle)
-> Lens CaptionRectangle CaptionRectangle Double Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionRectangle' {Double
leftOffset :: Double
$sel:leftOffset:CaptionRectangle' :: CaptionRectangle -> Double
leftOffset} -> Double
leftOffset) (\s :: CaptionRectangle
s@CaptionRectangle' {} Double
a -> CaptionRectangle
s {$sel:leftOffset:CaptionRectangle' :: Double
leftOffset = Double
a} :: CaptionRectangle)
instance Core.FromJSON CaptionRectangle where
parseJSON :: Value -> Parser CaptionRectangle
parseJSON =
String
-> (Object -> Parser CaptionRectangle)
-> Value
-> Parser CaptionRectangle
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CaptionRectangle"
( \Object
x ->
Double -> Double -> Double -> Double -> CaptionRectangle
CaptionRectangle'
(Double -> Double -> Double -> Double -> CaptionRectangle)
-> Parser Double
-> Parser (Double -> Double -> Double -> CaptionRectangle)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"topOffset")
Parser (Double -> Double -> Double -> CaptionRectangle)
-> Parser Double -> Parser (Double -> Double -> CaptionRectangle)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"height")
Parser (Double -> Double -> CaptionRectangle)
-> Parser Double -> Parser (Double -> CaptionRectangle)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"width")
Parser (Double -> CaptionRectangle)
-> Parser Double -> Parser CaptionRectangle
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"leftOffset")
)
instance Prelude.Hashable CaptionRectangle
instance Prelude.NFData CaptionRectangle
instance Core.ToJSON CaptionRectangle where
toJSON :: CaptionRectangle -> Value
toJSON CaptionRectangle' {Double
leftOffset :: Double
width :: Double
height :: Double
topOffset :: Double
$sel:leftOffset:CaptionRectangle' :: CaptionRectangle -> Double
$sel:width:CaptionRectangle' :: CaptionRectangle -> Double
$sel:height:CaptionRectangle' :: CaptionRectangle -> Double
$sel:topOffset:CaptionRectangle' :: CaptionRectangle -> Double
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"topOffset" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Double
topOffset),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"height" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Double
height),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"width" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Double
width),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"leftOffset" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Double
leftOffset)
]
)