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

-- | Settings for a SCTE-35 time_signal.
--
-- /See:/ 'newScte35TimeSignalScheduleActionSettings' smart constructor.
data Scte35TimeSignalScheduleActionSettings = Scte35TimeSignalScheduleActionSettings'
  { -- | The list of SCTE-35 descriptors accompanying the SCTE-35 time_signal.
    Scte35TimeSignalScheduleActionSettings -> [Scte35Descriptor]
scte35Descriptors :: [Scte35Descriptor]
  }
  deriving (Scte35TimeSignalScheduleActionSettings
-> Scte35TimeSignalScheduleActionSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Scte35TimeSignalScheduleActionSettings
-> Scte35TimeSignalScheduleActionSettings -> Bool
$c/= :: Scte35TimeSignalScheduleActionSettings
-> Scte35TimeSignalScheduleActionSettings -> Bool
== :: Scte35TimeSignalScheduleActionSettings
-> Scte35TimeSignalScheduleActionSettings -> Bool
$c== :: Scte35TimeSignalScheduleActionSettings
-> Scte35TimeSignalScheduleActionSettings -> Bool
Prelude.Eq, ReadPrec [Scte35TimeSignalScheduleActionSettings]
ReadPrec Scte35TimeSignalScheduleActionSettings
Int -> ReadS Scte35TimeSignalScheduleActionSettings
ReadS [Scte35TimeSignalScheduleActionSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Scte35TimeSignalScheduleActionSettings]
$creadListPrec :: ReadPrec [Scte35TimeSignalScheduleActionSettings]
readPrec :: ReadPrec Scte35TimeSignalScheduleActionSettings
$creadPrec :: ReadPrec Scte35TimeSignalScheduleActionSettings
readList :: ReadS [Scte35TimeSignalScheduleActionSettings]
$creadList :: ReadS [Scte35TimeSignalScheduleActionSettings]
readsPrec :: Int -> ReadS Scte35TimeSignalScheduleActionSettings
$creadsPrec :: Int -> ReadS Scte35TimeSignalScheduleActionSettings
Prelude.Read, Int -> Scte35TimeSignalScheduleActionSettings -> ShowS
[Scte35TimeSignalScheduleActionSettings] -> ShowS
Scte35TimeSignalScheduleActionSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Scte35TimeSignalScheduleActionSettings] -> ShowS
$cshowList :: [Scte35TimeSignalScheduleActionSettings] -> ShowS
show :: Scte35TimeSignalScheduleActionSettings -> String
$cshow :: Scte35TimeSignalScheduleActionSettings -> String
showsPrec :: Int -> Scte35TimeSignalScheduleActionSettings -> ShowS
$cshowsPrec :: Int -> Scte35TimeSignalScheduleActionSettings -> ShowS
Prelude.Show, forall x.
Rep Scte35TimeSignalScheduleActionSettings x
-> Scte35TimeSignalScheduleActionSettings
forall x.
Scte35TimeSignalScheduleActionSettings
-> Rep Scte35TimeSignalScheduleActionSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep Scte35TimeSignalScheduleActionSettings x
-> Scte35TimeSignalScheduleActionSettings
$cfrom :: forall x.
Scte35TimeSignalScheduleActionSettings
-> Rep Scte35TimeSignalScheduleActionSettings x
Prelude.Generic)

-- |
-- Create a value of 'Scte35TimeSignalScheduleActionSettings' 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:
--
-- 'scte35Descriptors', 'scte35TimeSignalScheduleActionSettings_scte35Descriptors' - The list of SCTE-35 descriptors accompanying the SCTE-35 time_signal.
newScte35TimeSignalScheduleActionSettings ::
  Scte35TimeSignalScheduleActionSettings
newScte35TimeSignalScheduleActionSettings :: Scte35TimeSignalScheduleActionSettings
newScte35TimeSignalScheduleActionSettings =
  Scte35TimeSignalScheduleActionSettings'
    { $sel:scte35Descriptors:Scte35TimeSignalScheduleActionSettings' :: [Scte35Descriptor]
scte35Descriptors =
        forall a. Monoid a => a
Prelude.mempty
    }

-- | The list of SCTE-35 descriptors accompanying the SCTE-35 time_signal.
scte35TimeSignalScheduleActionSettings_scte35Descriptors :: Lens.Lens' Scte35TimeSignalScheduleActionSettings [Scte35Descriptor]
scte35TimeSignalScheduleActionSettings_scte35Descriptors :: Lens' Scte35TimeSignalScheduleActionSettings [Scte35Descriptor]
scte35TimeSignalScheduleActionSettings_scte35Descriptors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35TimeSignalScheduleActionSettings' {[Scte35Descriptor]
scte35Descriptors :: [Scte35Descriptor]
$sel:scte35Descriptors:Scte35TimeSignalScheduleActionSettings' :: Scte35TimeSignalScheduleActionSettings -> [Scte35Descriptor]
scte35Descriptors} -> [Scte35Descriptor]
scte35Descriptors) (\s :: Scte35TimeSignalScheduleActionSettings
s@Scte35TimeSignalScheduleActionSettings' {} [Scte35Descriptor]
a -> Scte35TimeSignalScheduleActionSettings
s {$sel:scte35Descriptors:Scte35TimeSignalScheduleActionSettings' :: [Scte35Descriptor]
scte35Descriptors = [Scte35Descriptor]
a} :: Scte35TimeSignalScheduleActionSettings) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Data.FromJSON
    Scte35TimeSignalScheduleActionSettings
  where
  parseJSON :: Value -> Parser Scte35TimeSignalScheduleActionSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Scte35TimeSignalScheduleActionSettings"
      ( \Object
x ->
          [Scte35Descriptor] -> Scte35TimeSignalScheduleActionSettings
Scte35TimeSignalScheduleActionSettings'
            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
"scte35Descriptors"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance
  Prelude.Hashable
    Scte35TimeSignalScheduleActionSettings
  where
  hashWithSalt :: Int -> Scte35TimeSignalScheduleActionSettings -> Int
hashWithSalt
    Int
_salt
    Scte35TimeSignalScheduleActionSettings' {[Scte35Descriptor]
scte35Descriptors :: [Scte35Descriptor]
$sel:scte35Descriptors:Scte35TimeSignalScheduleActionSettings' :: Scte35TimeSignalScheduleActionSettings -> [Scte35Descriptor]
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Scte35Descriptor]
scte35Descriptors

instance
  Prelude.NFData
    Scte35TimeSignalScheduleActionSettings
  where
  rnf :: Scte35TimeSignalScheduleActionSettings -> ()
rnf Scte35TimeSignalScheduleActionSettings' {[Scte35Descriptor]
scte35Descriptors :: [Scte35Descriptor]
$sel:scte35Descriptors:Scte35TimeSignalScheduleActionSettings' :: Scte35TimeSignalScheduleActionSettings -> [Scte35Descriptor]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf [Scte35Descriptor]
scte35Descriptors

instance
  Data.ToJSON
    Scte35TimeSignalScheduleActionSettings
  where
  toJSON :: Scte35TimeSignalScheduleActionSettings -> Value
toJSON Scte35TimeSignalScheduleActionSettings' {[Scte35Descriptor]
scte35Descriptors :: [Scte35Descriptor]
$sel:scte35Descriptors:Scte35TimeSignalScheduleActionSettings' :: Scte35TimeSignalScheduleActionSettings -> [Scte35Descriptor]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"scte35Descriptors" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Scte35Descriptor]
scte35Descriptors)
          ]
      )