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

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

-- | Required when you set (Profile) under
-- (VideoDescription)>(CodecSettings)>(XavcSettings) to the value
-- XAVC_HD_INTRA_CBG.
--
-- /See:/ 'newXavcHdIntraCbgProfileSettings' smart constructor.
data XavcHdIntraCbgProfileSettings = XavcHdIntraCbgProfileSettings'
  { -- | Specify the XAVC Intra HD (CBG) Class to set the bitrate of your output.
    -- Outputs of the same class have similar image quality over the operating
    -- points that are valid for that class.
    XavcHdIntraCbgProfileSettings -> Maybe XavcHdIntraCbgProfileClass
xavcClass :: Prelude.Maybe XavcHdIntraCbgProfileClass
  }
  deriving (XavcHdIntraCbgProfileSettings
-> XavcHdIntraCbgProfileSettings -> Bool
(XavcHdIntraCbgProfileSettings
 -> XavcHdIntraCbgProfileSettings -> Bool)
-> (XavcHdIntraCbgProfileSettings
    -> XavcHdIntraCbgProfileSettings -> Bool)
-> Eq XavcHdIntraCbgProfileSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: XavcHdIntraCbgProfileSettings
-> XavcHdIntraCbgProfileSettings -> Bool
$c/= :: XavcHdIntraCbgProfileSettings
-> XavcHdIntraCbgProfileSettings -> Bool
== :: XavcHdIntraCbgProfileSettings
-> XavcHdIntraCbgProfileSettings -> Bool
$c== :: XavcHdIntraCbgProfileSettings
-> XavcHdIntraCbgProfileSettings -> Bool
Prelude.Eq, ReadPrec [XavcHdIntraCbgProfileSettings]
ReadPrec XavcHdIntraCbgProfileSettings
Int -> ReadS XavcHdIntraCbgProfileSettings
ReadS [XavcHdIntraCbgProfileSettings]
(Int -> ReadS XavcHdIntraCbgProfileSettings)
-> ReadS [XavcHdIntraCbgProfileSettings]
-> ReadPrec XavcHdIntraCbgProfileSettings
-> ReadPrec [XavcHdIntraCbgProfileSettings]
-> Read XavcHdIntraCbgProfileSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [XavcHdIntraCbgProfileSettings]
$creadListPrec :: ReadPrec [XavcHdIntraCbgProfileSettings]
readPrec :: ReadPrec XavcHdIntraCbgProfileSettings
$creadPrec :: ReadPrec XavcHdIntraCbgProfileSettings
readList :: ReadS [XavcHdIntraCbgProfileSettings]
$creadList :: ReadS [XavcHdIntraCbgProfileSettings]
readsPrec :: Int -> ReadS XavcHdIntraCbgProfileSettings
$creadsPrec :: Int -> ReadS XavcHdIntraCbgProfileSettings
Prelude.Read, Int -> XavcHdIntraCbgProfileSettings -> ShowS
[XavcHdIntraCbgProfileSettings] -> ShowS
XavcHdIntraCbgProfileSettings -> String
(Int -> XavcHdIntraCbgProfileSettings -> ShowS)
-> (XavcHdIntraCbgProfileSettings -> String)
-> ([XavcHdIntraCbgProfileSettings] -> ShowS)
-> Show XavcHdIntraCbgProfileSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [XavcHdIntraCbgProfileSettings] -> ShowS
$cshowList :: [XavcHdIntraCbgProfileSettings] -> ShowS
show :: XavcHdIntraCbgProfileSettings -> String
$cshow :: XavcHdIntraCbgProfileSettings -> String
showsPrec :: Int -> XavcHdIntraCbgProfileSettings -> ShowS
$cshowsPrec :: Int -> XavcHdIntraCbgProfileSettings -> ShowS
Prelude.Show, (forall x.
 XavcHdIntraCbgProfileSettings
 -> Rep XavcHdIntraCbgProfileSettings x)
-> (forall x.
    Rep XavcHdIntraCbgProfileSettings x
    -> XavcHdIntraCbgProfileSettings)
-> Generic XavcHdIntraCbgProfileSettings
forall x.
Rep XavcHdIntraCbgProfileSettings x
-> XavcHdIntraCbgProfileSettings
forall x.
XavcHdIntraCbgProfileSettings
-> Rep XavcHdIntraCbgProfileSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep XavcHdIntraCbgProfileSettings x
-> XavcHdIntraCbgProfileSettings
$cfrom :: forall x.
XavcHdIntraCbgProfileSettings
-> Rep XavcHdIntraCbgProfileSettings x
Prelude.Generic)

-- |
-- Create a value of 'XavcHdIntraCbgProfileSettings' 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:
--
-- 'xavcClass', 'xavcHdIntraCbgProfileSettings_xavcClass' - Specify the XAVC Intra HD (CBG) Class to set the bitrate of your output.
-- Outputs of the same class have similar image quality over the operating
-- points that are valid for that class.
newXavcHdIntraCbgProfileSettings ::
  XavcHdIntraCbgProfileSettings
newXavcHdIntraCbgProfileSettings :: XavcHdIntraCbgProfileSettings
newXavcHdIntraCbgProfileSettings =
  XavcHdIntraCbgProfileSettings' :: Maybe XavcHdIntraCbgProfileClass -> XavcHdIntraCbgProfileSettings
XavcHdIntraCbgProfileSettings'
    { $sel:xavcClass:XavcHdIntraCbgProfileSettings' :: Maybe XavcHdIntraCbgProfileClass
xavcClass =
        Maybe XavcHdIntraCbgProfileClass
forall a. Maybe a
Prelude.Nothing
    }

-- | Specify the XAVC Intra HD (CBG) Class to set the bitrate of your output.
-- Outputs of the same class have similar image quality over the operating
-- points that are valid for that class.
xavcHdIntraCbgProfileSettings_xavcClass :: Lens.Lens' XavcHdIntraCbgProfileSettings (Prelude.Maybe XavcHdIntraCbgProfileClass)
xavcHdIntraCbgProfileSettings_xavcClass :: (Maybe XavcHdIntraCbgProfileClass
 -> f (Maybe XavcHdIntraCbgProfileClass))
-> XavcHdIntraCbgProfileSettings -> f XavcHdIntraCbgProfileSettings
xavcHdIntraCbgProfileSettings_xavcClass = (XavcHdIntraCbgProfileSettings -> Maybe XavcHdIntraCbgProfileClass)
-> (XavcHdIntraCbgProfileSettings
    -> Maybe XavcHdIntraCbgProfileClass
    -> XavcHdIntraCbgProfileSettings)
-> Lens
     XavcHdIntraCbgProfileSettings
     XavcHdIntraCbgProfileSettings
     (Maybe XavcHdIntraCbgProfileClass)
     (Maybe XavcHdIntraCbgProfileClass)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\XavcHdIntraCbgProfileSettings' {Maybe XavcHdIntraCbgProfileClass
xavcClass :: Maybe XavcHdIntraCbgProfileClass
$sel:xavcClass:XavcHdIntraCbgProfileSettings' :: XavcHdIntraCbgProfileSettings -> Maybe XavcHdIntraCbgProfileClass
xavcClass} -> Maybe XavcHdIntraCbgProfileClass
xavcClass) (\s :: XavcHdIntraCbgProfileSettings
s@XavcHdIntraCbgProfileSettings' {} Maybe XavcHdIntraCbgProfileClass
a -> XavcHdIntraCbgProfileSettings
s {$sel:xavcClass:XavcHdIntraCbgProfileSettings' :: Maybe XavcHdIntraCbgProfileClass
xavcClass = Maybe XavcHdIntraCbgProfileClass
a} :: XavcHdIntraCbgProfileSettings)

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

instance
  Prelude.Hashable
    XavcHdIntraCbgProfileSettings

instance Prelude.NFData XavcHdIntraCbgProfileSettings

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