{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $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 :: Lens' CaptionRectangle Double
captionRectangle_topOffset = 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 :: Lens' CaptionRectangle Double
captionRectangle_height = 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 :: Lens' CaptionRectangle Double
captionRectangle_width = 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 :: Lens' CaptionRectangle Double
captionRectangle_leftOffset = 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 Data.FromJSON CaptionRectangle where
parseJSON :: Value -> Parser CaptionRectangle
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CaptionRectangle"
( \Object
x ->
Double -> Double -> Double -> Double -> CaptionRectangle
CaptionRectangle'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"topOffset")
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
"height")
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
"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
"leftOffset")
)
instance Prelude.Hashable CaptionRectangle where
hashWithSalt :: Int -> CaptionRectangle -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
topOffset
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
height
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
width
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
leftOffset
instance Prelude.NFData CaptionRectangle where
rnf :: CaptionRectangle -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Double
topOffset
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
height
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
width
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
leftOffset
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"topOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Double
topOffset),
forall a. a -> Maybe a
Prelude.Just (Key
"height" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Double
height),
forall a. a -> Maybe a
Prelude.Just (Key
"width" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Double
width),
forall a. a -> Maybe a
Prelude.Just (Key
"leftOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Double
leftOffset)
]
)