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

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

-- | Runtime details of a pipeline when a channel is running.
--
-- /See:/ 'newPipelineDetail' smart constructor.
data PipelineDetail = PipelineDetail'
  { -- | Pipeline ID
    PipelineDetail -> Maybe Text
pipelineId :: Prelude.Maybe Prelude.Text,
    -- | The name of the input switch schedule action that occurred most recently
    -- and that resulted in the switch to the current input attachment for this
    -- pipeline.
    PipelineDetail -> Maybe Text
activeInputSwitchActionName :: Prelude.Maybe Prelude.Text,
    -- | The current URI being used for HTML5 motion graphics for this pipeline.
    PipelineDetail -> Maybe Text
activeMotionGraphicsUri :: Prelude.Maybe Prelude.Text,
    -- | The name of the active input attachment currently being ingested by this
    -- pipeline.
    PipelineDetail -> Maybe Text
activeInputAttachmentName :: Prelude.Maybe Prelude.Text,
    -- | The name of the motion graphics activate action that occurred most
    -- recently and that resulted in the current graphics URI for this
    -- pipeline.
    PipelineDetail -> Maybe Text
activeMotionGraphicsActionName :: Prelude.Maybe Prelude.Text
  }
  deriving (PipelineDetail -> PipelineDetail -> Bool
(PipelineDetail -> PipelineDetail -> Bool)
-> (PipelineDetail -> PipelineDetail -> Bool) -> Eq PipelineDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipelineDetail -> PipelineDetail -> Bool
$c/= :: PipelineDetail -> PipelineDetail -> Bool
== :: PipelineDetail -> PipelineDetail -> Bool
$c== :: PipelineDetail -> PipelineDetail -> Bool
Prelude.Eq, ReadPrec [PipelineDetail]
ReadPrec PipelineDetail
Int -> ReadS PipelineDetail
ReadS [PipelineDetail]
(Int -> ReadS PipelineDetail)
-> ReadS [PipelineDetail]
-> ReadPrec PipelineDetail
-> ReadPrec [PipelineDetail]
-> Read PipelineDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PipelineDetail]
$creadListPrec :: ReadPrec [PipelineDetail]
readPrec :: ReadPrec PipelineDetail
$creadPrec :: ReadPrec PipelineDetail
readList :: ReadS [PipelineDetail]
$creadList :: ReadS [PipelineDetail]
readsPrec :: Int -> ReadS PipelineDetail
$creadsPrec :: Int -> ReadS PipelineDetail
Prelude.Read, Int -> PipelineDetail -> ShowS
[PipelineDetail] -> ShowS
PipelineDetail -> String
(Int -> PipelineDetail -> ShowS)
-> (PipelineDetail -> String)
-> ([PipelineDetail] -> ShowS)
-> Show PipelineDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PipelineDetail] -> ShowS
$cshowList :: [PipelineDetail] -> ShowS
show :: PipelineDetail -> String
$cshow :: PipelineDetail -> String
showsPrec :: Int -> PipelineDetail -> ShowS
$cshowsPrec :: Int -> PipelineDetail -> ShowS
Prelude.Show, (forall x. PipelineDetail -> Rep PipelineDetail x)
-> (forall x. Rep PipelineDetail x -> PipelineDetail)
-> Generic PipelineDetail
forall x. Rep PipelineDetail x -> PipelineDetail
forall x. PipelineDetail -> Rep PipelineDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PipelineDetail x -> PipelineDetail
$cfrom :: forall x. PipelineDetail -> Rep PipelineDetail x
Prelude.Generic)

-- |
-- Create a value of 'PipelineDetail' 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', 'pipelineDetail_pipelineId' - Pipeline ID
--
-- 'activeInputSwitchActionName', 'pipelineDetail_activeInputSwitchActionName' - The name of the input switch schedule action that occurred most recently
-- and that resulted in the switch to the current input attachment for this
-- pipeline.
--
-- 'activeMotionGraphicsUri', 'pipelineDetail_activeMotionGraphicsUri' - The current URI being used for HTML5 motion graphics for this pipeline.
--
-- 'activeInputAttachmentName', 'pipelineDetail_activeInputAttachmentName' - The name of the active input attachment currently being ingested by this
-- pipeline.
--
-- 'activeMotionGraphicsActionName', 'pipelineDetail_activeMotionGraphicsActionName' - The name of the motion graphics activate action that occurred most
-- recently and that resulted in the current graphics URI for this
-- pipeline.
newPipelineDetail ::
  PipelineDetail
newPipelineDetail :: PipelineDetail
newPipelineDetail =
  PipelineDetail' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PipelineDetail
PipelineDetail'
    { $sel:pipelineId:PipelineDetail' :: Maybe Text
pipelineId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:activeInputSwitchActionName:PipelineDetail' :: Maybe Text
activeInputSwitchActionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:activeMotionGraphicsUri:PipelineDetail' :: Maybe Text
activeMotionGraphicsUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:activeInputAttachmentName:PipelineDetail' :: Maybe Text
activeInputAttachmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:activeMotionGraphicsActionName:PipelineDetail' :: Maybe Text
activeMotionGraphicsActionName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Pipeline ID
pipelineDetail_pipelineId :: Lens.Lens' PipelineDetail (Prelude.Maybe Prelude.Text)
pipelineDetail_pipelineId :: (Maybe Text -> f (Maybe Text))
-> PipelineDetail -> f PipelineDetail
pipelineDetail_pipelineId = (PipelineDetail -> Maybe Text)
-> (PipelineDetail -> Maybe Text -> PipelineDetail)
-> Lens PipelineDetail PipelineDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineDetail' {Maybe Text
pipelineId :: Maybe Text
$sel:pipelineId:PipelineDetail' :: PipelineDetail -> Maybe Text
pipelineId} -> Maybe Text
pipelineId) (\s :: PipelineDetail
s@PipelineDetail' {} Maybe Text
a -> PipelineDetail
s {$sel:pipelineId:PipelineDetail' :: Maybe Text
pipelineId = Maybe Text
a} :: PipelineDetail)

-- | The name of the input switch schedule action that occurred most recently
-- and that resulted in the switch to the current input attachment for this
-- pipeline.
pipelineDetail_activeInputSwitchActionName :: Lens.Lens' PipelineDetail (Prelude.Maybe Prelude.Text)
pipelineDetail_activeInputSwitchActionName :: (Maybe Text -> f (Maybe Text))
-> PipelineDetail -> f PipelineDetail
pipelineDetail_activeInputSwitchActionName = (PipelineDetail -> Maybe Text)
-> (PipelineDetail -> Maybe Text -> PipelineDetail)
-> Lens PipelineDetail PipelineDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineDetail' {Maybe Text
activeInputSwitchActionName :: Maybe Text
$sel:activeInputSwitchActionName:PipelineDetail' :: PipelineDetail -> Maybe Text
activeInputSwitchActionName} -> Maybe Text
activeInputSwitchActionName) (\s :: PipelineDetail
s@PipelineDetail' {} Maybe Text
a -> PipelineDetail
s {$sel:activeInputSwitchActionName:PipelineDetail' :: Maybe Text
activeInputSwitchActionName = Maybe Text
a} :: PipelineDetail)

-- | The current URI being used for HTML5 motion graphics for this pipeline.
pipelineDetail_activeMotionGraphicsUri :: Lens.Lens' PipelineDetail (Prelude.Maybe Prelude.Text)
pipelineDetail_activeMotionGraphicsUri :: (Maybe Text -> f (Maybe Text))
-> PipelineDetail -> f PipelineDetail
pipelineDetail_activeMotionGraphicsUri = (PipelineDetail -> Maybe Text)
-> (PipelineDetail -> Maybe Text -> PipelineDetail)
-> Lens PipelineDetail PipelineDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineDetail' {Maybe Text
activeMotionGraphicsUri :: Maybe Text
$sel:activeMotionGraphicsUri:PipelineDetail' :: PipelineDetail -> Maybe Text
activeMotionGraphicsUri} -> Maybe Text
activeMotionGraphicsUri) (\s :: PipelineDetail
s@PipelineDetail' {} Maybe Text
a -> PipelineDetail
s {$sel:activeMotionGraphicsUri:PipelineDetail' :: Maybe Text
activeMotionGraphicsUri = Maybe Text
a} :: PipelineDetail)

-- | The name of the active input attachment currently being ingested by this
-- pipeline.
pipelineDetail_activeInputAttachmentName :: Lens.Lens' PipelineDetail (Prelude.Maybe Prelude.Text)
pipelineDetail_activeInputAttachmentName :: (Maybe Text -> f (Maybe Text))
-> PipelineDetail -> f PipelineDetail
pipelineDetail_activeInputAttachmentName = (PipelineDetail -> Maybe Text)
-> (PipelineDetail -> Maybe Text -> PipelineDetail)
-> Lens PipelineDetail PipelineDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineDetail' {Maybe Text
activeInputAttachmentName :: Maybe Text
$sel:activeInputAttachmentName:PipelineDetail' :: PipelineDetail -> Maybe Text
activeInputAttachmentName} -> Maybe Text
activeInputAttachmentName) (\s :: PipelineDetail
s@PipelineDetail' {} Maybe Text
a -> PipelineDetail
s {$sel:activeInputAttachmentName:PipelineDetail' :: Maybe Text
activeInputAttachmentName = Maybe Text
a} :: PipelineDetail)

-- | The name of the motion graphics activate action that occurred most
-- recently and that resulted in the current graphics URI for this
-- pipeline.
pipelineDetail_activeMotionGraphicsActionName :: Lens.Lens' PipelineDetail (Prelude.Maybe Prelude.Text)
pipelineDetail_activeMotionGraphicsActionName :: (Maybe Text -> f (Maybe Text))
-> PipelineDetail -> f PipelineDetail
pipelineDetail_activeMotionGraphicsActionName = (PipelineDetail -> Maybe Text)
-> (PipelineDetail -> Maybe Text -> PipelineDetail)
-> Lens PipelineDetail PipelineDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineDetail' {Maybe Text
activeMotionGraphicsActionName :: Maybe Text
$sel:activeMotionGraphicsActionName:PipelineDetail' :: PipelineDetail -> Maybe Text
activeMotionGraphicsActionName} -> Maybe Text
activeMotionGraphicsActionName) (\s :: PipelineDetail
s@PipelineDetail' {} Maybe Text
a -> PipelineDetail
s {$sel:activeMotionGraphicsActionName:PipelineDetail' :: Maybe Text
activeMotionGraphicsActionName = Maybe Text
a} :: PipelineDetail)

instance Core.FromJSON PipelineDetail where
  parseJSON :: Value -> Parser PipelineDetail
parseJSON =
    String
-> (Object -> Parser PipelineDetail)
-> Value
-> Parser PipelineDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PipelineDetail"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> PipelineDetail
PipelineDetail'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> PipelineDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> PipelineDetail)
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
   -> Maybe Text -> Maybe Text -> Maybe Text -> PipelineDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> PipelineDetail)
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
"activeInputSwitchActionName")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> PipelineDetail)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> PipelineDetail)
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
"activeMotionGraphicsUri")
            Parser (Maybe Text -> Maybe Text -> PipelineDetail)
-> Parser (Maybe Text) -> Parser (Maybe Text -> PipelineDetail)
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
"activeInputAttachmentName")
            Parser (Maybe Text -> PipelineDetail)
-> Parser (Maybe Text) -> Parser PipelineDetail
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
"activeMotionGraphicsActionName")
      )

instance Prelude.Hashable PipelineDetail

instance Prelude.NFData PipelineDetail