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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
    { $sel:fadeOut:StaticImageDeactivateScheduleActionSettings' :: Maybe Natural
fadeOut =
        forall a. Maybe a
Prelude.Nothing,
      $sel:layer:StaticImageDeactivateScheduleActionSettings' :: Maybe Natural
layer = 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 :: Lens' StaticImageDeactivateScheduleActionSettings (Maybe Natural)
staticImageDeactivateScheduleActionSettings_fadeOut = 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 :: Lens' StaticImageDeactivateScheduleActionSettings (Maybe Natural)
staticImageDeactivateScheduleActionSettings_layer = 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
  Data.FromJSON
    StaticImageDeactivateScheduleActionSettings
  where
  parseJSON :: Value -> Parser StaticImageDeactivateScheduleActionSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StaticImageDeactivateScheduleActionSettings"
      ( \Object
x ->
          Maybe Natural
-> Maybe Natural -> StaticImageDeactivateScheduleActionSettings
StaticImageDeactivateScheduleActionSettings'
            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
"fadeOut")
            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
"layer")
      )

instance
  Prelude.Hashable
    StaticImageDeactivateScheduleActionSettings
  where
  hashWithSalt :: Int -> StaticImageDeactivateScheduleActionSettings -> Int
hashWithSalt
    Int
_salt
    StaticImageDeactivateScheduleActionSettings' {Maybe Natural
layer :: Maybe Natural
fadeOut :: Maybe Natural
$sel:layer:StaticImageDeactivateScheduleActionSettings' :: StaticImageDeactivateScheduleActionSettings -> Maybe Natural
$sel:fadeOut:StaticImageDeactivateScheduleActionSettings' :: StaticImageDeactivateScheduleActionSettings -> Maybe Natural
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
fadeOut
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
layer

instance
  Prelude.NFData
    StaticImageDeactivateScheduleActionSettings
  where
  rnf :: StaticImageDeactivateScheduleActionSettings -> ()
rnf StaticImageDeactivateScheduleActionSettings' {Maybe Natural
layer :: Maybe Natural
fadeOut :: Maybe Natural
$sel:layer:StaticImageDeactivateScheduleActionSettings' :: StaticImageDeactivateScheduleActionSettings -> Maybe Natural
$sel:fadeOut:StaticImageDeactivateScheduleActionSettings' :: StaticImageDeactivateScheduleActionSettings -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
fadeOut seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
layer

instance
  Data.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
Data.object
        ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Key
"fadeOut" 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 Natural
fadeOut,
              (Key
"layer" 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 Natural
layer
            ]
        )