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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.PipelineId
import qualified Amazonka.Prelude as Prelude

-- | Settings for pausing a pipeline.
--
-- /See:/ 'newPipelinePauseStateSettings' smart constructor.
data PipelinePauseStateSettings = PipelinePauseStateSettings'
  { -- | Pipeline ID to pause (\"PIPELINE_0\" or \"PIPELINE_1\").
    PipelinePauseStateSettings -> PipelineId
pipelineId :: PipelineId
  }
  deriving (PipelinePauseStateSettings -> PipelinePauseStateSettings -> Bool
(PipelinePauseStateSettings -> PipelinePauseStateSettings -> Bool)
-> (PipelinePauseStateSettings
    -> PipelinePauseStateSettings -> Bool)
-> Eq PipelinePauseStateSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipelinePauseStateSettings -> PipelinePauseStateSettings -> Bool
$c/= :: PipelinePauseStateSettings -> PipelinePauseStateSettings -> Bool
== :: PipelinePauseStateSettings -> PipelinePauseStateSettings -> Bool
$c== :: PipelinePauseStateSettings -> PipelinePauseStateSettings -> Bool
Prelude.Eq, ReadPrec [PipelinePauseStateSettings]
ReadPrec PipelinePauseStateSettings
Int -> ReadS PipelinePauseStateSettings
ReadS [PipelinePauseStateSettings]
(Int -> ReadS PipelinePauseStateSettings)
-> ReadS [PipelinePauseStateSettings]
-> ReadPrec PipelinePauseStateSettings
-> ReadPrec [PipelinePauseStateSettings]
-> Read PipelinePauseStateSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PipelinePauseStateSettings]
$creadListPrec :: ReadPrec [PipelinePauseStateSettings]
readPrec :: ReadPrec PipelinePauseStateSettings
$creadPrec :: ReadPrec PipelinePauseStateSettings
readList :: ReadS [PipelinePauseStateSettings]
$creadList :: ReadS [PipelinePauseStateSettings]
readsPrec :: Int -> ReadS PipelinePauseStateSettings
$creadsPrec :: Int -> ReadS PipelinePauseStateSettings
Prelude.Read, Int -> PipelinePauseStateSettings -> ShowS
[PipelinePauseStateSettings] -> ShowS
PipelinePauseStateSettings -> String
(Int -> PipelinePauseStateSettings -> ShowS)
-> (PipelinePauseStateSettings -> String)
-> ([PipelinePauseStateSettings] -> ShowS)
-> Show PipelinePauseStateSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PipelinePauseStateSettings] -> ShowS
$cshowList :: [PipelinePauseStateSettings] -> ShowS
show :: PipelinePauseStateSettings -> String
$cshow :: PipelinePauseStateSettings -> String
showsPrec :: Int -> PipelinePauseStateSettings -> ShowS
$cshowsPrec :: Int -> PipelinePauseStateSettings -> ShowS
Prelude.Show, (forall x.
 PipelinePauseStateSettings -> Rep PipelinePauseStateSettings x)
-> (forall x.
    Rep PipelinePauseStateSettings x -> PipelinePauseStateSettings)
-> Generic PipelinePauseStateSettings
forall x.
Rep PipelinePauseStateSettings x -> PipelinePauseStateSettings
forall x.
PipelinePauseStateSettings -> Rep PipelinePauseStateSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PipelinePauseStateSettings x -> PipelinePauseStateSettings
$cfrom :: forall x.
PipelinePauseStateSettings -> Rep PipelinePauseStateSettings x
Prelude.Generic)

-- |
-- Create a value of 'PipelinePauseStateSettings' 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', 'pipelinePauseStateSettings_pipelineId' - Pipeline ID to pause (\"PIPELINE_0\" or \"PIPELINE_1\").
newPipelinePauseStateSettings ::
  -- | 'pipelineId'
  PipelineId ->
  PipelinePauseStateSettings
newPipelinePauseStateSettings :: PipelineId -> PipelinePauseStateSettings
newPipelinePauseStateSettings PipelineId
pPipelineId_ =
  PipelinePauseStateSettings' :: PipelineId -> PipelinePauseStateSettings
PipelinePauseStateSettings'
    { $sel:pipelineId:PipelinePauseStateSettings' :: PipelineId
pipelineId =
        PipelineId
pPipelineId_
    }

-- | Pipeline ID to pause (\"PIPELINE_0\" or \"PIPELINE_1\").
pipelinePauseStateSettings_pipelineId :: Lens.Lens' PipelinePauseStateSettings PipelineId
pipelinePauseStateSettings_pipelineId :: (PipelineId -> f PipelineId)
-> PipelinePauseStateSettings -> f PipelinePauseStateSettings
pipelinePauseStateSettings_pipelineId = (PipelinePauseStateSettings -> PipelineId)
-> (PipelinePauseStateSettings
    -> PipelineId -> PipelinePauseStateSettings)
-> Lens
     PipelinePauseStateSettings
     PipelinePauseStateSettings
     PipelineId
     PipelineId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelinePauseStateSettings' {PipelineId
pipelineId :: PipelineId
$sel:pipelineId:PipelinePauseStateSettings' :: PipelinePauseStateSettings -> PipelineId
pipelineId} -> PipelineId
pipelineId) (\s :: PipelinePauseStateSettings
s@PipelinePauseStateSettings' {} PipelineId
a -> PipelinePauseStateSettings
s {$sel:pipelineId:PipelinePauseStateSettings' :: PipelineId
pipelineId = PipelineId
a} :: PipelinePauseStateSettings)

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

instance Prelude.Hashable PipelinePauseStateSettings

instance Prelude.NFData PipelinePauseStateSettings

instance Core.ToJSON PipelinePauseStateSettings where
  toJSON :: PipelinePauseStateSettings -> Value
toJSON PipelinePauseStateSettings' {PipelineId
pipelineId :: PipelineId
$sel:pipelineId:PipelinePauseStateSettings' :: PipelinePauseStateSettings -> PipelineId
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"pipelineId" Text -> PipelineId -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= PipelineId
pipelineId)]
      )