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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(Xavc4kIntraVbrProfileSettings
 -> Xavc4kIntraVbrProfileSettings -> Bool)
-> (Xavc4kIntraVbrProfileSettings
    -> Xavc4kIntraVbrProfileSettings -> Bool)
-> Eq Xavc4kIntraVbrProfileSettings
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]
(Int -> ReadS Xavc4kIntraVbrProfileSettings)
-> ReadS [Xavc4kIntraVbrProfileSettings]
-> ReadPrec Xavc4kIntraVbrProfileSettings
-> ReadPrec [Xavc4kIntraVbrProfileSettings]
-> Read 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
(Int -> Xavc4kIntraVbrProfileSettings -> ShowS)
-> (Xavc4kIntraVbrProfileSettings -> String)
-> ([Xavc4kIntraVbrProfileSettings] -> ShowS)
-> Show Xavc4kIntraVbrProfileSettings
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.
 Xavc4kIntraVbrProfileSettings
 -> Rep Xavc4kIntraVbrProfileSettings x)
-> (forall x.
    Rep Xavc4kIntraVbrProfileSettings x
    -> Xavc4kIntraVbrProfileSettings)
-> Generic Xavc4kIntraVbrProfileSettings
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' :: Maybe Xavc4kIntraVbrProfileClass -> Xavc4kIntraVbrProfileSettings
Xavc4kIntraVbrProfileSettings'
    { $sel:xavcClass:Xavc4kIntraVbrProfileSettings' :: Maybe Xavc4kIntraVbrProfileClass
xavcClass =
        Maybe Xavc4kIntraVbrProfileClass
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 :: (Maybe Xavc4kIntraVbrProfileClass
 -> f (Maybe Xavc4kIntraVbrProfileClass))
-> Xavc4kIntraVbrProfileSettings -> f Xavc4kIntraVbrProfileSettings
xavc4kIntraVbrProfileSettings_xavcClass = (Xavc4kIntraVbrProfileSettings -> Maybe Xavc4kIntraVbrProfileClass)
-> (Xavc4kIntraVbrProfileSettings
    -> Maybe Xavc4kIntraVbrProfileClass
    -> Xavc4kIntraVbrProfileSettings)
-> Lens
     Xavc4kIntraVbrProfileSettings
     Xavc4kIntraVbrProfileSettings
     (Maybe Xavc4kIntraVbrProfileClass)
     (Maybe Xavc4kIntraVbrProfileClass)
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 Core.FromJSON Xavc4kIntraVbrProfileSettings where
  parseJSON :: Value -> Parser Xavc4kIntraVbrProfileSettings
parseJSON =
    String
-> (Object -> Parser Xavc4kIntraVbrProfileSettings)
-> Value
-> Parser Xavc4kIntraVbrProfileSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Xavc4kIntraVbrProfileSettings"
      ( \Object
x ->
          Maybe Xavc4kIntraVbrProfileClass -> Xavc4kIntraVbrProfileSettings
Xavc4kIntraVbrProfileSettings'
            (Maybe Xavc4kIntraVbrProfileClass -> Xavc4kIntraVbrProfileSettings)
-> Parser (Maybe Xavc4kIntraVbrProfileClass)
-> Parser Xavc4kIntraVbrProfileSettings
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Xavc4kIntraVbrProfileClass)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"xavcClass")
      )

instance
  Prelude.Hashable
    Xavc4kIntraVbrProfileSettings

instance Prelude.NFData Xavc4kIntraVbrProfileSettings

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