{-# 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.MultiplexProgramSummary
-- 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.MultiplexProgramSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Placeholder documentation for MultiplexProgramSummary
--
-- /See:/ 'newMultiplexProgramSummary' smart constructor.
data MultiplexProgramSummary = MultiplexProgramSummary'
  { -- | The MediaLive Channel associated with the program.
    MultiplexProgramSummary -> Maybe Text
channelId :: Prelude.Maybe Prelude.Text,
    -- | The name of the multiplex program.
    MultiplexProgramSummary -> Maybe Text
programName :: Prelude.Maybe Prelude.Text
  }
  deriving (MultiplexProgramSummary -> MultiplexProgramSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MultiplexProgramSummary -> MultiplexProgramSummary -> Bool
$c/= :: MultiplexProgramSummary -> MultiplexProgramSummary -> Bool
== :: MultiplexProgramSummary -> MultiplexProgramSummary -> Bool
$c== :: MultiplexProgramSummary -> MultiplexProgramSummary -> Bool
Prelude.Eq, ReadPrec [MultiplexProgramSummary]
ReadPrec MultiplexProgramSummary
Int -> ReadS MultiplexProgramSummary
ReadS [MultiplexProgramSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MultiplexProgramSummary]
$creadListPrec :: ReadPrec [MultiplexProgramSummary]
readPrec :: ReadPrec MultiplexProgramSummary
$creadPrec :: ReadPrec MultiplexProgramSummary
readList :: ReadS [MultiplexProgramSummary]
$creadList :: ReadS [MultiplexProgramSummary]
readsPrec :: Int -> ReadS MultiplexProgramSummary
$creadsPrec :: Int -> ReadS MultiplexProgramSummary
Prelude.Read, Int -> MultiplexProgramSummary -> ShowS
[MultiplexProgramSummary] -> ShowS
MultiplexProgramSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MultiplexProgramSummary] -> ShowS
$cshowList :: [MultiplexProgramSummary] -> ShowS
show :: MultiplexProgramSummary -> String
$cshow :: MultiplexProgramSummary -> String
showsPrec :: Int -> MultiplexProgramSummary -> ShowS
$cshowsPrec :: Int -> MultiplexProgramSummary -> ShowS
Prelude.Show, forall x. Rep MultiplexProgramSummary x -> MultiplexProgramSummary
forall x. MultiplexProgramSummary -> Rep MultiplexProgramSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MultiplexProgramSummary x -> MultiplexProgramSummary
$cfrom :: forall x. MultiplexProgramSummary -> Rep MultiplexProgramSummary x
Prelude.Generic)

-- |
-- Create a value of 'MultiplexProgramSummary' 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:
--
-- 'channelId', 'multiplexProgramSummary_channelId' - The MediaLive Channel associated with the program.
--
-- 'programName', 'multiplexProgramSummary_programName' - The name of the multiplex program.
newMultiplexProgramSummary ::
  MultiplexProgramSummary
newMultiplexProgramSummary :: MultiplexProgramSummary
newMultiplexProgramSummary =
  MultiplexProgramSummary'
    { $sel:channelId:MultiplexProgramSummary' :: Maybe Text
channelId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:programName:MultiplexProgramSummary' :: Maybe Text
programName = forall a. Maybe a
Prelude.Nothing
    }

-- | The MediaLive Channel associated with the program.
multiplexProgramSummary_channelId :: Lens.Lens' MultiplexProgramSummary (Prelude.Maybe Prelude.Text)
multiplexProgramSummary_channelId :: Lens' MultiplexProgramSummary (Maybe Text)
multiplexProgramSummary_channelId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexProgramSummary' {Maybe Text
channelId :: Maybe Text
$sel:channelId:MultiplexProgramSummary' :: MultiplexProgramSummary -> Maybe Text
channelId} -> Maybe Text
channelId) (\s :: MultiplexProgramSummary
s@MultiplexProgramSummary' {} Maybe Text
a -> MultiplexProgramSummary
s {$sel:channelId:MultiplexProgramSummary' :: Maybe Text
channelId = Maybe Text
a} :: MultiplexProgramSummary)

-- | The name of the multiplex program.
multiplexProgramSummary_programName :: Lens.Lens' MultiplexProgramSummary (Prelude.Maybe Prelude.Text)
multiplexProgramSummary_programName :: Lens' MultiplexProgramSummary (Maybe Text)
multiplexProgramSummary_programName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexProgramSummary' {Maybe Text
programName :: Maybe Text
$sel:programName:MultiplexProgramSummary' :: MultiplexProgramSummary -> Maybe Text
programName} -> Maybe Text
programName) (\s :: MultiplexProgramSummary
s@MultiplexProgramSummary' {} Maybe Text
a -> MultiplexProgramSummary
s {$sel:programName:MultiplexProgramSummary' :: Maybe Text
programName = Maybe Text
a} :: MultiplexProgramSummary)

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

instance Prelude.Hashable MultiplexProgramSummary where
  hashWithSalt :: Int -> MultiplexProgramSummary -> Int
hashWithSalt Int
_salt MultiplexProgramSummary' {Maybe Text
programName :: Maybe Text
channelId :: Maybe Text
$sel:programName:MultiplexProgramSummary' :: MultiplexProgramSummary -> Maybe Text
$sel:channelId:MultiplexProgramSummary' :: MultiplexProgramSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
channelId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
programName

instance Prelude.NFData MultiplexProgramSummary where
  rnf :: MultiplexProgramSummary -> ()
rnf MultiplexProgramSummary' {Maybe Text
programName :: Maybe Text
channelId :: Maybe Text
$sel:programName:MultiplexProgramSummary' :: MultiplexProgramSummary -> Maybe Text
$sel:channelId:MultiplexProgramSummary' :: MultiplexProgramSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
channelId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
programName