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

-- | Holds one set of SCTE-35 Descriptor Settings.
--
-- /See:/ 'newScte35Descriptor' smart constructor.
data Scte35Descriptor = Scte35Descriptor'
  { -- | SCTE-35 Descriptor Settings.
    Scte35Descriptor -> Scte35DescriptorSettings
scte35DescriptorSettings :: Scte35DescriptorSettings
  }
  deriving (Scte35Descriptor -> Scte35Descriptor -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Scte35Descriptor -> Scte35Descriptor -> Bool
$c/= :: Scte35Descriptor -> Scte35Descriptor -> Bool
== :: Scte35Descriptor -> Scte35Descriptor -> Bool
$c== :: Scte35Descriptor -> Scte35Descriptor -> Bool
Prelude.Eq, ReadPrec [Scte35Descriptor]
ReadPrec Scte35Descriptor
Int -> ReadS Scte35Descriptor
ReadS [Scte35Descriptor]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Scte35Descriptor]
$creadListPrec :: ReadPrec [Scte35Descriptor]
readPrec :: ReadPrec Scte35Descriptor
$creadPrec :: ReadPrec Scte35Descriptor
readList :: ReadS [Scte35Descriptor]
$creadList :: ReadS [Scte35Descriptor]
readsPrec :: Int -> ReadS Scte35Descriptor
$creadsPrec :: Int -> ReadS Scte35Descriptor
Prelude.Read, Int -> Scte35Descriptor -> ShowS
[Scte35Descriptor] -> ShowS
Scte35Descriptor -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Scte35Descriptor] -> ShowS
$cshowList :: [Scte35Descriptor] -> ShowS
show :: Scte35Descriptor -> String
$cshow :: Scte35Descriptor -> String
showsPrec :: Int -> Scte35Descriptor -> ShowS
$cshowsPrec :: Int -> Scte35Descriptor -> ShowS
Prelude.Show, forall x. Rep Scte35Descriptor x -> Scte35Descriptor
forall x. Scte35Descriptor -> Rep Scte35Descriptor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Scte35Descriptor x -> Scte35Descriptor
$cfrom :: forall x. Scte35Descriptor -> Rep Scte35Descriptor x
Prelude.Generic)

-- |
-- Create a value of 'Scte35Descriptor' 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:
--
-- 'scte35DescriptorSettings', 'scte35Descriptor_scte35DescriptorSettings' - SCTE-35 Descriptor Settings.
newScte35Descriptor ::
  -- | 'scte35DescriptorSettings'
  Scte35DescriptorSettings ->
  Scte35Descriptor
newScte35Descriptor :: Scte35DescriptorSettings -> Scte35Descriptor
newScte35Descriptor Scte35DescriptorSettings
pScte35DescriptorSettings_ =
  Scte35Descriptor'
    { $sel:scte35DescriptorSettings:Scte35Descriptor' :: Scte35DescriptorSettings
scte35DescriptorSettings =
        Scte35DescriptorSettings
pScte35DescriptorSettings_
    }

-- | SCTE-35 Descriptor Settings.
scte35Descriptor_scte35DescriptorSettings :: Lens.Lens' Scte35Descriptor Scte35DescriptorSettings
scte35Descriptor_scte35DescriptorSettings :: Lens' Scte35Descriptor Scte35DescriptorSettings
scte35Descriptor_scte35DescriptorSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35Descriptor' {Scte35DescriptorSettings
scte35DescriptorSettings :: Scte35DescriptorSettings
$sel:scte35DescriptorSettings:Scte35Descriptor' :: Scte35Descriptor -> Scte35DescriptorSettings
scte35DescriptorSettings} -> Scte35DescriptorSettings
scte35DescriptorSettings) (\s :: Scte35Descriptor
s@Scte35Descriptor' {} Scte35DescriptorSettings
a -> Scte35Descriptor
s {$sel:scte35DescriptorSettings:Scte35Descriptor' :: Scte35DescriptorSettings
scte35DescriptorSettings = Scte35DescriptorSettings
a} :: Scte35Descriptor)

instance Data.FromJSON Scte35Descriptor where
  parseJSON :: Value -> Parser Scte35Descriptor
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Scte35Descriptor"
      ( \Object
x ->
          Scte35DescriptorSettings -> Scte35Descriptor
Scte35Descriptor'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"scte35DescriptorSettings")
      )

instance Prelude.Hashable Scte35Descriptor where
  hashWithSalt :: Int -> Scte35Descriptor -> Int
hashWithSalt Int
_salt Scte35Descriptor' {Scte35DescriptorSettings
scte35DescriptorSettings :: Scte35DescriptorSettings
$sel:scte35DescriptorSettings:Scte35Descriptor' :: Scte35Descriptor -> Scte35DescriptorSettings
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Scte35DescriptorSettings
scte35DescriptorSettings

instance Prelude.NFData Scte35Descriptor where
  rnf :: Scte35Descriptor -> ()
rnf Scte35Descriptor' {Scte35DescriptorSettings
scte35DescriptorSettings :: Scte35DescriptorSettings
$sel:scte35DescriptorSettings:Scte35Descriptor' :: Scte35Descriptor -> Scte35DescriptorSettings
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Scte35DescriptorSettings
scte35DescriptorSettings

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