{-# 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.Xavc4kIntraVbrProfileSettings
-- 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.Xavc4kIntraVbrProfileSettings 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.Xavc4kIntraVbrProfileClass
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'Xavc4kIntraVbrProfileSettings' 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', 'xavc4kIntraVbrProfileSettings_xavcClass' - Specify the XAVC Intra 4k (VBR) 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.
newXavc4kIntraVbrProfileSettings ::
  Xavc4kIntraVbrProfileSettings
newXavc4kIntraVbrProfileSettings :: Xavc4kIntraVbrProfileSettings
newXavc4kIntraVbrProfileSettings =
  Xavc4kIntraVbrProfileSettings'
    { $sel:xavcClass:Xavc4kIntraVbrProfileSettings' :: Maybe Xavc4kIntraVbrProfileClass
xavcClass =
        forall a. Maybe a
Prelude.Nothing
    }

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

instance Data.FromJSON Xavc4kIntraVbrProfileSettings where
  parseJSON :: Value -> Parser Xavc4kIntraVbrProfileSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Xavc4kIntraVbrProfileSettings"
      ( \Object
x ->
          Maybe Xavc4kIntraVbrProfileClass -> Xavc4kIntraVbrProfileSettings
Xavc4kIntraVbrProfileSettings'
            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
    Xavc4kIntraVbrProfileSettings
  where
  hashWithSalt :: Int -> Xavc4kIntraVbrProfileSettings -> Int
hashWithSalt Int
_salt Xavc4kIntraVbrProfileSettings' {Maybe Xavc4kIntraVbrProfileClass
xavcClass :: Maybe Xavc4kIntraVbrProfileClass
$sel:xavcClass:Xavc4kIntraVbrProfileSettings' :: Xavc4kIntraVbrProfileSettings -> Maybe Xavc4kIntraVbrProfileClass
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Xavc4kIntraVbrProfileClass
xavcClass

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

instance Data.ToJSON Xavc4kIntraVbrProfileSettings where
  toJSON :: Xavc4kIntraVbrProfileSettings -> Value
toJSON Xavc4kIntraVbrProfileSettings' {Maybe Xavc4kIntraVbrProfileClass
xavcClass :: Maybe Xavc4kIntraVbrProfileClass
$sel:xavcClass:Xavc4kIntraVbrProfileSettings' :: Xavc4kIntraVbrProfileSettings -> Maybe Xavc4kIntraVbrProfileClass
..} =
    [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 Xavc4kIntraVbrProfileClass
xavcClass]
      )