{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaLive.Types.MultiplexProgramPipelineDetail where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 a specific pipeline in the multiplex.
    MultiplexProgramPipelineDetail -> Maybe Text
pipelineId :: Prelude.Maybe Prelude.Text,
    -- | 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
  }
  deriving (MultiplexProgramPipelineDetail
-> MultiplexProgramPipelineDetail -> Bool
(MultiplexProgramPipelineDetail
 -> MultiplexProgramPipelineDetail -> Bool)
-> (MultiplexProgramPipelineDetail
    -> MultiplexProgramPipelineDetail -> Bool)
-> Eq MultiplexProgramPipelineDetail
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]
(Int -> ReadS MultiplexProgramPipelineDetail)
-> ReadS [MultiplexProgramPipelineDetail]
-> ReadPrec MultiplexProgramPipelineDetail
-> ReadPrec [MultiplexProgramPipelineDetail]
-> Read 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
(Int -> MultiplexProgramPipelineDetail -> ShowS)
-> (MultiplexProgramPipelineDetail -> String)
-> ([MultiplexProgramPipelineDetail] -> ShowS)
-> Show MultiplexProgramPipelineDetail
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.
 MultiplexProgramPipelineDetail
 -> Rep MultiplexProgramPipelineDetail x)
-> (forall x.
    Rep MultiplexProgramPipelineDetail x
    -> MultiplexProgramPipelineDetail)
-> Generic MultiplexProgramPipelineDetail
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:
--
-- 'pipelineId', 'multiplexProgramPipelineDetail_pipelineId' - Identifies a specific pipeline in the multiplex.
--
-- 'activeChannelPipeline', 'multiplexProgramPipelineDetail_activeChannelPipeline' - Identifies the channel pipeline that is currently active for the
-- pipeline (identified by PipelineId) in the multiplex.
newMultiplexProgramPipelineDetail ::
  MultiplexProgramPipelineDetail
newMultiplexProgramPipelineDetail :: MultiplexProgramPipelineDetail
newMultiplexProgramPipelineDetail =
  MultiplexProgramPipelineDetail' :: Maybe Text -> Maybe Text -> MultiplexProgramPipelineDetail
MultiplexProgramPipelineDetail'
    { $sel:pipelineId:MultiplexProgramPipelineDetail' :: Maybe Text
pipelineId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:activeChannelPipeline:MultiplexProgramPipelineDetail' :: Maybe Text
activeChannelPipeline = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Identifies a specific pipeline in the multiplex.
multiplexProgramPipelineDetail_pipelineId :: Lens.Lens' MultiplexProgramPipelineDetail (Prelude.Maybe Prelude.Text)
multiplexProgramPipelineDetail_pipelineId :: (Maybe Text -> f (Maybe Text))
-> MultiplexProgramPipelineDetail
-> f MultiplexProgramPipelineDetail
multiplexProgramPipelineDetail_pipelineId = (MultiplexProgramPipelineDetail -> Maybe Text)
-> (MultiplexProgramPipelineDetail
    -> Maybe Text -> MultiplexProgramPipelineDetail)
-> Lens
     MultiplexProgramPipelineDetail
     MultiplexProgramPipelineDetail
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> MultiplexProgramPipelineDetail
-> f MultiplexProgramPipelineDetail
multiplexProgramPipelineDetail_activeChannelPipeline = (MultiplexProgramPipelineDetail -> Maybe Text)
-> (MultiplexProgramPipelineDetail
    -> Maybe Text -> MultiplexProgramPipelineDetail)
-> Lens
     MultiplexProgramPipelineDetail
     MultiplexProgramPipelineDetail
     (Maybe Text)
     (Maybe Text)
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)

instance Core.FromJSON MultiplexProgramPipelineDetail where
  parseJSON :: Value -> Parser MultiplexProgramPipelineDetail
parseJSON =
    String
-> (Object -> Parser MultiplexProgramPipelineDetail)
-> Value
-> Parser MultiplexProgramPipelineDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MultiplexProgramPipelineDetail"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> MultiplexProgramPipelineDetail
MultiplexProgramPipelineDetail'
            (Maybe Text -> Maybe Text -> MultiplexProgramPipelineDetail)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> MultiplexProgramPipelineDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pipelineId")
            Parser (Maybe Text -> MultiplexProgramPipelineDetail)
-> Parser (Maybe Text) -> Parser MultiplexProgramPipelineDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"activeChannelPipeline")
      )

instance
  Prelude.Hashable
    MultiplexProgramPipelineDetail

instance
  Prelude.NFData
    MultiplexProgramPipelineDetail