{-# 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.FeatureActivations
-- 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.FeatureActivations 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.FeatureActivationsInputPrepareScheduleActions
import qualified Amazonka.Prelude as Prelude

-- | Feature Activations
--
-- /See:/ 'newFeatureActivations' smart constructor.
data FeatureActivations = FeatureActivations'
  { -- | Enables the Input Prepare feature. You can create Input Prepare actions
    -- in the schedule only if this feature is enabled. If you disable the
    -- feature on an existing schedule, make sure that you first delete all
    -- input prepare actions from the schedule.
    FeatureActivations
-> Maybe FeatureActivationsInputPrepareScheduleActions
inputPrepareScheduleActions :: Prelude.Maybe FeatureActivationsInputPrepareScheduleActions
  }
  deriving (FeatureActivations -> FeatureActivations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FeatureActivations -> FeatureActivations -> Bool
$c/= :: FeatureActivations -> FeatureActivations -> Bool
== :: FeatureActivations -> FeatureActivations -> Bool
$c== :: FeatureActivations -> FeatureActivations -> Bool
Prelude.Eq, ReadPrec [FeatureActivations]
ReadPrec FeatureActivations
Int -> ReadS FeatureActivations
ReadS [FeatureActivations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FeatureActivations]
$creadListPrec :: ReadPrec [FeatureActivations]
readPrec :: ReadPrec FeatureActivations
$creadPrec :: ReadPrec FeatureActivations
readList :: ReadS [FeatureActivations]
$creadList :: ReadS [FeatureActivations]
readsPrec :: Int -> ReadS FeatureActivations
$creadsPrec :: Int -> ReadS FeatureActivations
Prelude.Read, Int -> FeatureActivations -> ShowS
[FeatureActivations] -> ShowS
FeatureActivations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FeatureActivations] -> ShowS
$cshowList :: [FeatureActivations] -> ShowS
show :: FeatureActivations -> String
$cshow :: FeatureActivations -> String
showsPrec :: Int -> FeatureActivations -> ShowS
$cshowsPrec :: Int -> FeatureActivations -> ShowS
Prelude.Show, forall x. Rep FeatureActivations x -> FeatureActivations
forall x. FeatureActivations -> Rep FeatureActivations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FeatureActivations x -> FeatureActivations
$cfrom :: forall x. FeatureActivations -> Rep FeatureActivations x
Prelude.Generic)

-- |
-- Create a value of 'FeatureActivations' 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:
--
-- 'inputPrepareScheduleActions', 'featureActivations_inputPrepareScheduleActions' - Enables the Input Prepare feature. You can create Input Prepare actions
-- in the schedule only if this feature is enabled. If you disable the
-- feature on an existing schedule, make sure that you first delete all
-- input prepare actions from the schedule.
newFeatureActivations ::
  FeatureActivations
newFeatureActivations :: FeatureActivations
newFeatureActivations =
  FeatureActivations'
    { $sel:inputPrepareScheduleActions:FeatureActivations' :: Maybe FeatureActivationsInputPrepareScheduleActions
inputPrepareScheduleActions =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Enables the Input Prepare feature. You can create Input Prepare actions
-- in the schedule only if this feature is enabled. If you disable the
-- feature on an existing schedule, make sure that you first delete all
-- input prepare actions from the schedule.
featureActivations_inputPrepareScheduleActions :: Lens.Lens' FeatureActivations (Prelude.Maybe FeatureActivationsInputPrepareScheduleActions)
featureActivations_inputPrepareScheduleActions :: Lens'
  FeatureActivations
  (Maybe FeatureActivationsInputPrepareScheduleActions)
featureActivations_inputPrepareScheduleActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FeatureActivations' {Maybe FeatureActivationsInputPrepareScheduleActions
inputPrepareScheduleActions :: Maybe FeatureActivationsInputPrepareScheduleActions
$sel:inputPrepareScheduleActions:FeatureActivations' :: FeatureActivations
-> Maybe FeatureActivationsInputPrepareScheduleActions
inputPrepareScheduleActions} -> Maybe FeatureActivationsInputPrepareScheduleActions
inputPrepareScheduleActions) (\s :: FeatureActivations
s@FeatureActivations' {} Maybe FeatureActivationsInputPrepareScheduleActions
a -> FeatureActivations
s {$sel:inputPrepareScheduleActions:FeatureActivations' :: Maybe FeatureActivationsInputPrepareScheduleActions
inputPrepareScheduleActions = Maybe FeatureActivationsInputPrepareScheduleActions
a} :: FeatureActivations)

instance Data.FromJSON FeatureActivations where
  parseJSON :: Value -> Parser FeatureActivations
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FeatureActivations"
      ( \Object
x ->
          Maybe FeatureActivationsInputPrepareScheduleActions
-> FeatureActivations
FeatureActivations'
            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
"inputPrepareScheduleActions")
      )

instance Prelude.Hashable FeatureActivations where
  hashWithSalt :: Int -> FeatureActivations -> Int
hashWithSalt Int
_salt FeatureActivations' {Maybe FeatureActivationsInputPrepareScheduleActions
inputPrepareScheduleActions :: Maybe FeatureActivationsInputPrepareScheduleActions
$sel:inputPrepareScheduleActions:FeatureActivations' :: FeatureActivations
-> Maybe FeatureActivationsInputPrepareScheduleActions
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FeatureActivationsInputPrepareScheduleActions
inputPrepareScheduleActions

instance Prelude.NFData FeatureActivations where
  rnf :: FeatureActivations -> ()
rnf FeatureActivations' {Maybe FeatureActivationsInputPrepareScheduleActions
inputPrepareScheduleActions :: Maybe FeatureActivationsInputPrepareScheduleActions
$sel:inputPrepareScheduleActions:FeatureActivations' :: FeatureActivations
-> Maybe FeatureActivationsInputPrepareScheduleActions
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe FeatureActivationsInputPrepareScheduleActions
inputPrepareScheduleActions

instance Data.ToJSON FeatureActivations where
  toJSON :: FeatureActivations -> Value
toJSON FeatureActivations' {Maybe FeatureActivationsInputPrepareScheduleActions
inputPrepareScheduleActions :: Maybe FeatureActivationsInputPrepareScheduleActions
$sel:inputPrepareScheduleActions:FeatureActivations' :: FeatureActivations
-> Maybe FeatureActivationsInputPrepareScheduleActions
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"inputPrepareScheduleActions" 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 FeatureActivationsInputPrepareScheduleActions
inputPrepareScheduleActions
          ]
      )