{-# 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 #-}
module Amazonka.MediaLive.Types.VideoSelectorSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.VideoSelectorPid
import Amazonka.MediaLive.Types.VideoSelectorProgramId
import qualified Amazonka.Prelude as Prelude
data VideoSelectorSettings = VideoSelectorSettings'
{ VideoSelectorSettings -> Maybe VideoSelectorProgramId
videoSelectorProgramId :: Prelude.Maybe VideoSelectorProgramId,
VideoSelectorSettings -> Maybe VideoSelectorPid
videoSelectorPid :: Prelude.Maybe VideoSelectorPid
}
deriving (VideoSelectorSettings -> VideoSelectorSettings -> Bool
(VideoSelectorSettings -> VideoSelectorSettings -> Bool)
-> (VideoSelectorSettings -> VideoSelectorSettings -> Bool)
-> Eq VideoSelectorSettings
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]
(Int -> ReadS VideoSelectorSettings)
-> ReadS [VideoSelectorSettings]
-> ReadPrec VideoSelectorSettings
-> ReadPrec [VideoSelectorSettings]
-> Read 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
(Int -> VideoSelectorSettings -> ShowS)
-> (VideoSelectorSettings -> String)
-> ([VideoSelectorSettings] -> ShowS)
-> Show VideoSelectorSettings
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. VideoSelectorSettings -> Rep VideoSelectorSettings x)
-> (forall x. Rep VideoSelectorSettings x -> VideoSelectorSettings)
-> Generic VideoSelectorSettings
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)
newVideoSelectorSettings ::
VideoSelectorSettings
newVideoSelectorSettings :: VideoSelectorSettings
newVideoSelectorSettings =
VideoSelectorSettings' :: Maybe VideoSelectorProgramId
-> Maybe VideoSelectorPid -> VideoSelectorSettings
VideoSelectorSettings'
{ $sel:videoSelectorProgramId:VideoSelectorSettings' :: Maybe VideoSelectorProgramId
videoSelectorProgramId =
Maybe VideoSelectorProgramId
forall a. Maybe a
Prelude.Nothing,
$sel:videoSelectorPid:VideoSelectorSettings' :: Maybe VideoSelectorPid
videoSelectorPid = Maybe VideoSelectorPid
forall a. Maybe a
Prelude.Nothing
}
videoSelectorSettings_videoSelectorProgramId :: Lens.Lens' VideoSelectorSettings (Prelude.Maybe VideoSelectorProgramId)
videoSelectorSettings_videoSelectorProgramId :: (Maybe VideoSelectorProgramId -> f (Maybe VideoSelectorProgramId))
-> VideoSelectorSettings -> f VideoSelectorSettings
videoSelectorSettings_videoSelectorProgramId = (VideoSelectorSettings -> Maybe VideoSelectorProgramId)
-> (VideoSelectorSettings
-> Maybe VideoSelectorProgramId -> VideoSelectorSettings)
-> Lens
VideoSelectorSettings
VideoSelectorSettings
(Maybe VideoSelectorProgramId)
(Maybe 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)
videoSelectorSettings_videoSelectorPid :: Lens.Lens' VideoSelectorSettings (Prelude.Maybe VideoSelectorPid)
videoSelectorSettings_videoSelectorPid :: (Maybe VideoSelectorPid -> f (Maybe VideoSelectorPid))
-> VideoSelectorSettings -> f VideoSelectorSettings
videoSelectorSettings_videoSelectorPid = (VideoSelectorSettings -> Maybe VideoSelectorPid)
-> (VideoSelectorSettings
-> Maybe VideoSelectorPid -> VideoSelectorSettings)
-> Lens
VideoSelectorSettings
VideoSelectorSettings
(Maybe VideoSelectorPid)
(Maybe 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)
instance Core.FromJSON VideoSelectorSettings where
parseJSON :: Value -> Parser VideoSelectorSettings
parseJSON =
String
-> (Object -> Parser VideoSelectorSettings)
-> Value
-> Parser VideoSelectorSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"VideoSelectorSettings"
( \Object
x ->
Maybe VideoSelectorProgramId
-> Maybe VideoSelectorPid -> VideoSelectorSettings
VideoSelectorSettings'
(Maybe VideoSelectorProgramId
-> Maybe VideoSelectorPid -> VideoSelectorSettings)
-> Parser (Maybe VideoSelectorProgramId)
-> Parser (Maybe VideoSelectorPid -> VideoSelectorSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe VideoSelectorProgramId)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"videoSelectorProgramId")
Parser (Maybe VideoSelectorPid -> VideoSelectorSettings)
-> Parser (Maybe VideoSelectorPid) -> Parser VideoSelectorSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VideoSelectorPid)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"videoSelectorPid")
)
instance Prelude.Hashable VideoSelectorSettings
instance Prelude.NFData VideoSelectorSettings
instance Core.ToJSON VideoSelectorSettings where
toJSON :: VideoSelectorSettings -> Value
toJSON VideoSelectorSettings' {Maybe VideoSelectorPid
Maybe VideoSelectorProgramId
videoSelectorPid :: Maybe VideoSelectorPid
videoSelectorProgramId :: Maybe VideoSelectorProgramId
$sel:videoSelectorPid:VideoSelectorSettings' :: VideoSelectorSettings -> Maybe VideoSelectorPid
$sel:videoSelectorProgramId:VideoSelectorSettings' :: VideoSelectorSettings -> Maybe VideoSelectorProgramId
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"videoSelectorProgramId" Text -> VideoSelectorProgramId -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(VideoSelectorProgramId -> Pair)
-> Maybe VideoSelectorProgramId -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VideoSelectorProgramId
videoSelectorProgramId,
(Text
"videoSelectorPid" Text -> VideoSelectorPid -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(VideoSelectorPid -> Pair) -> Maybe VideoSelectorPid -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VideoSelectorPid
videoSelectorPid
]
)