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

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

-- |
-- Create a value of 'Scte35DescriptorSettings' 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:
--
-- 'segmentationDescriptorScte35DescriptorSettings', 'scte35DescriptorSettings_segmentationDescriptorScte35DescriptorSettings' - SCTE-35 Segmentation Descriptor.
newScte35DescriptorSettings ::
  -- | 'segmentationDescriptorScte35DescriptorSettings'
  Scte35SegmentationDescriptor ->
  Scte35DescriptorSettings
newScte35DescriptorSettings :: Scte35SegmentationDescriptor -> Scte35DescriptorSettings
newScte35DescriptorSettings
  Scte35SegmentationDescriptor
pSegmentationDescriptorScte35DescriptorSettings_ =
    Scte35DescriptorSettings'
      { $sel:segmentationDescriptorScte35DescriptorSettings:Scte35DescriptorSettings' :: Scte35SegmentationDescriptor
segmentationDescriptorScte35DescriptorSettings =
          Scte35SegmentationDescriptor
pSegmentationDescriptorScte35DescriptorSettings_
      }

-- | SCTE-35 Segmentation Descriptor.
scte35DescriptorSettings_segmentationDescriptorScte35DescriptorSettings :: Lens.Lens' Scte35DescriptorSettings Scte35SegmentationDescriptor
scte35DescriptorSettings_segmentationDescriptorScte35DescriptorSettings :: Lens' Scte35DescriptorSettings Scte35SegmentationDescriptor
scte35DescriptorSettings_segmentationDescriptorScte35DescriptorSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Scte35DescriptorSettings' {Scte35SegmentationDescriptor
segmentationDescriptorScte35DescriptorSettings :: Scte35SegmentationDescriptor
$sel:segmentationDescriptorScte35DescriptorSettings:Scte35DescriptorSettings' :: Scte35DescriptorSettings -> Scte35SegmentationDescriptor
segmentationDescriptorScte35DescriptorSettings} -> Scte35SegmentationDescriptor
segmentationDescriptorScte35DescriptorSettings) (\s :: Scte35DescriptorSettings
s@Scte35DescriptorSettings' {} Scte35SegmentationDescriptor
a -> Scte35DescriptorSettings
s {$sel:segmentationDescriptorScte35DescriptorSettings:Scte35DescriptorSettings' :: Scte35SegmentationDescriptor
segmentationDescriptorScte35DescriptorSettings = Scte35SegmentationDescriptor
a} :: Scte35DescriptorSettings)

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

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

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

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