{-# 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.AvcIntraUhdSettings
-- 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.AvcIntraUhdSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.AvcIntraUhdQualityTuningLevel
import qualified Amazonka.Prelude as Prelude

-- | Optional when you set AVC-Intra class (avcIntraClass) to Class 4K\/2K
-- (CLASS_4K_2K). When you set AVC-Intra class to a different value, this
-- object isn\'t allowed.
--
-- /See:/ 'newAvcIntraUhdSettings' smart constructor.
data AvcIntraUhdSettings = AvcIntraUhdSettings'
  { -- | Optional. Use Quality tuning level (qualityTuningLevel) to choose how
    -- many transcoding passes MediaConvert does with your video. When you
    -- choose Multi-pass (MULTI_PASS), your video quality is better and your
    -- output bitrate is more accurate. That is, the actual bitrate of your
    -- output is closer to the target bitrate defined in the specification.
    -- When you choose Single-pass (SINGLE_PASS), your encoding time is faster.
    -- The default behavior is Single-pass (SINGLE_PASS).
    AvcIntraUhdSettings -> Maybe AvcIntraUhdQualityTuningLevel
qualityTuningLevel :: Prelude.Maybe AvcIntraUhdQualityTuningLevel
  }
  deriving (AvcIntraUhdSettings -> AvcIntraUhdSettings -> Bool
(AvcIntraUhdSettings -> AvcIntraUhdSettings -> Bool)
-> (AvcIntraUhdSettings -> AvcIntraUhdSettings -> Bool)
-> Eq AvcIntraUhdSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AvcIntraUhdSettings -> AvcIntraUhdSettings -> Bool
$c/= :: AvcIntraUhdSettings -> AvcIntraUhdSettings -> Bool
== :: AvcIntraUhdSettings -> AvcIntraUhdSettings -> Bool
$c== :: AvcIntraUhdSettings -> AvcIntraUhdSettings -> Bool
Prelude.Eq, ReadPrec [AvcIntraUhdSettings]
ReadPrec AvcIntraUhdSettings
Int -> ReadS AvcIntraUhdSettings
ReadS [AvcIntraUhdSettings]
(Int -> ReadS AvcIntraUhdSettings)
-> ReadS [AvcIntraUhdSettings]
-> ReadPrec AvcIntraUhdSettings
-> ReadPrec [AvcIntraUhdSettings]
-> Read AvcIntraUhdSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AvcIntraUhdSettings]
$creadListPrec :: ReadPrec [AvcIntraUhdSettings]
readPrec :: ReadPrec AvcIntraUhdSettings
$creadPrec :: ReadPrec AvcIntraUhdSettings
readList :: ReadS [AvcIntraUhdSettings]
$creadList :: ReadS [AvcIntraUhdSettings]
readsPrec :: Int -> ReadS AvcIntraUhdSettings
$creadsPrec :: Int -> ReadS AvcIntraUhdSettings
Prelude.Read, Int -> AvcIntraUhdSettings -> ShowS
[AvcIntraUhdSettings] -> ShowS
AvcIntraUhdSettings -> String
(Int -> AvcIntraUhdSettings -> ShowS)
-> (AvcIntraUhdSettings -> String)
-> ([AvcIntraUhdSettings] -> ShowS)
-> Show AvcIntraUhdSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AvcIntraUhdSettings] -> ShowS
$cshowList :: [AvcIntraUhdSettings] -> ShowS
show :: AvcIntraUhdSettings -> String
$cshow :: AvcIntraUhdSettings -> String
showsPrec :: Int -> AvcIntraUhdSettings -> ShowS
$cshowsPrec :: Int -> AvcIntraUhdSettings -> ShowS
Prelude.Show, (forall x. AvcIntraUhdSettings -> Rep AvcIntraUhdSettings x)
-> (forall x. Rep AvcIntraUhdSettings x -> AvcIntraUhdSettings)
-> Generic AvcIntraUhdSettings
forall x. Rep AvcIntraUhdSettings x -> AvcIntraUhdSettings
forall x. AvcIntraUhdSettings -> Rep AvcIntraUhdSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AvcIntraUhdSettings x -> AvcIntraUhdSettings
$cfrom :: forall x. AvcIntraUhdSettings -> Rep AvcIntraUhdSettings x
Prelude.Generic)

-- |
-- Create a value of 'AvcIntraUhdSettings' 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:
--
-- 'qualityTuningLevel', 'avcIntraUhdSettings_qualityTuningLevel' - Optional. Use Quality tuning level (qualityTuningLevel) to choose how
-- many transcoding passes MediaConvert does with your video. When you
-- choose Multi-pass (MULTI_PASS), your video quality is better and your
-- output bitrate is more accurate. That is, the actual bitrate of your
-- output is closer to the target bitrate defined in the specification.
-- When you choose Single-pass (SINGLE_PASS), your encoding time is faster.
-- The default behavior is Single-pass (SINGLE_PASS).
newAvcIntraUhdSettings ::
  AvcIntraUhdSettings
newAvcIntraUhdSettings :: AvcIntraUhdSettings
newAvcIntraUhdSettings =
  AvcIntraUhdSettings' :: Maybe AvcIntraUhdQualityTuningLevel -> AvcIntraUhdSettings
AvcIntraUhdSettings'
    { $sel:qualityTuningLevel:AvcIntraUhdSettings' :: Maybe AvcIntraUhdQualityTuningLevel
qualityTuningLevel =
        Maybe AvcIntraUhdQualityTuningLevel
forall a. Maybe a
Prelude.Nothing
    }

-- | Optional. Use Quality tuning level (qualityTuningLevel) to choose how
-- many transcoding passes MediaConvert does with your video. When you
-- choose Multi-pass (MULTI_PASS), your video quality is better and your
-- output bitrate is more accurate. That is, the actual bitrate of your
-- output is closer to the target bitrate defined in the specification.
-- When you choose Single-pass (SINGLE_PASS), your encoding time is faster.
-- The default behavior is Single-pass (SINGLE_PASS).
avcIntraUhdSettings_qualityTuningLevel :: Lens.Lens' AvcIntraUhdSettings (Prelude.Maybe AvcIntraUhdQualityTuningLevel)
avcIntraUhdSettings_qualityTuningLevel :: (Maybe AvcIntraUhdQualityTuningLevel
 -> f (Maybe AvcIntraUhdQualityTuningLevel))
-> AvcIntraUhdSettings -> f AvcIntraUhdSettings
avcIntraUhdSettings_qualityTuningLevel = (AvcIntraUhdSettings -> Maybe AvcIntraUhdQualityTuningLevel)
-> (AvcIntraUhdSettings
    -> Maybe AvcIntraUhdQualityTuningLevel -> AvcIntraUhdSettings)
-> Lens
     AvcIntraUhdSettings
     AvcIntraUhdSettings
     (Maybe AvcIntraUhdQualityTuningLevel)
     (Maybe AvcIntraUhdQualityTuningLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AvcIntraUhdSettings' {Maybe AvcIntraUhdQualityTuningLevel
qualityTuningLevel :: Maybe AvcIntraUhdQualityTuningLevel
$sel:qualityTuningLevel:AvcIntraUhdSettings' :: AvcIntraUhdSettings -> Maybe AvcIntraUhdQualityTuningLevel
qualityTuningLevel} -> Maybe AvcIntraUhdQualityTuningLevel
qualityTuningLevel) (\s :: AvcIntraUhdSettings
s@AvcIntraUhdSettings' {} Maybe AvcIntraUhdQualityTuningLevel
a -> AvcIntraUhdSettings
s {$sel:qualityTuningLevel:AvcIntraUhdSettings' :: Maybe AvcIntraUhdQualityTuningLevel
qualityTuningLevel = Maybe AvcIntraUhdQualityTuningLevel
a} :: AvcIntraUhdSettings)

instance Core.FromJSON AvcIntraUhdSettings where
  parseJSON :: Value -> Parser AvcIntraUhdSettings
parseJSON =
    String
-> (Object -> Parser AvcIntraUhdSettings)
-> Value
-> Parser AvcIntraUhdSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AvcIntraUhdSettings"
      ( \Object
x ->
          Maybe AvcIntraUhdQualityTuningLevel -> AvcIntraUhdSettings
AvcIntraUhdSettings'
            (Maybe AvcIntraUhdQualityTuningLevel -> AvcIntraUhdSettings)
-> Parser (Maybe AvcIntraUhdQualityTuningLevel)
-> Parser AvcIntraUhdSettings
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AvcIntraUhdQualityTuningLevel)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"qualityTuningLevel")
      )

instance Prelude.Hashable AvcIntraUhdSettings

instance Prelude.NFData AvcIntraUhdSettings

instance Core.ToJSON AvcIntraUhdSettings where
  toJSON :: AvcIntraUhdSettings -> Value
toJSON AvcIntraUhdSettings' {Maybe AvcIntraUhdQualityTuningLevel
qualityTuningLevel :: Maybe AvcIntraUhdQualityTuningLevel
$sel:qualityTuningLevel:AvcIntraUhdSettings' :: AvcIntraUhdSettings -> Maybe AvcIntraUhdQualityTuningLevel
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"qualityTuningLevel" Text -> AvcIntraUhdQualityTuningLevel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AvcIntraUhdQualityTuningLevel -> Pair)
-> Maybe AvcIntraUhdQualityTuningLevel -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AvcIntraUhdQualityTuningLevel
qualityTuningLevel
          ]
      )