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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
    { $sel:pipelineId:PipelinePauseStateSettings' :: PipelineId
pipelineId =
        PipelineId
pPipelineId_
    }

-- | Pipeline ID to pause (\"PIPELINE_0\" or \"PIPELINE_1\").
pipelinePauseStateSettings_pipelineId :: Lens.Lens' PipelinePauseStateSettings PipelineId
pipelinePauseStateSettings_pipelineId :: Lens' PipelinePauseStateSettings PipelineId
pipelinePauseStateSettings_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 Data.FromJSON PipelinePauseStateSettings where
  parseJSON :: Value -> Parser PipelinePauseStateSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PipelinePauseStateSettings"
      ( \Object
x ->
          PipelineId -> PipelinePauseStateSettings
PipelinePauseStateSettings'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"pipelineId")
      )

instance Prelude.Hashable PipelinePauseStateSettings where
  hashWithSalt :: Int -> PipelinePauseStateSettings -> Int
hashWithSalt Int
_salt PipelinePauseStateSettings' {PipelineId
pipelineId :: PipelineId
$sel:pipelineId:PipelinePauseStateSettings' :: PipelinePauseStateSettings -> PipelineId
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PipelineId
pipelineId

instance Prelude.NFData PipelinePauseStateSettings where
  rnf :: PipelinePauseStateSettings -> ()
rnf PipelinePauseStateSettings' {PipelineId
pipelineId :: PipelineId
$sel:pipelineId:PipelinePauseStateSettings' :: PipelinePauseStateSettings -> PipelineId
..} =
    forall a. NFData a => a -> ()
Prelude.rnf PipelineId
pipelineId

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