{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MediaConvert.Types.VideoDetail
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaConvert.Types.VideoDetail where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains details about the output\'s video stream
--
-- /See:/ 'newVideoDetail' smart constructor.
data VideoDetail = VideoDetail'
  { -- | Height in pixels for the output
    VideoDetail -> Maybe Int
heightInPx :: Prelude.Maybe Prelude.Int,
    -- | Width in pixels for the output
    VideoDetail -> Maybe Int
widthInPx :: Prelude.Maybe Prelude.Int
  }
  deriving (VideoDetail -> VideoDetail -> Bool
(VideoDetail -> VideoDetail -> Bool)
-> (VideoDetail -> VideoDetail -> Bool) -> Eq VideoDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VideoDetail -> VideoDetail -> Bool
$c/= :: VideoDetail -> VideoDetail -> Bool
== :: VideoDetail -> VideoDetail -> Bool
$c== :: VideoDetail -> VideoDetail -> Bool
Prelude.Eq, ReadPrec [VideoDetail]
ReadPrec VideoDetail
Int -> ReadS VideoDetail
ReadS [VideoDetail]
(Int -> ReadS VideoDetail)
-> ReadS [VideoDetail]
-> ReadPrec VideoDetail
-> ReadPrec [VideoDetail]
-> Read VideoDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VideoDetail]
$creadListPrec :: ReadPrec [VideoDetail]
readPrec :: ReadPrec VideoDetail
$creadPrec :: ReadPrec VideoDetail
readList :: ReadS [VideoDetail]
$creadList :: ReadS [VideoDetail]
readsPrec :: Int -> ReadS VideoDetail
$creadsPrec :: Int -> ReadS VideoDetail
Prelude.Read, Int -> VideoDetail -> ShowS
[VideoDetail] -> ShowS
VideoDetail -> String
(Int -> VideoDetail -> ShowS)
-> (VideoDetail -> String)
-> ([VideoDetail] -> ShowS)
-> Show VideoDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VideoDetail] -> ShowS
$cshowList :: [VideoDetail] -> ShowS
show :: VideoDetail -> String
$cshow :: VideoDetail -> String
showsPrec :: Int -> VideoDetail -> ShowS
$cshowsPrec :: Int -> VideoDetail -> ShowS
Prelude.Show, (forall x. VideoDetail -> Rep VideoDetail x)
-> (forall x. Rep VideoDetail x -> VideoDetail)
-> Generic VideoDetail
forall x. Rep VideoDetail x -> VideoDetail
forall x. VideoDetail -> Rep VideoDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VideoDetail x -> VideoDetail
$cfrom :: forall x. VideoDetail -> Rep VideoDetail x
Prelude.Generic)

-- |
-- Create a value of 'VideoDetail' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'heightInPx', 'videoDetail_heightInPx' - Height in pixels for the output
--
-- 'widthInPx', 'videoDetail_widthInPx' - Width in pixels for the output
newVideoDetail ::
  VideoDetail
newVideoDetail :: VideoDetail
newVideoDetail =
  VideoDetail' :: Maybe Int -> Maybe Int -> VideoDetail
VideoDetail'
    { $sel:heightInPx:VideoDetail' :: Maybe Int
heightInPx = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:widthInPx:VideoDetail' :: Maybe Int
widthInPx = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Height in pixels for the output
videoDetail_heightInPx :: Lens.Lens' VideoDetail (Prelude.Maybe Prelude.Int)
videoDetail_heightInPx :: (Maybe Int -> f (Maybe Int)) -> VideoDetail -> f VideoDetail
videoDetail_heightInPx = (VideoDetail -> Maybe Int)
-> (VideoDetail -> Maybe Int -> VideoDetail)
-> Lens VideoDetail VideoDetail (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoDetail' {Maybe Int
heightInPx :: Maybe Int
$sel:heightInPx:VideoDetail' :: VideoDetail -> Maybe Int
heightInPx} -> Maybe Int
heightInPx) (\s :: VideoDetail
s@VideoDetail' {} Maybe Int
a -> VideoDetail
s {$sel:heightInPx:VideoDetail' :: Maybe Int
heightInPx = Maybe Int
a} :: VideoDetail)

-- | Width in pixels for the output
videoDetail_widthInPx :: Lens.Lens' VideoDetail (Prelude.Maybe Prelude.Int)
videoDetail_widthInPx :: (Maybe Int -> f (Maybe Int)) -> VideoDetail -> f VideoDetail
videoDetail_widthInPx = (VideoDetail -> Maybe Int)
-> (VideoDetail -> Maybe Int -> VideoDetail)
-> Lens VideoDetail VideoDetail (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoDetail' {Maybe Int
widthInPx :: Maybe Int
$sel:widthInPx:VideoDetail' :: VideoDetail -> Maybe Int
widthInPx} -> Maybe Int
widthInPx) (\s :: VideoDetail
s@VideoDetail' {} Maybe Int
a -> VideoDetail
s {$sel:widthInPx:VideoDetail' :: Maybe Int
widthInPx = Maybe Int
a} :: VideoDetail)

instance Core.FromJSON VideoDetail where
  parseJSON :: Value -> Parser VideoDetail
parseJSON =
    String
-> (Object -> Parser VideoDetail) -> Value -> Parser VideoDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VideoDetail"
      ( \Object
x ->
          Maybe Int -> Maybe Int -> VideoDetail
VideoDetail'
            (Maybe Int -> Maybe Int -> VideoDetail)
-> Parser (Maybe Int) -> Parser (Maybe Int -> VideoDetail)
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
"heightInPx")
            Parser (Maybe Int -> VideoDetail)
-> Parser (Maybe Int) -> Parser VideoDetail
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
"widthInPx")
      )

instance Prelude.Hashable VideoDetail

instance Prelude.NFData VideoDetail