{-# 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-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.BlackoutSlate 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.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'
  { -- | 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,
    -- | 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,
    -- | 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,
    -- | 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,
    -- | When set to enabled, causes video, audio and captions to be blanked when
    -- indicated by program metadata.
    BlackoutSlate -> Maybe BlackoutSlateState
state :: Prelude.Maybe BlackoutSlateState
  }
  deriving (BlackoutSlate -> BlackoutSlate -> Bool
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]
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
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. 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:
--
-- 'blackoutSlateImage', 'blackoutSlate_blackoutSlateImage' - Blackout slate image to be used. Leave empty for solid black. Only bmp
-- and png images are supported.
--
-- '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\".
--
-- 'networkEndBlackoutImage', 'blackoutSlate_networkEndBlackoutImage' - Path to local file to use as Network End Blackout image. Image will be
-- scaled to fill the entire output raster.
--
-- 'networkId', 'blackoutSlate_networkId' - Provides Network ID that matches EIDR ID format (e.g.,
-- \"10.XXXX\/XXXX-XXXX-XXXX-XXXX-XXXX-C\").
--
-- 'state', 'blackoutSlate_state' - When set to enabled, causes video, audio and captions to be blanked when
-- indicated by program metadata.
newBlackoutSlate ::
  BlackoutSlate
newBlackoutSlate :: BlackoutSlate
newBlackoutSlate =
  BlackoutSlate'
    { $sel:blackoutSlateImage:BlackoutSlate' :: Maybe InputLocation
blackoutSlateImage =
        forall a. Maybe a
Prelude.Nothing,
      $sel:networkEndBlackout:BlackoutSlate' :: Maybe BlackoutSlateNetworkEndBlackout
networkEndBlackout = forall a. Maybe a
Prelude.Nothing,
      $sel:networkEndBlackoutImage:BlackoutSlate' :: Maybe InputLocation
networkEndBlackoutImage = forall a. Maybe a
Prelude.Nothing,
      $sel:networkId:BlackoutSlate' :: Maybe Text
networkId = forall a. Maybe a
Prelude.Nothing,
      $sel:state:BlackoutSlate' :: Maybe BlackoutSlateState
state = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' BlackoutSlate (Maybe InputLocation)
blackoutSlate_blackoutSlateImage = 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)

-- | 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 :: Lens' BlackoutSlate (Maybe BlackoutSlateNetworkEndBlackout)
blackoutSlate_networkEndBlackout = 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)

-- | 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 :: Lens' BlackoutSlate (Maybe InputLocation)
blackoutSlate_networkEndBlackoutImage = 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)

-- | 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 :: Lens' BlackoutSlate (Maybe Text)
blackoutSlate_networkId = 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)

-- | 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 :: Lens' BlackoutSlate (Maybe BlackoutSlateState)
blackoutSlate_state = 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)

instance Data.FromJSON BlackoutSlate where
  parseJSON :: Value -> Parser BlackoutSlate
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BlackoutSlate"
      ( \Object
x ->
          Maybe InputLocation
-> Maybe BlackoutSlateNetworkEndBlackout
-> Maybe InputLocation
-> Maybe Text
-> Maybe BlackoutSlateState
-> BlackoutSlate
BlackoutSlate'
            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
"blackoutSlateImage")
            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
"networkEndBlackout")
            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
"networkEndBlackoutImage")
            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
"networkId")
            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
"state")
      )

instance Prelude.Hashable BlackoutSlate where
  hashWithSalt :: Int -> BlackoutSlate -> Int
hashWithSalt Int
_salt BlackoutSlate' {Maybe Text
Maybe BlackoutSlateNetworkEndBlackout
Maybe BlackoutSlateState
Maybe InputLocation
state :: Maybe BlackoutSlateState
networkId :: Maybe Text
networkEndBlackoutImage :: Maybe InputLocation
networkEndBlackout :: Maybe BlackoutSlateNetworkEndBlackout
blackoutSlateImage :: Maybe InputLocation
$sel:state:BlackoutSlate' :: BlackoutSlate -> Maybe BlackoutSlateState
$sel:networkId:BlackoutSlate' :: BlackoutSlate -> Maybe Text
$sel:networkEndBlackoutImage:BlackoutSlate' :: BlackoutSlate -> Maybe InputLocation
$sel:networkEndBlackout:BlackoutSlate' :: BlackoutSlate -> Maybe BlackoutSlateNetworkEndBlackout
$sel:blackoutSlateImage:BlackoutSlate' :: BlackoutSlate -> Maybe InputLocation
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InputLocation
blackoutSlateImage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BlackoutSlateNetworkEndBlackout
networkEndBlackout
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InputLocation
networkEndBlackoutImage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
networkId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BlackoutSlateState
state

instance Prelude.NFData BlackoutSlate where
  rnf :: BlackoutSlate -> ()
rnf BlackoutSlate' {Maybe Text
Maybe BlackoutSlateNetworkEndBlackout
Maybe BlackoutSlateState
Maybe InputLocation
state :: Maybe BlackoutSlateState
networkId :: Maybe Text
networkEndBlackoutImage :: Maybe InputLocation
networkEndBlackout :: Maybe BlackoutSlateNetworkEndBlackout
blackoutSlateImage :: Maybe InputLocation
$sel:state:BlackoutSlate' :: BlackoutSlate -> Maybe BlackoutSlateState
$sel:networkId:BlackoutSlate' :: BlackoutSlate -> Maybe Text
$sel:networkEndBlackoutImage:BlackoutSlate' :: BlackoutSlate -> Maybe InputLocation
$sel:networkEndBlackout:BlackoutSlate' :: BlackoutSlate -> Maybe BlackoutSlateNetworkEndBlackout
$sel:blackoutSlateImage:BlackoutSlate' :: BlackoutSlate -> Maybe InputLocation
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe InputLocation
blackoutSlateImage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BlackoutSlateNetworkEndBlackout
networkEndBlackout
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InputLocation
networkEndBlackoutImage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
networkId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BlackoutSlateState
state

instance Data.ToJSON BlackoutSlate where
  toJSON :: BlackoutSlate -> Value
toJSON BlackoutSlate' {Maybe Text
Maybe BlackoutSlateNetworkEndBlackout
Maybe BlackoutSlateState
Maybe InputLocation
state :: Maybe BlackoutSlateState
networkId :: Maybe Text
networkEndBlackoutImage :: Maybe InputLocation
networkEndBlackout :: Maybe BlackoutSlateNetworkEndBlackout
blackoutSlateImage :: Maybe InputLocation
$sel:state:BlackoutSlate' :: BlackoutSlate -> Maybe BlackoutSlateState
$sel:networkId:BlackoutSlate' :: BlackoutSlate -> Maybe Text
$sel:networkEndBlackoutImage:BlackoutSlate' :: BlackoutSlate -> Maybe InputLocation
$sel:networkEndBlackout:BlackoutSlate' :: BlackoutSlate -> Maybe BlackoutSlateNetworkEndBlackout
$sel:blackoutSlateImage:BlackoutSlate' :: BlackoutSlate -> Maybe InputLocation
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"blackoutSlateImage" 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 InputLocation
blackoutSlateImage,
            (Key
"networkEndBlackout" 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 BlackoutSlateNetworkEndBlackout
networkEndBlackout,
            (Key
"networkEndBlackoutImage" 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 InputLocation
networkEndBlackoutImage,
            (Key
"networkId" 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 Text
networkId,
            (Key
"state" 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 BlackoutSlateState
state
          ]
      )