{-# 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.MultiplexProgramPipelineDetail
-- 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.MultiplexProgramPipelineDetail 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

-- | The current source for one of the pipelines in the multiplex.
--
-- /See:/ 'newMultiplexProgramPipelineDetail' smart constructor.
data MultiplexProgramPipelineDetail = MultiplexProgramPipelineDetail'
  { -- | Identifies the channel pipeline that is currently active for the
    -- pipeline (identified by PipelineId) in the multiplex.
    MultiplexProgramPipelineDetail -> Maybe Text
activeChannelPipeline :: Prelude.Maybe Prelude.Text,
    -- | Identifies a specific pipeline in the multiplex.
    MultiplexProgramPipelineDetail -> Maybe Text
pipelineId :: Prelude.Maybe Prelude.Text
  }
  deriving (MultiplexProgramPipelineDetail
-> MultiplexProgramPipelineDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MultiplexProgramPipelineDetail
-> MultiplexProgramPipelineDetail -> Bool
$c/= :: MultiplexProgramPipelineDetail
-> MultiplexProgramPipelineDetail -> Bool
== :: MultiplexProgramPipelineDetail
-> MultiplexProgramPipelineDetail -> Bool
$c== :: MultiplexProgramPipelineDetail
-> MultiplexProgramPipelineDetail -> Bool
Prelude.Eq, ReadPrec [MultiplexProgramPipelineDetail]
ReadPrec MultiplexProgramPipelineDetail
Int -> ReadS MultiplexProgramPipelineDetail
ReadS [MultiplexProgramPipelineDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MultiplexProgramPipelineDetail]
$creadListPrec :: ReadPrec [MultiplexProgramPipelineDetail]
readPrec :: ReadPrec MultiplexProgramPipelineDetail
$creadPrec :: ReadPrec MultiplexProgramPipelineDetail
readList :: ReadS [MultiplexProgramPipelineDetail]
$creadList :: ReadS [MultiplexProgramPipelineDetail]
readsPrec :: Int -> ReadS MultiplexProgramPipelineDetail
$creadsPrec :: Int -> ReadS MultiplexProgramPipelineDetail
Prelude.Read, Int -> MultiplexProgramPipelineDetail -> ShowS
[MultiplexProgramPipelineDetail] -> ShowS
MultiplexProgramPipelineDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MultiplexProgramPipelineDetail] -> ShowS
$cshowList :: [MultiplexProgramPipelineDetail] -> ShowS
show :: MultiplexProgramPipelineDetail -> String
$cshow :: MultiplexProgramPipelineDetail -> String
showsPrec :: Int -> MultiplexProgramPipelineDetail -> ShowS
$cshowsPrec :: Int -> MultiplexProgramPipelineDetail -> ShowS
Prelude.Show, forall x.
Rep MultiplexProgramPipelineDetail x
-> MultiplexProgramPipelineDetail
forall x.
MultiplexProgramPipelineDetail
-> Rep MultiplexProgramPipelineDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MultiplexProgramPipelineDetail x
-> MultiplexProgramPipelineDetail
$cfrom :: forall x.
MultiplexProgramPipelineDetail
-> Rep MultiplexProgramPipelineDetail x
Prelude.Generic)

-- |
-- Create a value of 'MultiplexProgramPipelineDetail' 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:
--
-- 'activeChannelPipeline', 'multiplexProgramPipelineDetail_activeChannelPipeline' - Identifies the channel pipeline that is currently active for the
-- pipeline (identified by PipelineId) in the multiplex.
--
-- 'pipelineId', 'multiplexProgramPipelineDetail_pipelineId' - Identifies a specific pipeline in the multiplex.
newMultiplexProgramPipelineDetail ::
  MultiplexProgramPipelineDetail
newMultiplexProgramPipelineDetail :: MultiplexProgramPipelineDetail
newMultiplexProgramPipelineDetail =
  MultiplexProgramPipelineDetail'
    { $sel:activeChannelPipeline:MultiplexProgramPipelineDetail' :: Maybe Text
activeChannelPipeline =
        forall a. Maybe a
Prelude.Nothing,
      $sel:pipelineId:MultiplexProgramPipelineDetail' :: Maybe Text
pipelineId = forall a. Maybe a
Prelude.Nothing
    }

-- | Identifies the channel pipeline that is currently active for the
-- pipeline (identified by PipelineId) in the multiplex.
multiplexProgramPipelineDetail_activeChannelPipeline :: Lens.Lens' MultiplexProgramPipelineDetail (Prelude.Maybe Prelude.Text)
multiplexProgramPipelineDetail_activeChannelPipeline :: Lens' MultiplexProgramPipelineDetail (Maybe Text)
multiplexProgramPipelineDetail_activeChannelPipeline = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexProgramPipelineDetail' {Maybe Text
activeChannelPipeline :: Maybe Text
$sel:activeChannelPipeline:MultiplexProgramPipelineDetail' :: MultiplexProgramPipelineDetail -> Maybe Text
activeChannelPipeline} -> Maybe Text
activeChannelPipeline) (\s :: MultiplexProgramPipelineDetail
s@MultiplexProgramPipelineDetail' {} Maybe Text
a -> MultiplexProgramPipelineDetail
s {$sel:activeChannelPipeline:MultiplexProgramPipelineDetail' :: Maybe Text
activeChannelPipeline = Maybe Text
a} :: MultiplexProgramPipelineDetail)

-- | Identifies a specific pipeline in the multiplex.
multiplexProgramPipelineDetail_pipelineId :: Lens.Lens' MultiplexProgramPipelineDetail (Prelude.Maybe Prelude.Text)
multiplexProgramPipelineDetail_pipelineId :: Lens' MultiplexProgramPipelineDetail (Maybe Text)
multiplexProgramPipelineDetail_pipelineId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexProgramPipelineDetail' {Maybe Text
pipelineId :: Maybe Text
$sel:pipelineId:MultiplexProgramPipelineDetail' :: MultiplexProgramPipelineDetail -> Maybe Text
pipelineId} -> Maybe Text
pipelineId) (\s :: MultiplexProgramPipelineDetail
s@MultiplexProgramPipelineDetail' {} Maybe Text
a -> MultiplexProgramPipelineDetail
s {$sel:pipelineId:MultiplexProgramPipelineDetail' :: Maybe Text
pipelineId = Maybe Text
a} :: MultiplexProgramPipelineDetail)

instance Data.FromJSON MultiplexProgramPipelineDetail where
  parseJSON :: Value -> Parser MultiplexProgramPipelineDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MultiplexProgramPipelineDetail"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> MultiplexProgramPipelineDetail
MultiplexProgramPipelineDetail'
            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
"activeChannelPipeline")
            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
"pipelineId")
      )

instance
  Prelude.Hashable
    MultiplexProgramPipelineDetail
  where
  hashWithSalt :: Int -> MultiplexProgramPipelineDetail -> Int
hashWithSalt
    Int
_salt
    MultiplexProgramPipelineDetail' {Maybe Text
pipelineId :: Maybe Text
activeChannelPipeline :: Maybe Text
$sel:pipelineId:MultiplexProgramPipelineDetail' :: MultiplexProgramPipelineDetail -> Maybe Text
$sel:activeChannelPipeline:MultiplexProgramPipelineDetail' :: MultiplexProgramPipelineDetail -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
activeChannelPipeline
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pipelineId

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