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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.VideoSelectorPid
import Amazonka.MediaLive.Types.VideoSelectorProgramId
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'VideoSelectorSettings' 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:
--
-- 'videoSelectorPid', 'videoSelectorSettings_videoSelectorPid' - Undocumented member.
--
-- 'videoSelectorProgramId', 'videoSelectorSettings_videoSelectorProgramId' - Undocumented member.
newVideoSelectorSettings ::
  VideoSelectorSettings
newVideoSelectorSettings :: VideoSelectorSettings
newVideoSelectorSettings =
  VideoSelectorSettings'
    { $sel:videoSelectorPid:VideoSelectorSettings' :: Maybe VideoSelectorPid
videoSelectorPid =
        forall a. Maybe a
Prelude.Nothing,
      $sel:videoSelectorProgramId:VideoSelectorSettings' :: Maybe VideoSelectorProgramId
videoSelectorProgramId = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
videoSelectorSettings_videoSelectorPid :: Lens.Lens' VideoSelectorSettings (Prelude.Maybe VideoSelectorPid)
videoSelectorSettings_videoSelectorPid :: Lens' VideoSelectorSettings (Maybe VideoSelectorPid)
videoSelectorSettings_videoSelectorPid = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoSelectorSettings' {Maybe VideoSelectorPid
videoSelectorPid :: Maybe VideoSelectorPid
$sel:videoSelectorPid:VideoSelectorSettings' :: VideoSelectorSettings -> Maybe VideoSelectorPid
videoSelectorPid} -> Maybe VideoSelectorPid
videoSelectorPid) (\s :: VideoSelectorSettings
s@VideoSelectorSettings' {} Maybe VideoSelectorPid
a -> VideoSelectorSettings
s {$sel:videoSelectorPid:VideoSelectorSettings' :: Maybe VideoSelectorPid
videoSelectorPid = Maybe VideoSelectorPid
a} :: VideoSelectorSettings)

-- | Undocumented member.
videoSelectorSettings_videoSelectorProgramId :: Lens.Lens' VideoSelectorSettings (Prelude.Maybe VideoSelectorProgramId)
videoSelectorSettings_videoSelectorProgramId :: Lens' VideoSelectorSettings (Maybe VideoSelectorProgramId)
videoSelectorSettings_videoSelectorProgramId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoSelectorSettings' {Maybe VideoSelectorProgramId
videoSelectorProgramId :: Maybe VideoSelectorProgramId
$sel:videoSelectorProgramId:VideoSelectorSettings' :: VideoSelectorSettings -> Maybe VideoSelectorProgramId
videoSelectorProgramId} -> Maybe VideoSelectorProgramId
videoSelectorProgramId) (\s :: VideoSelectorSettings
s@VideoSelectorSettings' {} Maybe VideoSelectorProgramId
a -> VideoSelectorSettings
s {$sel:videoSelectorProgramId:VideoSelectorSettings' :: Maybe VideoSelectorProgramId
videoSelectorProgramId = Maybe VideoSelectorProgramId
a} :: VideoSelectorSettings)

instance Data.FromJSON VideoSelectorSettings where
  parseJSON :: Value -> Parser VideoSelectorSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VideoSelectorSettings"
      ( \Object
x ->
          Maybe VideoSelectorPid
-> Maybe VideoSelectorProgramId -> VideoSelectorSettings
VideoSelectorSettings'
            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
"videoSelectorPid")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"videoSelectorProgramId")
      )

instance Prelude.Hashable VideoSelectorSettings where
  hashWithSalt :: Int -> VideoSelectorSettings -> Int
hashWithSalt Int
_salt VideoSelectorSettings' {Maybe VideoSelectorPid
Maybe VideoSelectorProgramId
videoSelectorProgramId :: Maybe VideoSelectorProgramId
videoSelectorPid :: Maybe VideoSelectorPid
$sel:videoSelectorProgramId:VideoSelectorSettings' :: VideoSelectorSettings -> Maybe VideoSelectorProgramId
$sel:videoSelectorPid:VideoSelectorSettings' :: VideoSelectorSettings -> Maybe VideoSelectorPid
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VideoSelectorPid
videoSelectorPid
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VideoSelectorProgramId
videoSelectorProgramId

instance Prelude.NFData VideoSelectorSettings where
  rnf :: VideoSelectorSettings -> ()
rnf VideoSelectorSettings' {Maybe VideoSelectorPid
Maybe VideoSelectorProgramId
videoSelectorProgramId :: Maybe VideoSelectorProgramId
videoSelectorPid :: Maybe VideoSelectorPid
$sel:videoSelectorProgramId:VideoSelectorSettings' :: VideoSelectorSettings -> Maybe VideoSelectorProgramId
$sel:videoSelectorPid:VideoSelectorSettings' :: VideoSelectorSettings -> Maybe VideoSelectorPid
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe VideoSelectorPid
videoSelectorPid
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VideoSelectorProgramId
videoSelectorProgramId

instance Data.ToJSON VideoSelectorSettings where
  toJSON :: VideoSelectorSettings -> Value
toJSON VideoSelectorSettings' {Maybe VideoSelectorPid
Maybe VideoSelectorProgramId
videoSelectorProgramId :: Maybe VideoSelectorProgramId
videoSelectorPid :: Maybe VideoSelectorPid
$sel:videoSelectorProgramId:VideoSelectorSettings' :: VideoSelectorSettings -> Maybe VideoSelectorProgramId
$sel:videoSelectorPid:VideoSelectorSettings' :: VideoSelectorSettings -> Maybe VideoSelectorPid
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"videoSelectorPid" 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 VideoSelectorPid
videoSelectorPid,
            (Key
"videoSelectorProgramId" 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 VideoSelectorProgramId
videoSelectorProgramId
          ]
      )