{-# 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.BlackoutSlate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.BlackoutSlateNetworkEndBlackout
import Amazonka.MediaLive.Types.BlackoutSlateState
import Amazonka.MediaLive.Types.InputLocation
import qualified Amazonka.Prelude as Prelude
data BlackoutSlate = BlackoutSlate'
{
BlackoutSlate -> Maybe InputLocation
networkEndBlackoutImage :: Prelude.Maybe InputLocation,
BlackoutSlate -> Maybe BlackoutSlateState
state :: Prelude.Maybe BlackoutSlateState,
BlackoutSlate -> Maybe BlackoutSlateNetworkEndBlackout
networkEndBlackout :: Prelude.Maybe BlackoutSlateNetworkEndBlackout,
BlackoutSlate -> Maybe Text
networkId :: Prelude.Maybe Prelude.Text,
BlackoutSlate -> Maybe InputLocation
blackoutSlateImage :: Prelude.Maybe InputLocation
}
deriving (BlackoutSlate -> BlackoutSlate -> Bool
(BlackoutSlate -> BlackoutSlate -> Bool)
-> (BlackoutSlate -> BlackoutSlate -> Bool) -> Eq BlackoutSlate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BlackoutSlate -> BlackoutSlate -> Bool
$c/= :: BlackoutSlate -> BlackoutSlate -> Bool
== :: BlackoutSlate -> BlackoutSlate -> Bool
$c== :: BlackoutSlate -> BlackoutSlate -> Bool
Prelude.Eq, ReadPrec [BlackoutSlate]
ReadPrec BlackoutSlate
Int -> ReadS BlackoutSlate
ReadS [BlackoutSlate]
(Int -> ReadS BlackoutSlate)
-> ReadS [BlackoutSlate]
-> ReadPrec BlackoutSlate
-> ReadPrec [BlackoutSlate]
-> Read BlackoutSlate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BlackoutSlate]
$creadListPrec :: ReadPrec [BlackoutSlate]
readPrec :: ReadPrec BlackoutSlate
$creadPrec :: ReadPrec BlackoutSlate
readList :: ReadS [BlackoutSlate]
$creadList :: ReadS [BlackoutSlate]
readsPrec :: Int -> ReadS BlackoutSlate
$creadsPrec :: Int -> ReadS BlackoutSlate
Prelude.Read, Int -> BlackoutSlate -> ShowS
[BlackoutSlate] -> ShowS
BlackoutSlate -> String
(Int -> BlackoutSlate -> ShowS)
-> (BlackoutSlate -> String)
-> ([BlackoutSlate] -> ShowS)
-> Show BlackoutSlate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BlackoutSlate] -> ShowS
$cshowList :: [BlackoutSlate] -> ShowS
show :: BlackoutSlate -> String
$cshow :: BlackoutSlate -> String
showsPrec :: Int -> BlackoutSlate -> ShowS
$cshowsPrec :: Int -> BlackoutSlate -> ShowS
Prelude.Show, (forall x. BlackoutSlate -> Rep BlackoutSlate x)
-> (forall x. Rep BlackoutSlate x -> BlackoutSlate)
-> Generic BlackoutSlate
forall x. Rep BlackoutSlate x -> BlackoutSlate
forall x. BlackoutSlate -> Rep BlackoutSlate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BlackoutSlate x -> BlackoutSlate
$cfrom :: forall x. BlackoutSlate -> Rep BlackoutSlate x
Prelude.Generic)
newBlackoutSlate ::
BlackoutSlate
newBlackoutSlate :: BlackoutSlate
newBlackoutSlate =
BlackoutSlate' :: Maybe InputLocation
-> Maybe BlackoutSlateState
-> Maybe BlackoutSlateNetworkEndBlackout
-> Maybe Text
-> Maybe InputLocation
-> BlackoutSlate
BlackoutSlate'
{ $sel:networkEndBlackoutImage:BlackoutSlate' :: Maybe InputLocation
networkEndBlackoutImage =
Maybe InputLocation
forall a. Maybe a
Prelude.Nothing,
$sel:state:BlackoutSlate' :: Maybe BlackoutSlateState
state = Maybe BlackoutSlateState
forall a. Maybe a
Prelude.Nothing,
$sel:networkEndBlackout:BlackoutSlate' :: Maybe BlackoutSlateNetworkEndBlackout
networkEndBlackout = Maybe BlackoutSlateNetworkEndBlackout
forall a. Maybe a
Prelude.Nothing,
$sel:networkId:BlackoutSlate' :: Maybe Text
networkId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:blackoutSlateImage:BlackoutSlate' :: Maybe InputLocation
blackoutSlateImage = Maybe InputLocation
forall a. Maybe a
Prelude.Nothing
}
blackoutSlate_networkEndBlackoutImage :: Lens.Lens' BlackoutSlate (Prelude.Maybe InputLocation)
blackoutSlate_networkEndBlackoutImage :: (Maybe InputLocation -> f (Maybe InputLocation))
-> BlackoutSlate -> f BlackoutSlate
blackoutSlate_networkEndBlackoutImage = (BlackoutSlate -> Maybe InputLocation)
-> (BlackoutSlate -> Maybe InputLocation -> BlackoutSlate)
-> Lens
BlackoutSlate
BlackoutSlate
(Maybe InputLocation)
(Maybe InputLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BlackoutSlate' {Maybe InputLocation
networkEndBlackoutImage :: Maybe InputLocation
$sel:networkEndBlackoutImage:BlackoutSlate' :: BlackoutSlate -> Maybe InputLocation
networkEndBlackoutImage} -> Maybe InputLocation
networkEndBlackoutImage) (\s :: BlackoutSlate
s@BlackoutSlate' {} Maybe InputLocation
a -> BlackoutSlate
s {$sel:networkEndBlackoutImage:BlackoutSlate' :: Maybe InputLocation
networkEndBlackoutImage = Maybe InputLocation
a} :: BlackoutSlate)
blackoutSlate_state :: Lens.Lens' BlackoutSlate (Prelude.Maybe BlackoutSlateState)
blackoutSlate_state :: (Maybe BlackoutSlateState -> f (Maybe BlackoutSlateState))
-> BlackoutSlate -> f BlackoutSlate
blackoutSlate_state = (BlackoutSlate -> Maybe BlackoutSlateState)
-> (BlackoutSlate -> Maybe BlackoutSlateState -> BlackoutSlate)
-> Lens
BlackoutSlate
BlackoutSlate
(Maybe BlackoutSlateState)
(Maybe BlackoutSlateState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BlackoutSlate' {Maybe BlackoutSlateState
state :: Maybe BlackoutSlateState
$sel:state:BlackoutSlate' :: BlackoutSlate -> Maybe BlackoutSlateState
state} -> Maybe BlackoutSlateState
state) (\s :: BlackoutSlate
s@BlackoutSlate' {} Maybe BlackoutSlateState
a -> BlackoutSlate
s {$sel:state:BlackoutSlate' :: Maybe BlackoutSlateState
state = Maybe BlackoutSlateState
a} :: BlackoutSlate)
blackoutSlate_networkEndBlackout :: Lens.Lens' BlackoutSlate (Prelude.Maybe BlackoutSlateNetworkEndBlackout)
blackoutSlate_networkEndBlackout :: (Maybe BlackoutSlateNetworkEndBlackout
-> f (Maybe BlackoutSlateNetworkEndBlackout))
-> BlackoutSlate -> f BlackoutSlate
blackoutSlate_networkEndBlackout = (BlackoutSlate -> Maybe BlackoutSlateNetworkEndBlackout)
-> (BlackoutSlate
-> Maybe BlackoutSlateNetworkEndBlackout -> BlackoutSlate)
-> Lens
BlackoutSlate
BlackoutSlate
(Maybe BlackoutSlateNetworkEndBlackout)
(Maybe BlackoutSlateNetworkEndBlackout)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BlackoutSlate' {Maybe BlackoutSlateNetworkEndBlackout
networkEndBlackout :: Maybe BlackoutSlateNetworkEndBlackout
$sel:networkEndBlackout:BlackoutSlate' :: BlackoutSlate -> Maybe BlackoutSlateNetworkEndBlackout
networkEndBlackout} -> Maybe BlackoutSlateNetworkEndBlackout
networkEndBlackout) (\s :: BlackoutSlate
s@BlackoutSlate' {} Maybe BlackoutSlateNetworkEndBlackout
a -> BlackoutSlate
s {$sel:networkEndBlackout:BlackoutSlate' :: Maybe BlackoutSlateNetworkEndBlackout
networkEndBlackout = Maybe BlackoutSlateNetworkEndBlackout
a} :: BlackoutSlate)
blackoutSlate_networkId :: Lens.Lens' BlackoutSlate (Prelude.Maybe Prelude.Text)
blackoutSlate_networkId :: (Maybe Text -> f (Maybe Text)) -> BlackoutSlate -> f BlackoutSlate
blackoutSlate_networkId = (BlackoutSlate -> Maybe Text)
-> (BlackoutSlate -> Maybe Text -> BlackoutSlate)
-> Lens BlackoutSlate BlackoutSlate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BlackoutSlate' {Maybe Text
networkId :: Maybe Text
$sel:networkId:BlackoutSlate' :: BlackoutSlate -> Maybe Text
networkId} -> Maybe Text
networkId) (\s :: BlackoutSlate
s@BlackoutSlate' {} Maybe Text
a -> BlackoutSlate
s {$sel:networkId:BlackoutSlate' :: Maybe Text
networkId = Maybe Text
a} :: BlackoutSlate)
blackoutSlate_blackoutSlateImage :: Lens.Lens' BlackoutSlate (Prelude.Maybe InputLocation)
blackoutSlate_blackoutSlateImage :: (Maybe InputLocation -> f (Maybe InputLocation))
-> BlackoutSlate -> f BlackoutSlate
blackoutSlate_blackoutSlateImage = (BlackoutSlate -> Maybe InputLocation)
-> (BlackoutSlate -> Maybe InputLocation -> BlackoutSlate)
-> Lens
BlackoutSlate
BlackoutSlate
(Maybe InputLocation)
(Maybe InputLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BlackoutSlate' {Maybe InputLocation
blackoutSlateImage :: Maybe InputLocation
$sel:blackoutSlateImage:BlackoutSlate' :: BlackoutSlate -> Maybe InputLocation
blackoutSlateImage} -> Maybe InputLocation
blackoutSlateImage) (\s :: BlackoutSlate
s@BlackoutSlate' {} Maybe InputLocation
a -> BlackoutSlate
s {$sel:blackoutSlateImage:BlackoutSlate' :: Maybe InputLocation
blackoutSlateImage = Maybe InputLocation
a} :: BlackoutSlate)
instance Core.FromJSON BlackoutSlate where
parseJSON :: Value -> Parser BlackoutSlate
parseJSON =
String
-> (Object -> Parser BlackoutSlate)
-> Value
-> Parser BlackoutSlate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BlackoutSlate"
( \Object
x ->
Maybe InputLocation
-> Maybe BlackoutSlateState
-> Maybe BlackoutSlateNetworkEndBlackout
-> Maybe Text
-> Maybe InputLocation
-> BlackoutSlate
BlackoutSlate'
(Maybe InputLocation
-> Maybe BlackoutSlateState
-> Maybe BlackoutSlateNetworkEndBlackout
-> Maybe Text
-> Maybe InputLocation
-> BlackoutSlate)
-> Parser (Maybe InputLocation)
-> Parser
(Maybe BlackoutSlateState
-> Maybe BlackoutSlateNetworkEndBlackout
-> Maybe Text
-> Maybe InputLocation
-> BlackoutSlate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InputLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"networkEndBlackoutImage")
Parser
(Maybe BlackoutSlateState
-> Maybe BlackoutSlateNetworkEndBlackout
-> Maybe Text
-> Maybe InputLocation
-> BlackoutSlate)
-> Parser (Maybe BlackoutSlateState)
-> Parser
(Maybe BlackoutSlateNetworkEndBlackout
-> Maybe Text -> Maybe InputLocation -> BlackoutSlate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BlackoutSlateState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
Parser
(Maybe BlackoutSlateNetworkEndBlackout
-> Maybe Text -> Maybe InputLocation -> BlackoutSlate)
-> Parser (Maybe BlackoutSlateNetworkEndBlackout)
-> Parser (Maybe Text -> Maybe InputLocation -> BlackoutSlate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BlackoutSlateNetworkEndBlackout)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"networkEndBlackout")
Parser (Maybe Text -> Maybe InputLocation -> BlackoutSlate)
-> Parser (Maybe Text)
-> Parser (Maybe InputLocation -> BlackoutSlate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"networkId")
Parser (Maybe InputLocation -> BlackoutSlate)
-> Parser (Maybe InputLocation) -> Parser BlackoutSlate
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InputLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"blackoutSlateImage")
)
instance Prelude.Hashable BlackoutSlate
instance Prelude.NFData BlackoutSlate
instance Core.ToJSON BlackoutSlate where
toJSON :: BlackoutSlate -> Value
toJSON BlackoutSlate' {Maybe Text
Maybe BlackoutSlateNetworkEndBlackout
Maybe BlackoutSlateState
Maybe InputLocation
blackoutSlateImage :: Maybe InputLocation
networkId :: Maybe Text
networkEndBlackout :: Maybe BlackoutSlateNetworkEndBlackout
state :: Maybe BlackoutSlateState
networkEndBlackoutImage :: Maybe InputLocation
$sel:blackoutSlateImage:BlackoutSlate' :: BlackoutSlate -> Maybe InputLocation
$sel:networkId:BlackoutSlate' :: BlackoutSlate -> Maybe Text
$sel:networkEndBlackout:BlackoutSlate' :: BlackoutSlate -> Maybe BlackoutSlateNetworkEndBlackout
$sel:state:BlackoutSlate' :: BlackoutSlate -> Maybe BlackoutSlateState
$sel:networkEndBlackoutImage:BlackoutSlate' :: BlackoutSlate -> Maybe InputLocation
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"networkEndBlackoutImage" Text -> InputLocation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(InputLocation -> Pair) -> Maybe InputLocation -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputLocation
networkEndBlackoutImage,
(Text
"state" Text -> BlackoutSlateState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BlackoutSlateState -> Pair)
-> Maybe BlackoutSlateState -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BlackoutSlateState
state,
(Text
"networkEndBlackout" Text -> BlackoutSlateNetworkEndBlackout -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(BlackoutSlateNetworkEndBlackout -> Pair)
-> Maybe BlackoutSlateNetworkEndBlackout -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BlackoutSlateNetworkEndBlackout
networkEndBlackout,
(Text
"networkId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
networkId,
(Text
"blackoutSlateImage" Text -> InputLocation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(InputLocation -> Pair) -> Maybe InputLocation -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputLocation
blackoutSlateImage
]
)