{-# 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.StaticImageDeactivateScheduleActionSettings
-- 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.StaticImageDeactivateScheduleActionSettings where

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

-- | Settings for the action to deactivate the image in a specific layer.
--
-- /See:/ 'newStaticImageDeactivateScheduleActionSettings' smart constructor.
data StaticImageDeactivateScheduleActionSettings = StaticImageDeactivateScheduleActionSettings'
  { -- | The time in milliseconds for the image to fade out. Default is 0 (no
    -- fade-out).
    StaticImageDeactivateScheduleActionSettings -> Maybe Natural
fadeOut :: Prelude.Maybe Prelude.Natural,
    -- | The image overlay layer to deactivate, 0 to 7. Default is 0.
    StaticImageDeactivateScheduleActionSettings -> Maybe Natural
layer :: Prelude.Maybe Prelude.Natural
  }
  deriving (StaticImageDeactivateScheduleActionSettings
-> StaticImageDeactivateScheduleActionSettings -> Bool
(StaticImageDeactivateScheduleActionSettings
 -> StaticImageDeactivateScheduleActionSettings -> Bool)
-> (StaticImageDeactivateScheduleActionSettings
    -> StaticImageDeactivateScheduleActionSettings -> Bool)
-> Eq StaticImageDeactivateScheduleActionSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StaticImageDeactivateScheduleActionSettings
-> StaticImageDeactivateScheduleActionSettings -> Bool
$c/= :: StaticImageDeactivateScheduleActionSettings
-> StaticImageDeactivateScheduleActionSettings -> Bool
== :: StaticImageDeactivateScheduleActionSettings
-> StaticImageDeactivateScheduleActionSettings -> Bool
$c== :: StaticImageDeactivateScheduleActionSettings
-> StaticImageDeactivateScheduleActionSettings -> Bool
Prelude.Eq, ReadPrec [StaticImageDeactivateScheduleActionSettings]
ReadPrec StaticImageDeactivateScheduleActionSettings
Int -> ReadS StaticImageDeactivateScheduleActionSettings
ReadS [StaticImageDeactivateScheduleActionSettings]
(Int -> ReadS StaticImageDeactivateScheduleActionSettings)
-> ReadS [StaticImageDeactivateScheduleActionSettings]
-> ReadPrec StaticImageDeactivateScheduleActionSettings
-> ReadPrec [StaticImageDeactivateScheduleActionSettings]
-> Read StaticImageDeactivateScheduleActionSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StaticImageDeactivateScheduleActionSettings]
$creadListPrec :: ReadPrec [StaticImageDeactivateScheduleActionSettings]
readPrec :: ReadPrec StaticImageDeactivateScheduleActionSettings
$creadPrec :: ReadPrec StaticImageDeactivateScheduleActionSettings
readList :: ReadS [StaticImageDeactivateScheduleActionSettings]
$creadList :: ReadS [StaticImageDeactivateScheduleActionSettings]
readsPrec :: Int -> ReadS StaticImageDeactivateScheduleActionSettings
$creadsPrec :: Int -> ReadS StaticImageDeactivateScheduleActionSettings
Prelude.Read, Int -> StaticImageDeactivateScheduleActionSettings -> ShowS
[StaticImageDeactivateScheduleActionSettings] -> ShowS
StaticImageDeactivateScheduleActionSettings -> String
(Int -> StaticImageDeactivateScheduleActionSettings -> ShowS)
-> (StaticImageDeactivateScheduleActionSettings -> String)
-> ([StaticImageDeactivateScheduleActionSettings] -> ShowS)
-> Show StaticImageDeactivateScheduleActionSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StaticImageDeactivateScheduleActionSettings] -> ShowS
$cshowList :: [StaticImageDeactivateScheduleActionSettings] -> ShowS
show :: StaticImageDeactivateScheduleActionSettings -> String
$cshow :: StaticImageDeactivateScheduleActionSettings -> String
showsPrec :: Int -> StaticImageDeactivateScheduleActionSettings -> ShowS
$cshowsPrec :: Int -> StaticImageDeactivateScheduleActionSettings -> ShowS
Prelude.Show, (forall x.
 StaticImageDeactivateScheduleActionSettings
 -> Rep StaticImageDeactivateScheduleActionSettings x)
-> (forall x.
    Rep StaticImageDeactivateScheduleActionSettings x
    -> StaticImageDeactivateScheduleActionSettings)
-> Generic StaticImageDeactivateScheduleActionSettings
forall x.
Rep StaticImageDeactivateScheduleActionSettings x
-> StaticImageDeactivateScheduleActionSettings
forall x.
StaticImageDeactivateScheduleActionSettings
-> Rep StaticImageDeactivateScheduleActionSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StaticImageDeactivateScheduleActionSettings x
-> StaticImageDeactivateScheduleActionSettings
$cfrom :: forall x.
StaticImageDeactivateScheduleActionSettings
-> Rep StaticImageDeactivateScheduleActionSettings x
Prelude.Generic)

-- |
-- Create a value of 'StaticImageDeactivateScheduleActionSettings' 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:
--
-- 'fadeOut', 'staticImageDeactivateScheduleActionSettings_fadeOut' - The time in milliseconds for the image to fade out. Default is 0 (no
-- fade-out).
--
-- 'layer', 'staticImageDeactivateScheduleActionSettings_layer' - The image overlay layer to deactivate, 0 to 7. Default is 0.
newStaticImageDeactivateScheduleActionSettings ::
  StaticImageDeactivateScheduleActionSettings
newStaticImageDeactivateScheduleActionSettings :: StaticImageDeactivateScheduleActionSettings
newStaticImageDeactivateScheduleActionSettings =
  StaticImageDeactivateScheduleActionSettings' :: Maybe Natural
-> Maybe Natural -> StaticImageDeactivateScheduleActionSettings
StaticImageDeactivateScheduleActionSettings'
    { $sel:fadeOut:StaticImageDeactivateScheduleActionSettings' :: Maybe Natural
fadeOut =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:layer:StaticImageDeactivateScheduleActionSettings' :: Maybe Natural
layer = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The time in milliseconds for the image to fade out. Default is 0 (no
-- fade-out).
staticImageDeactivateScheduleActionSettings_fadeOut :: Lens.Lens' StaticImageDeactivateScheduleActionSettings (Prelude.Maybe Prelude.Natural)
staticImageDeactivateScheduleActionSettings_fadeOut :: (Maybe Natural -> f (Maybe Natural))
-> StaticImageDeactivateScheduleActionSettings
-> f StaticImageDeactivateScheduleActionSettings
staticImageDeactivateScheduleActionSettings_fadeOut = (StaticImageDeactivateScheduleActionSettings -> Maybe Natural)
-> (StaticImageDeactivateScheduleActionSettings
    -> Maybe Natural -> StaticImageDeactivateScheduleActionSettings)
-> Lens
     StaticImageDeactivateScheduleActionSettings
     StaticImageDeactivateScheduleActionSettings
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StaticImageDeactivateScheduleActionSettings' {Maybe Natural
fadeOut :: Maybe Natural
$sel:fadeOut:StaticImageDeactivateScheduleActionSettings' :: StaticImageDeactivateScheduleActionSettings -> Maybe Natural
fadeOut} -> Maybe Natural
fadeOut) (\s :: StaticImageDeactivateScheduleActionSettings
s@StaticImageDeactivateScheduleActionSettings' {} Maybe Natural
a -> StaticImageDeactivateScheduleActionSettings
s {$sel:fadeOut:StaticImageDeactivateScheduleActionSettings' :: Maybe Natural
fadeOut = Maybe Natural
a} :: StaticImageDeactivateScheduleActionSettings)

-- | The image overlay layer to deactivate, 0 to 7. Default is 0.
staticImageDeactivateScheduleActionSettings_layer :: Lens.Lens' StaticImageDeactivateScheduleActionSettings (Prelude.Maybe Prelude.Natural)
staticImageDeactivateScheduleActionSettings_layer :: (Maybe Natural -> f (Maybe Natural))
-> StaticImageDeactivateScheduleActionSettings
-> f StaticImageDeactivateScheduleActionSettings
staticImageDeactivateScheduleActionSettings_layer = (StaticImageDeactivateScheduleActionSettings -> Maybe Natural)
-> (StaticImageDeactivateScheduleActionSettings
    -> Maybe Natural -> StaticImageDeactivateScheduleActionSettings)
-> Lens
     StaticImageDeactivateScheduleActionSettings
     StaticImageDeactivateScheduleActionSettings
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StaticImageDeactivateScheduleActionSettings' {Maybe Natural
layer :: Maybe Natural
$sel:layer:StaticImageDeactivateScheduleActionSettings' :: StaticImageDeactivateScheduleActionSettings -> Maybe Natural
layer} -> Maybe Natural
layer) (\s :: StaticImageDeactivateScheduleActionSettings
s@StaticImageDeactivateScheduleActionSettings' {} Maybe Natural
a -> StaticImageDeactivateScheduleActionSettings
s {$sel:layer:StaticImageDeactivateScheduleActionSettings' :: Maybe Natural
layer = Maybe Natural
a} :: StaticImageDeactivateScheduleActionSettings)

instance
  Core.FromJSON
    StaticImageDeactivateScheduleActionSettings
  where
  parseJSON :: Value -> Parser StaticImageDeactivateScheduleActionSettings
parseJSON =
    String
-> (Object -> Parser StaticImageDeactivateScheduleActionSettings)
-> Value
-> Parser StaticImageDeactivateScheduleActionSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"StaticImageDeactivateScheduleActionSettings"
      ( \Object
x ->
          Maybe Natural
-> Maybe Natural -> StaticImageDeactivateScheduleActionSettings
StaticImageDeactivateScheduleActionSettings'
            (Maybe Natural
 -> Maybe Natural -> StaticImageDeactivateScheduleActionSettings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe Natural -> StaticImageDeactivateScheduleActionSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"fadeOut")
              Parser
  (Maybe Natural -> StaticImageDeactivateScheduleActionSettings)
-> Parser (Maybe Natural)
-> Parser StaticImageDeactivateScheduleActionSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"layer")
      )

instance
  Prelude.Hashable
    StaticImageDeactivateScheduleActionSettings

instance
  Prelude.NFData
    StaticImageDeactivateScheduleActionSettings

instance
  Core.ToJSON
    StaticImageDeactivateScheduleActionSettings
  where
  toJSON :: StaticImageDeactivateScheduleActionSettings -> Value
toJSON
    StaticImageDeactivateScheduleActionSettings' {Maybe Natural
layer :: Maybe Natural
fadeOut :: Maybe Natural
$sel:layer:StaticImageDeactivateScheduleActionSettings' :: StaticImageDeactivateScheduleActionSettings -> Maybe Natural
$sel:fadeOut:StaticImageDeactivateScheduleActionSettings' :: StaticImageDeactivateScheduleActionSettings -> Maybe Natural
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"fadeOut" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
fadeOut,
              (Text
"layer" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
layer
            ]
        )