{-# 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.Xavc4kIntraCbgProfileSettings
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaConvert.Types.Xavc4kIntraCbgProfileSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types.Xavc4kIntraCbgProfileClass
import qualified Amazonka.Prelude as Prelude

-- | Required when you set (Profile) under
-- (VideoDescription)>(CodecSettings)>(XavcSettings) to the value
-- XAVC_4K_INTRA_CBG.
--
-- /See:/ 'newXavc4kIntraCbgProfileSettings' smart constructor.
data Xavc4kIntraCbgProfileSettings = Xavc4kIntraCbgProfileSettings'
  { -- | Specify the XAVC Intra 4k (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.
    Xavc4kIntraCbgProfileSettings -> Maybe Xavc4kIntraCbgProfileClass
xavcClass :: Prelude.Maybe Xavc4kIntraCbgProfileClass
  }
  deriving (Xavc4kIntraCbgProfileSettings
-> Xavc4kIntraCbgProfileSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Xavc4kIntraCbgProfileSettings
-> Xavc4kIntraCbgProfileSettings -> Bool
$c/= :: Xavc4kIntraCbgProfileSettings
-> Xavc4kIntraCbgProfileSettings -> Bool
== :: Xavc4kIntraCbgProfileSettings
-> Xavc4kIntraCbgProfileSettings -> Bool
$c== :: Xavc4kIntraCbgProfileSettings
-> Xavc4kIntraCbgProfileSettings -> Bool
Prelude.Eq, ReadPrec [Xavc4kIntraCbgProfileSettings]
ReadPrec Xavc4kIntraCbgProfileSettings
Int -> ReadS Xavc4kIntraCbgProfileSettings
ReadS [Xavc4kIntraCbgProfileSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Xavc4kIntraCbgProfileSettings]
$creadListPrec :: ReadPrec [Xavc4kIntraCbgProfileSettings]
readPrec :: ReadPrec Xavc4kIntraCbgProfileSettings
$creadPrec :: ReadPrec Xavc4kIntraCbgProfileSettings
readList :: ReadS [Xavc4kIntraCbgProfileSettings]
$creadList :: ReadS [Xavc4kIntraCbgProfileSettings]
readsPrec :: Int -> ReadS Xavc4kIntraCbgProfileSettings
$creadsPrec :: Int -> ReadS Xavc4kIntraCbgProfileSettings
Prelude.Read, Int -> Xavc4kIntraCbgProfileSettings -> ShowS
[Xavc4kIntraCbgProfileSettings] -> ShowS
Xavc4kIntraCbgProfileSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Xavc4kIntraCbgProfileSettings] -> ShowS
$cshowList :: [Xavc4kIntraCbgProfileSettings] -> ShowS
show :: Xavc4kIntraCbgProfileSettings -> String
$cshow :: Xavc4kIntraCbgProfileSettings -> String
showsPrec :: Int -> Xavc4kIntraCbgProfileSettings -> ShowS
$cshowsPrec :: Int -> Xavc4kIntraCbgProfileSettings -> ShowS
Prelude.Show, forall x.
Rep Xavc4kIntraCbgProfileSettings x
-> Xavc4kIntraCbgProfileSettings
forall x.
Xavc4kIntraCbgProfileSettings
-> Rep Xavc4kIntraCbgProfileSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep Xavc4kIntraCbgProfileSettings x
-> Xavc4kIntraCbgProfileSettings
$cfrom :: forall x.
Xavc4kIntraCbgProfileSettings
-> Rep Xavc4kIntraCbgProfileSettings x
Prelude.Generic)

-- |
-- Create a value of 'Xavc4kIntraCbgProfileSettings' 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', 'xavc4kIntraCbgProfileSettings_xavcClass' - Specify the XAVC Intra 4k (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.
newXavc4kIntraCbgProfileSettings ::
  Xavc4kIntraCbgProfileSettings
newXavc4kIntraCbgProfileSettings :: Xavc4kIntraCbgProfileSettings
newXavc4kIntraCbgProfileSettings =
  Xavc4kIntraCbgProfileSettings'
    { $sel:xavcClass:Xavc4kIntraCbgProfileSettings' :: Maybe Xavc4kIntraCbgProfileClass
xavcClass =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Specify the XAVC Intra 4k (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.
xavc4kIntraCbgProfileSettings_xavcClass :: Lens.Lens' Xavc4kIntraCbgProfileSettings (Prelude.Maybe Xavc4kIntraCbgProfileClass)
xavc4kIntraCbgProfileSettings_xavcClass :: Lens'
  Xavc4kIntraCbgProfileSettings (Maybe Xavc4kIntraCbgProfileClass)
xavc4kIntraCbgProfileSettings_xavcClass = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Xavc4kIntraCbgProfileSettings' {Maybe Xavc4kIntraCbgProfileClass
xavcClass :: Maybe Xavc4kIntraCbgProfileClass
$sel:xavcClass:Xavc4kIntraCbgProfileSettings' :: Xavc4kIntraCbgProfileSettings -> Maybe Xavc4kIntraCbgProfileClass
xavcClass} -> Maybe Xavc4kIntraCbgProfileClass
xavcClass) (\s :: Xavc4kIntraCbgProfileSettings
s@Xavc4kIntraCbgProfileSettings' {} Maybe Xavc4kIntraCbgProfileClass
a -> Xavc4kIntraCbgProfileSettings
s {$sel:xavcClass:Xavc4kIntraCbgProfileSettings' :: Maybe Xavc4kIntraCbgProfileClass
xavcClass = Maybe Xavc4kIntraCbgProfileClass
a} :: Xavc4kIntraCbgProfileSettings)

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

instance
  Prelude.Hashable
    Xavc4kIntraCbgProfileSettings
  where
  hashWithSalt :: Int -> Xavc4kIntraCbgProfileSettings -> Int
hashWithSalt Int
_salt Xavc4kIntraCbgProfileSettings' {Maybe Xavc4kIntraCbgProfileClass
xavcClass :: Maybe Xavc4kIntraCbgProfileClass
$sel:xavcClass:Xavc4kIntraCbgProfileSettings' :: Xavc4kIntraCbgProfileSettings -> Maybe Xavc4kIntraCbgProfileClass
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Xavc4kIntraCbgProfileClass
xavcClass

instance Prelude.NFData Xavc4kIntraCbgProfileSettings where
  rnf :: Xavc4kIntraCbgProfileSettings -> ()
rnf Xavc4kIntraCbgProfileSettings' {Maybe Xavc4kIntraCbgProfileClass
xavcClass :: Maybe Xavc4kIntraCbgProfileClass
$sel:xavcClass:Xavc4kIntraCbgProfileSettings' :: Xavc4kIntraCbgProfileSettings -> Maybe Xavc4kIntraCbgProfileClass
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Xavc4kIntraCbgProfileClass
xavcClass

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