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

-- | Scte35Input Schedule Action Settings
--
-- /See:/ 'newScte35InputScheduleActionSettings' smart constructor.
data Scte35InputScheduleActionSettings = Scte35InputScheduleActionSettings'
  { -- | In fixed mode, enter the name of the input attachment that you want to
    -- use as a SCTE-35 input. (Don\'t enter the ID of the input.)\"
    Scte35InputScheduleActionSettings -> Maybe Text
inputAttachmentNameReference :: Prelude.Maybe Prelude.Text,
    -- | Whether the SCTE-35 input should be the active input or a fixed input.
    Scte35InputScheduleActionSettings -> Scte35InputMode
mode :: Scte35InputMode
  }
  deriving (Scte35InputScheduleActionSettings
-> Scte35InputScheduleActionSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Scte35InputScheduleActionSettings
-> Scte35InputScheduleActionSettings -> Bool
$c/= :: Scte35InputScheduleActionSettings
-> Scte35InputScheduleActionSettings -> Bool
== :: Scte35InputScheduleActionSettings
-> Scte35InputScheduleActionSettings -> Bool
$c== :: Scte35InputScheduleActionSettings
-> Scte35InputScheduleActionSettings -> Bool
Prelude.Eq, ReadPrec [Scte35InputScheduleActionSettings]
ReadPrec Scte35InputScheduleActionSettings
Int -> ReadS Scte35InputScheduleActionSettings
ReadS [Scte35InputScheduleActionSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Scte35InputScheduleActionSettings]
$creadListPrec :: ReadPrec [Scte35InputScheduleActionSettings]
readPrec :: ReadPrec Scte35InputScheduleActionSettings
$creadPrec :: ReadPrec Scte35InputScheduleActionSettings
readList :: ReadS [Scte35InputScheduleActionSettings]
$creadList :: ReadS [Scte35InputScheduleActionSettings]
readsPrec :: Int -> ReadS Scte35InputScheduleActionSettings
$creadsPrec :: Int -> ReadS Scte35InputScheduleActionSettings
Prelude.Read, Int -> Scte35InputScheduleActionSettings -> ShowS
[Scte35InputScheduleActionSettings] -> ShowS
Scte35InputScheduleActionSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Scte35InputScheduleActionSettings] -> ShowS
$cshowList :: [Scte35InputScheduleActionSettings] -> ShowS
show :: Scte35InputScheduleActionSettings -> String
$cshow :: Scte35InputScheduleActionSettings -> String
showsPrec :: Int -> Scte35InputScheduleActionSettings -> ShowS
$cshowsPrec :: Int -> Scte35InputScheduleActionSettings -> ShowS
Prelude.Show, forall x.
Rep Scte35InputScheduleActionSettings x
-> Scte35InputScheduleActionSettings
forall x.
Scte35InputScheduleActionSettings
-> Rep Scte35InputScheduleActionSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep Scte35InputScheduleActionSettings x
-> Scte35InputScheduleActionSettings
$cfrom :: forall x.
Scte35InputScheduleActionSettings
-> Rep Scte35InputScheduleActionSettings x
Prelude.Generic)

-- |
-- Create a value of 'Scte35InputScheduleActionSettings' 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:
--
-- 'inputAttachmentNameReference', 'scte35InputScheduleActionSettings_inputAttachmentNameReference' - In fixed mode, enter the name of the input attachment that you want to
-- use as a SCTE-35 input. (Don\'t enter the ID of the input.)\"
--
-- 'mode', 'scte35InputScheduleActionSettings_mode' - Whether the SCTE-35 input should be the active input or a fixed input.
newScte35InputScheduleActionSettings ::
  -- | 'mode'
  Scte35InputMode ->
  Scte35InputScheduleActionSettings
newScte35InputScheduleActionSettings :: Scte35InputMode -> Scte35InputScheduleActionSettings
newScte35InputScheduleActionSettings Scte35InputMode
pMode_ =
  Scte35InputScheduleActionSettings'
    { $sel:inputAttachmentNameReference:Scte35InputScheduleActionSettings' :: Maybe Text
inputAttachmentNameReference =
        forall a. Maybe a
Prelude.Nothing,
      $sel:mode:Scte35InputScheduleActionSettings' :: Scte35InputMode
mode = Scte35InputMode
pMode_
    }

-- | In fixed mode, enter the name of the input attachment that you want to
-- use as a SCTE-35 input. (Don\'t enter the ID of the input.)\"
scte35InputScheduleActionSettings_inputAttachmentNameReference :: Lens.Lens' Scte35InputScheduleActionSettings (Prelude.Maybe Prelude.Text)
scte35InputScheduleActionSettings_inputAttachmentNameReference :: Lens' Scte35InputScheduleActionSettings (Maybe Text)
scte35InputScheduleActionSettings_inputAttachmentNameReference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35InputScheduleActionSettings' {Maybe Text
inputAttachmentNameReference :: Maybe Text
$sel:inputAttachmentNameReference:Scte35InputScheduleActionSettings' :: Scte35InputScheduleActionSettings -> Maybe Text
inputAttachmentNameReference} -> Maybe Text
inputAttachmentNameReference) (\s :: Scte35InputScheduleActionSettings
s@Scte35InputScheduleActionSettings' {} Maybe Text
a -> Scte35InputScheduleActionSettings
s {$sel:inputAttachmentNameReference:Scte35InputScheduleActionSettings' :: Maybe Text
inputAttachmentNameReference = Maybe Text
a} :: Scte35InputScheduleActionSettings)

-- | Whether the SCTE-35 input should be the active input or a fixed input.
scte35InputScheduleActionSettings_mode :: Lens.Lens' Scte35InputScheduleActionSettings Scte35InputMode
scte35InputScheduleActionSettings_mode :: Lens' Scte35InputScheduleActionSettings Scte35InputMode
scte35InputScheduleActionSettings_mode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35InputScheduleActionSettings' {Scte35InputMode
mode :: Scte35InputMode
$sel:mode:Scte35InputScheduleActionSettings' :: Scte35InputScheduleActionSettings -> Scte35InputMode
mode} -> Scte35InputMode
mode) (\s :: Scte35InputScheduleActionSettings
s@Scte35InputScheduleActionSettings' {} Scte35InputMode
a -> Scte35InputScheduleActionSettings
s {$sel:mode:Scte35InputScheduleActionSettings' :: Scte35InputMode
mode = Scte35InputMode
a} :: Scte35InputScheduleActionSettings)

instance
  Data.FromJSON
    Scte35InputScheduleActionSettings
  where
  parseJSON :: Value -> Parser Scte35InputScheduleActionSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Scte35InputScheduleActionSettings"
      ( \Object
x ->
          Maybe Text -> Scte35InputMode -> Scte35InputScheduleActionSettings
Scte35InputScheduleActionSettings'
            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
"inputAttachmentNameReference")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"mode")
      )

instance
  Prelude.Hashable
    Scte35InputScheduleActionSettings
  where
  hashWithSalt :: Int -> Scte35InputScheduleActionSettings -> Int
hashWithSalt
    Int
_salt
    Scte35InputScheduleActionSettings' {Maybe Text
Scte35InputMode
mode :: Scte35InputMode
inputAttachmentNameReference :: Maybe Text
$sel:mode:Scte35InputScheduleActionSettings' :: Scte35InputScheduleActionSettings -> Scte35InputMode
$sel:inputAttachmentNameReference:Scte35InputScheduleActionSettings' :: Scte35InputScheduleActionSettings -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
inputAttachmentNameReference
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Scte35InputMode
mode

instance
  Prelude.NFData
    Scte35InputScheduleActionSettings
  where
  rnf :: Scte35InputScheduleActionSettings -> ()
rnf Scte35InputScheduleActionSettings' {Maybe Text
Scte35InputMode
mode :: Scte35InputMode
inputAttachmentNameReference :: Maybe Text
$sel:mode:Scte35InputScheduleActionSettings' :: Scte35InputScheduleActionSettings -> Scte35InputMode
$sel:inputAttachmentNameReference:Scte35InputScheduleActionSettings' :: Scte35InputScheduleActionSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
inputAttachmentNameReference
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Scte35InputMode
mode

instance
  Data.ToJSON
    Scte35InputScheduleActionSettings
  where
  toJSON :: Scte35InputScheduleActionSettings -> Value
toJSON Scte35InputScheduleActionSettings' {Maybe Text
Scte35InputMode
mode :: Scte35InputMode
inputAttachmentNameReference :: Maybe Text
$sel:mode:Scte35InputScheduleActionSettings' :: Scte35InputScheduleActionSettings -> Scte35InputMode
$sel:inputAttachmentNameReference:Scte35InputScheduleActionSettings' :: Scte35InputScheduleActionSettings -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"inputAttachmentNameReference" 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
inputAttachmentNameReference,
            forall a. a -> Maybe a
Prelude.Just (Key
"mode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Scte35InputMode
mode)
          ]
      )