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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.Hdr10Settings
import qualified Amazonka.Prelude as Prelude

-- | Video Selector Color Space Settings
--
-- /See:/ 'newVideoSelectorColorSpaceSettings' smart constructor.
data VideoSelectorColorSpaceSettings = VideoSelectorColorSpaceSettings'
  { VideoSelectorColorSpaceSettings -> Maybe Hdr10Settings
hdr10Settings :: Prelude.Maybe Hdr10Settings
  }
  deriving (VideoSelectorColorSpaceSettings
-> VideoSelectorColorSpaceSettings -> Bool
(VideoSelectorColorSpaceSettings
 -> VideoSelectorColorSpaceSettings -> Bool)
-> (VideoSelectorColorSpaceSettings
    -> VideoSelectorColorSpaceSettings -> Bool)
-> Eq VideoSelectorColorSpaceSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VideoSelectorColorSpaceSettings
-> VideoSelectorColorSpaceSettings -> Bool
$c/= :: VideoSelectorColorSpaceSettings
-> VideoSelectorColorSpaceSettings -> Bool
== :: VideoSelectorColorSpaceSettings
-> VideoSelectorColorSpaceSettings -> Bool
$c== :: VideoSelectorColorSpaceSettings
-> VideoSelectorColorSpaceSettings -> Bool
Prelude.Eq, ReadPrec [VideoSelectorColorSpaceSettings]
ReadPrec VideoSelectorColorSpaceSettings
Int -> ReadS VideoSelectorColorSpaceSettings
ReadS [VideoSelectorColorSpaceSettings]
(Int -> ReadS VideoSelectorColorSpaceSettings)
-> ReadS [VideoSelectorColorSpaceSettings]
-> ReadPrec VideoSelectorColorSpaceSettings
-> ReadPrec [VideoSelectorColorSpaceSettings]
-> Read VideoSelectorColorSpaceSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VideoSelectorColorSpaceSettings]
$creadListPrec :: ReadPrec [VideoSelectorColorSpaceSettings]
readPrec :: ReadPrec VideoSelectorColorSpaceSettings
$creadPrec :: ReadPrec VideoSelectorColorSpaceSettings
readList :: ReadS [VideoSelectorColorSpaceSettings]
$creadList :: ReadS [VideoSelectorColorSpaceSettings]
readsPrec :: Int -> ReadS VideoSelectorColorSpaceSettings
$creadsPrec :: Int -> ReadS VideoSelectorColorSpaceSettings
Prelude.Read, Int -> VideoSelectorColorSpaceSettings -> ShowS
[VideoSelectorColorSpaceSettings] -> ShowS
VideoSelectorColorSpaceSettings -> String
(Int -> VideoSelectorColorSpaceSettings -> ShowS)
-> (VideoSelectorColorSpaceSettings -> String)
-> ([VideoSelectorColorSpaceSettings] -> ShowS)
-> Show VideoSelectorColorSpaceSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VideoSelectorColorSpaceSettings] -> ShowS
$cshowList :: [VideoSelectorColorSpaceSettings] -> ShowS
show :: VideoSelectorColorSpaceSettings -> String
$cshow :: VideoSelectorColorSpaceSettings -> String
showsPrec :: Int -> VideoSelectorColorSpaceSettings -> ShowS
$cshowsPrec :: Int -> VideoSelectorColorSpaceSettings -> ShowS
Prelude.Show, (forall x.
 VideoSelectorColorSpaceSettings
 -> Rep VideoSelectorColorSpaceSettings x)
-> (forall x.
    Rep VideoSelectorColorSpaceSettings x
    -> VideoSelectorColorSpaceSettings)
-> Generic VideoSelectorColorSpaceSettings
forall x.
Rep VideoSelectorColorSpaceSettings x
-> VideoSelectorColorSpaceSettings
forall x.
VideoSelectorColorSpaceSettings
-> Rep VideoSelectorColorSpaceSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VideoSelectorColorSpaceSettings x
-> VideoSelectorColorSpaceSettings
$cfrom :: forall x.
VideoSelectorColorSpaceSettings
-> Rep VideoSelectorColorSpaceSettings x
Prelude.Generic)

-- |
-- Create a value of 'VideoSelectorColorSpaceSettings' 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:
--
-- 'hdr10Settings', 'videoSelectorColorSpaceSettings_hdr10Settings' - Undocumented member.
newVideoSelectorColorSpaceSettings ::
  VideoSelectorColorSpaceSettings
newVideoSelectorColorSpaceSettings :: VideoSelectorColorSpaceSettings
newVideoSelectorColorSpaceSettings =
  VideoSelectorColorSpaceSettings' :: Maybe Hdr10Settings -> VideoSelectorColorSpaceSettings
VideoSelectorColorSpaceSettings'
    { $sel:hdr10Settings:VideoSelectorColorSpaceSettings' :: Maybe Hdr10Settings
hdr10Settings =
        Maybe Hdr10Settings
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
videoSelectorColorSpaceSettings_hdr10Settings :: Lens.Lens' VideoSelectorColorSpaceSettings (Prelude.Maybe Hdr10Settings)
videoSelectorColorSpaceSettings_hdr10Settings :: (Maybe Hdr10Settings -> f (Maybe Hdr10Settings))
-> VideoSelectorColorSpaceSettings
-> f VideoSelectorColorSpaceSettings
videoSelectorColorSpaceSettings_hdr10Settings = (VideoSelectorColorSpaceSettings -> Maybe Hdr10Settings)
-> (VideoSelectorColorSpaceSettings
    -> Maybe Hdr10Settings -> VideoSelectorColorSpaceSettings)
-> Lens
     VideoSelectorColorSpaceSettings
     VideoSelectorColorSpaceSettings
     (Maybe Hdr10Settings)
     (Maybe Hdr10Settings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoSelectorColorSpaceSettings' {Maybe Hdr10Settings
hdr10Settings :: Maybe Hdr10Settings
$sel:hdr10Settings:VideoSelectorColorSpaceSettings' :: VideoSelectorColorSpaceSettings -> Maybe Hdr10Settings
hdr10Settings} -> Maybe Hdr10Settings
hdr10Settings) (\s :: VideoSelectorColorSpaceSettings
s@VideoSelectorColorSpaceSettings' {} Maybe Hdr10Settings
a -> VideoSelectorColorSpaceSettings
s {$sel:hdr10Settings:VideoSelectorColorSpaceSettings' :: Maybe Hdr10Settings
hdr10Settings = Maybe Hdr10Settings
a} :: VideoSelectorColorSpaceSettings)

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

instance
  Prelude.Hashable
    VideoSelectorColorSpaceSettings

instance
  Prelude.NFData
    VideoSelectorColorSpaceSettings

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