{-# 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.MediaConvert.Types.AvailBlanking
-- 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.MediaConvert.Types.AvailBlanking where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Use ad avail blanking settings to specify your output content during
-- SCTE-35 triggered ad avails. You can blank your video or overlay it with
-- an image. MediaConvert also removes any audio and embedded captions
-- during the ad avail. For more information, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/ad-avail-blanking.html.
--
-- /See:/ 'newAvailBlanking' smart constructor.
data AvailBlanking = AvailBlanking'
  { -- | Blanking image to be used. Leave empty for solid black. Only bmp and png
    -- images are supported.
    AvailBlanking -> Maybe Text
availBlankingImage :: Prelude.Maybe Prelude.Text
  }
  deriving (AvailBlanking -> AvailBlanking -> Bool
(AvailBlanking -> AvailBlanking -> Bool)
-> (AvailBlanking -> AvailBlanking -> Bool) -> Eq AvailBlanking
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AvailBlanking -> AvailBlanking -> Bool
$c/= :: AvailBlanking -> AvailBlanking -> Bool
== :: AvailBlanking -> AvailBlanking -> Bool
$c== :: AvailBlanking -> AvailBlanking -> Bool
Prelude.Eq, ReadPrec [AvailBlanking]
ReadPrec AvailBlanking
Int -> ReadS AvailBlanking
ReadS [AvailBlanking]
(Int -> ReadS AvailBlanking)
-> ReadS [AvailBlanking]
-> ReadPrec AvailBlanking
-> ReadPrec [AvailBlanking]
-> Read AvailBlanking
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AvailBlanking]
$creadListPrec :: ReadPrec [AvailBlanking]
readPrec :: ReadPrec AvailBlanking
$creadPrec :: ReadPrec AvailBlanking
readList :: ReadS [AvailBlanking]
$creadList :: ReadS [AvailBlanking]
readsPrec :: Int -> ReadS AvailBlanking
$creadsPrec :: Int -> ReadS AvailBlanking
Prelude.Read, Int -> AvailBlanking -> ShowS
[AvailBlanking] -> ShowS
AvailBlanking -> String
(Int -> AvailBlanking -> ShowS)
-> (AvailBlanking -> String)
-> ([AvailBlanking] -> ShowS)
-> Show AvailBlanking
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AvailBlanking] -> ShowS
$cshowList :: [AvailBlanking] -> ShowS
show :: AvailBlanking -> String
$cshow :: AvailBlanking -> String
showsPrec :: Int -> AvailBlanking -> ShowS
$cshowsPrec :: Int -> AvailBlanking -> ShowS
Prelude.Show, (forall x. AvailBlanking -> Rep AvailBlanking x)
-> (forall x. Rep AvailBlanking x -> AvailBlanking)
-> Generic AvailBlanking
forall x. Rep AvailBlanking x -> AvailBlanking
forall x. AvailBlanking -> Rep AvailBlanking x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AvailBlanking x -> AvailBlanking
$cfrom :: forall x. AvailBlanking -> Rep AvailBlanking x
Prelude.Generic)

-- |
-- Create a value of 'AvailBlanking' 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:
--
-- 'availBlankingImage', 'availBlanking_availBlankingImage' - Blanking image to be used. Leave empty for solid black. Only bmp and png
-- images are supported.
newAvailBlanking ::
  AvailBlanking
newAvailBlanking :: AvailBlanking
newAvailBlanking =
  AvailBlanking' :: Maybe Text -> AvailBlanking
AvailBlanking'
    { $sel:availBlankingImage:AvailBlanking' :: Maybe Text
availBlankingImage =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Blanking image to be used. Leave empty for solid black. Only bmp and png
-- images are supported.
availBlanking_availBlankingImage :: Lens.Lens' AvailBlanking (Prelude.Maybe Prelude.Text)
availBlanking_availBlankingImage :: (Maybe Text -> f (Maybe Text)) -> AvailBlanking -> f AvailBlanking
availBlanking_availBlankingImage = (AvailBlanking -> Maybe Text)
-> (AvailBlanking -> Maybe Text -> AvailBlanking)
-> Lens AvailBlanking AvailBlanking (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AvailBlanking' {Maybe Text
availBlankingImage :: Maybe Text
$sel:availBlankingImage:AvailBlanking' :: AvailBlanking -> Maybe Text
availBlankingImage} -> Maybe Text
availBlankingImage) (\s :: AvailBlanking
s@AvailBlanking' {} Maybe Text
a -> AvailBlanking
s {$sel:availBlankingImage:AvailBlanking' :: Maybe Text
availBlankingImage = Maybe Text
a} :: AvailBlanking)

instance Core.FromJSON AvailBlanking where
  parseJSON :: Value -> Parser AvailBlanking
parseJSON =
    String
-> (Object -> Parser AvailBlanking)
-> Value
-> Parser AvailBlanking
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AvailBlanking"
      ( \Object
x ->
          Maybe Text -> AvailBlanking
AvailBlanking'
            (Maybe Text -> AvailBlanking)
-> Parser (Maybe Text) -> Parser AvailBlanking
forall (f :: * -> *) a b. Functor 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
"availBlankingImage")
      )

instance Prelude.Hashable AvailBlanking

instance Prelude.NFData AvailBlanking

instance Core.ToJSON AvailBlanking where
  toJSON :: AvailBlanking -> Value
toJSON AvailBlanking' {Maybe Text
availBlankingImage :: Maybe Text
$sel:availBlankingImage:AvailBlanking' :: AvailBlanking -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"availBlankingImage" 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
availBlankingImage
          ]
      )