{-# 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.BlackoutSlate
-- 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.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

-- | Blackout Slate
--
-- /See:/ 'newBlackoutSlate' smart constructor.
data BlackoutSlate = BlackoutSlate'
  { -- | Path to local file to use as Network End Blackout image. Image will be
    -- scaled to fill the entire output raster.
    BlackoutSlate -> Maybe InputLocation
networkEndBlackoutImage :: Prelude.Maybe InputLocation,
    -- | When set to enabled, causes video, audio and captions to be blanked when
    -- indicated by program metadata.
    BlackoutSlate -> Maybe BlackoutSlateState
state :: Prelude.Maybe BlackoutSlateState,
    -- | Setting to enabled causes the encoder to blackout the video, audio, and
    -- captions, and raise the \"Network Blackout Image\" slate when an
    -- SCTE104\/35 Network End Segmentation Descriptor is encountered. The
    -- blackout will be lifted when the Network Start Segmentation Descriptor
    -- is encountered. The Network End and Network Start descriptors must
    -- contain a network ID that matches the value entered in \"Network ID\".
    BlackoutSlate -> Maybe BlackoutSlateNetworkEndBlackout
networkEndBlackout :: Prelude.Maybe BlackoutSlateNetworkEndBlackout,
    -- | Provides Network ID that matches EIDR ID format (e.g.,
    -- \"10.XXXX\/XXXX-XXXX-XXXX-XXXX-XXXX-C\").
    BlackoutSlate -> Maybe Text
networkId :: Prelude.Maybe Prelude.Text,
    -- | Blackout slate image to be used. Leave empty for solid black. Only bmp
    -- and png images are supported.
    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)

-- |
-- Create a value of 'BlackoutSlate' 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:
--
-- 'networkEndBlackoutImage', 'blackoutSlate_networkEndBlackoutImage' - Path to local file to use as Network End Blackout image. Image will be
-- scaled to fill the entire output raster.
--
-- 'state', 'blackoutSlate_state' - When set to enabled, causes video, audio and captions to be blanked when
-- indicated by program metadata.
--
-- 'networkEndBlackout', 'blackoutSlate_networkEndBlackout' - Setting to enabled causes the encoder to blackout the video, audio, and
-- captions, and raise the \"Network Blackout Image\" slate when an
-- SCTE104\/35 Network End Segmentation Descriptor is encountered. The
-- blackout will be lifted when the Network Start Segmentation Descriptor
-- is encountered. The Network End and Network Start descriptors must
-- contain a network ID that matches the value entered in \"Network ID\".
--
-- 'networkId', 'blackoutSlate_networkId' - Provides Network ID that matches EIDR ID format (e.g.,
-- \"10.XXXX\/XXXX-XXXX-XXXX-XXXX-XXXX-C\").
--
-- 'blackoutSlateImage', 'blackoutSlate_blackoutSlateImage' - Blackout slate image to be used. Leave empty for solid black. Only bmp
-- and png images are supported.
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
    }

-- | Path to local file to use as Network End Blackout image. Image will be
-- scaled to fill the entire output raster.
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)

-- | When set to enabled, causes video, audio and captions to be blanked when
-- indicated by program metadata.
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)

-- | Setting to enabled causes the encoder to blackout the video, audio, and
-- captions, and raise the \"Network Blackout Image\" slate when an
-- SCTE104\/35 Network End Segmentation Descriptor is encountered. The
-- blackout will be lifted when the Network Start Segmentation Descriptor
-- is encountered. The Network End and Network Start descriptors must
-- contain a network ID that matches the value entered in \"Network ID\".
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)

-- | Provides Network ID that matches EIDR ID format (e.g.,
-- \"10.XXXX\/XXXX-XXXX-XXXX-XXXX-XXXX-C\").
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)

-- | Blackout slate image to be used. Leave empty for solid black. Only bmp
-- and png images are supported.
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
          ]
      )