{-# 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.MediaLive.Types.H264ColorSpaceSettings
-- 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.MediaLive.Types.H264ColorSpaceSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.ColorSpacePassthroughSettings
import Amazonka.MediaLive.Types.Rec601Settings
import Amazonka.MediaLive.Types.Rec709Settings
import qualified Amazonka.Prelude as Prelude

-- | H264 Color Space Settings
--
-- /See:/ 'newH264ColorSpaceSettings' smart constructor.
data H264ColorSpaceSettings = H264ColorSpaceSettings'
  { H264ColorSpaceSettings -> Maybe Rec709Settings
rec709Settings :: Prelude.Maybe Rec709Settings,
    H264ColorSpaceSettings -> Maybe Rec601Settings
rec601Settings :: Prelude.Maybe Rec601Settings,
    H264ColorSpaceSettings -> Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings :: Prelude.Maybe ColorSpacePassthroughSettings
  }
  deriving (H264ColorSpaceSettings -> H264ColorSpaceSettings -> Bool
(H264ColorSpaceSettings -> H264ColorSpaceSettings -> Bool)
-> (H264ColorSpaceSettings -> H264ColorSpaceSettings -> Bool)
-> Eq H264ColorSpaceSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: H264ColorSpaceSettings -> H264ColorSpaceSettings -> Bool
$c/= :: H264ColorSpaceSettings -> H264ColorSpaceSettings -> Bool
== :: H264ColorSpaceSettings -> H264ColorSpaceSettings -> Bool
$c== :: H264ColorSpaceSettings -> H264ColorSpaceSettings -> Bool
Prelude.Eq, ReadPrec [H264ColorSpaceSettings]
ReadPrec H264ColorSpaceSettings
Int -> ReadS H264ColorSpaceSettings
ReadS [H264ColorSpaceSettings]
(Int -> ReadS H264ColorSpaceSettings)
-> ReadS [H264ColorSpaceSettings]
-> ReadPrec H264ColorSpaceSettings
-> ReadPrec [H264ColorSpaceSettings]
-> Read H264ColorSpaceSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [H264ColorSpaceSettings]
$creadListPrec :: ReadPrec [H264ColorSpaceSettings]
readPrec :: ReadPrec H264ColorSpaceSettings
$creadPrec :: ReadPrec H264ColorSpaceSettings
readList :: ReadS [H264ColorSpaceSettings]
$creadList :: ReadS [H264ColorSpaceSettings]
readsPrec :: Int -> ReadS H264ColorSpaceSettings
$creadsPrec :: Int -> ReadS H264ColorSpaceSettings
Prelude.Read, Int -> H264ColorSpaceSettings -> ShowS
[H264ColorSpaceSettings] -> ShowS
H264ColorSpaceSettings -> String
(Int -> H264ColorSpaceSettings -> ShowS)
-> (H264ColorSpaceSettings -> String)
-> ([H264ColorSpaceSettings] -> ShowS)
-> Show H264ColorSpaceSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [H264ColorSpaceSettings] -> ShowS
$cshowList :: [H264ColorSpaceSettings] -> ShowS
show :: H264ColorSpaceSettings -> String
$cshow :: H264ColorSpaceSettings -> String
showsPrec :: Int -> H264ColorSpaceSettings -> ShowS
$cshowsPrec :: Int -> H264ColorSpaceSettings -> ShowS
Prelude.Show, (forall x. H264ColorSpaceSettings -> Rep H264ColorSpaceSettings x)
-> (forall x.
    Rep H264ColorSpaceSettings x -> H264ColorSpaceSettings)
-> Generic H264ColorSpaceSettings
forall x. Rep H264ColorSpaceSettings x -> H264ColorSpaceSettings
forall x. H264ColorSpaceSettings -> Rep H264ColorSpaceSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep H264ColorSpaceSettings x -> H264ColorSpaceSettings
$cfrom :: forall x. H264ColorSpaceSettings -> Rep H264ColorSpaceSettings x
Prelude.Generic)

-- |
-- Create a value of 'H264ColorSpaceSettings' 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:
--
-- 'rec709Settings', 'h264ColorSpaceSettings_rec709Settings' - Undocumented member.
--
-- 'rec601Settings', 'h264ColorSpaceSettings_rec601Settings' - Undocumented member.
--
-- 'colorSpacePassthroughSettings', 'h264ColorSpaceSettings_colorSpacePassthroughSettings' - Undocumented member.
newH264ColorSpaceSettings ::
  H264ColorSpaceSettings
newH264ColorSpaceSettings :: H264ColorSpaceSettings
newH264ColorSpaceSettings =
  H264ColorSpaceSettings' :: Maybe Rec709Settings
-> Maybe Rec601Settings
-> Maybe ColorSpacePassthroughSettings
-> H264ColorSpaceSettings
H264ColorSpaceSettings'
    { $sel:rec709Settings:H264ColorSpaceSettings' :: Maybe Rec709Settings
rec709Settings =
        Maybe Rec709Settings
forall a. Maybe a
Prelude.Nothing,
      $sel:rec601Settings:H264ColorSpaceSettings' :: Maybe Rec601Settings
rec601Settings = Maybe Rec601Settings
forall a. Maybe a
Prelude.Nothing,
      $sel:colorSpacePassthroughSettings:H264ColorSpaceSettings' :: Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings = Maybe ColorSpacePassthroughSettings
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
h264ColorSpaceSettings_rec709Settings :: Lens.Lens' H264ColorSpaceSettings (Prelude.Maybe Rec709Settings)
h264ColorSpaceSettings_rec709Settings :: (Maybe Rec709Settings -> f (Maybe Rec709Settings))
-> H264ColorSpaceSettings -> f H264ColorSpaceSettings
h264ColorSpaceSettings_rec709Settings = (H264ColorSpaceSettings -> Maybe Rec709Settings)
-> (H264ColorSpaceSettings
    -> Maybe Rec709Settings -> H264ColorSpaceSettings)
-> Lens
     H264ColorSpaceSettings
     H264ColorSpaceSettings
     (Maybe Rec709Settings)
     (Maybe Rec709Settings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\H264ColorSpaceSettings' {Maybe Rec709Settings
rec709Settings :: Maybe Rec709Settings
$sel:rec709Settings:H264ColorSpaceSettings' :: H264ColorSpaceSettings -> Maybe Rec709Settings
rec709Settings} -> Maybe Rec709Settings
rec709Settings) (\s :: H264ColorSpaceSettings
s@H264ColorSpaceSettings' {} Maybe Rec709Settings
a -> H264ColorSpaceSettings
s {$sel:rec709Settings:H264ColorSpaceSettings' :: Maybe Rec709Settings
rec709Settings = Maybe Rec709Settings
a} :: H264ColorSpaceSettings)

-- | Undocumented member.
h264ColorSpaceSettings_rec601Settings :: Lens.Lens' H264ColorSpaceSettings (Prelude.Maybe Rec601Settings)
h264ColorSpaceSettings_rec601Settings :: (Maybe Rec601Settings -> f (Maybe Rec601Settings))
-> H264ColorSpaceSettings -> f H264ColorSpaceSettings
h264ColorSpaceSettings_rec601Settings = (H264ColorSpaceSettings -> Maybe Rec601Settings)
-> (H264ColorSpaceSettings
    -> Maybe Rec601Settings -> H264ColorSpaceSettings)
-> Lens
     H264ColorSpaceSettings
     H264ColorSpaceSettings
     (Maybe Rec601Settings)
     (Maybe Rec601Settings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\H264ColorSpaceSettings' {Maybe Rec601Settings
rec601Settings :: Maybe Rec601Settings
$sel:rec601Settings:H264ColorSpaceSettings' :: H264ColorSpaceSettings -> Maybe Rec601Settings
rec601Settings} -> Maybe Rec601Settings
rec601Settings) (\s :: H264ColorSpaceSettings
s@H264ColorSpaceSettings' {} Maybe Rec601Settings
a -> H264ColorSpaceSettings
s {$sel:rec601Settings:H264ColorSpaceSettings' :: Maybe Rec601Settings
rec601Settings = Maybe Rec601Settings
a} :: H264ColorSpaceSettings)

-- | Undocumented member.
h264ColorSpaceSettings_colorSpacePassthroughSettings :: Lens.Lens' H264ColorSpaceSettings (Prelude.Maybe ColorSpacePassthroughSettings)
h264ColorSpaceSettings_colorSpacePassthroughSettings :: (Maybe ColorSpacePassthroughSettings
 -> f (Maybe ColorSpacePassthroughSettings))
-> H264ColorSpaceSettings -> f H264ColorSpaceSettings
h264ColorSpaceSettings_colorSpacePassthroughSettings = (H264ColorSpaceSettings -> Maybe ColorSpacePassthroughSettings)
-> (H264ColorSpaceSettings
    -> Maybe ColorSpacePassthroughSettings -> H264ColorSpaceSettings)
-> Lens
     H264ColorSpaceSettings
     H264ColorSpaceSettings
     (Maybe ColorSpacePassthroughSettings)
     (Maybe ColorSpacePassthroughSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\H264ColorSpaceSettings' {Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings :: Maybe ColorSpacePassthroughSettings
$sel:colorSpacePassthroughSettings:H264ColorSpaceSettings' :: H264ColorSpaceSettings -> Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings} -> Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings) (\s :: H264ColorSpaceSettings
s@H264ColorSpaceSettings' {} Maybe ColorSpacePassthroughSettings
a -> H264ColorSpaceSettings
s {$sel:colorSpacePassthroughSettings:H264ColorSpaceSettings' :: Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings = Maybe ColorSpacePassthroughSettings
a} :: H264ColorSpaceSettings)

instance Core.FromJSON H264ColorSpaceSettings where
  parseJSON :: Value -> Parser H264ColorSpaceSettings
parseJSON =
    String
-> (Object -> Parser H264ColorSpaceSettings)
-> Value
-> Parser H264ColorSpaceSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"H264ColorSpaceSettings"
      ( \Object
x ->
          Maybe Rec709Settings
-> Maybe Rec601Settings
-> Maybe ColorSpacePassthroughSettings
-> H264ColorSpaceSettings
H264ColorSpaceSettings'
            (Maybe Rec709Settings
 -> Maybe Rec601Settings
 -> Maybe ColorSpacePassthroughSettings
 -> H264ColorSpaceSettings)
-> Parser (Maybe Rec709Settings)
-> Parser
     (Maybe Rec601Settings
      -> Maybe ColorSpacePassthroughSettings -> H264ColorSpaceSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Rec709Settings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"rec709Settings")
            Parser
  (Maybe Rec601Settings
   -> Maybe ColorSpacePassthroughSettings -> H264ColorSpaceSettings)
-> Parser (Maybe Rec601Settings)
-> Parser
     (Maybe ColorSpacePassthroughSettings -> H264ColorSpaceSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Rec601Settings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"rec601Settings")
            Parser
  (Maybe ColorSpacePassthroughSettings -> H264ColorSpaceSettings)
-> Parser (Maybe ColorSpacePassthroughSettings)
-> Parser H264ColorSpaceSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ColorSpacePassthroughSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"colorSpacePassthroughSettings")
      )

instance Prelude.Hashable H264ColorSpaceSettings

instance Prelude.NFData H264ColorSpaceSettings

instance Core.ToJSON H264ColorSpaceSettings where
  toJSON :: H264ColorSpaceSettings -> Value
toJSON H264ColorSpaceSettings' {Maybe ColorSpacePassthroughSettings
Maybe Rec601Settings
Maybe Rec709Settings
colorSpacePassthroughSettings :: Maybe ColorSpacePassthroughSettings
rec601Settings :: Maybe Rec601Settings
rec709Settings :: Maybe Rec709Settings
$sel:colorSpacePassthroughSettings:H264ColorSpaceSettings' :: H264ColorSpaceSettings -> Maybe ColorSpacePassthroughSettings
$sel:rec601Settings:H264ColorSpaceSettings' :: H264ColorSpaceSettings -> Maybe Rec601Settings
$sel:rec709Settings:H264ColorSpaceSettings' :: H264ColorSpaceSettings -> Maybe Rec709Settings
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"rec709Settings" Text -> Rec709Settings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Rec709Settings -> Pair) -> Maybe Rec709Settings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Rec709Settings
rec709Settings,
            (Text
"rec601Settings" Text -> Rec601Settings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Rec601Settings -> Pair) -> Maybe Rec601Settings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Rec601Settings
rec601Settings,
            (Text
"colorSpacePassthroughSettings" Text -> ColorSpacePassthroughSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ColorSpacePassthroughSettings -> Pair)
-> Maybe ColorSpacePassthroughSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ColorSpacePassthroughSettings
colorSpacePassthroughSettings
          ]
      )