{-# 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.Redshift.Types.PauseClusterMessage
-- 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.Redshift.Types.PauseClusterMessage where

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

-- | Describes a pause cluster operation. For example, a scheduled action to
-- run the @PauseCluster@ API operation.
--
-- /See:/ 'newPauseClusterMessage' smart constructor.
data PauseClusterMessage = PauseClusterMessage'
  { -- | The identifier of the cluster to be paused.
    PauseClusterMessage -> Text
clusterIdentifier :: Prelude.Text
  }
  deriving (PauseClusterMessage -> PauseClusterMessage -> Bool
(PauseClusterMessage -> PauseClusterMessage -> Bool)
-> (PauseClusterMessage -> PauseClusterMessage -> Bool)
-> Eq PauseClusterMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PauseClusterMessage -> PauseClusterMessage -> Bool
$c/= :: PauseClusterMessage -> PauseClusterMessage -> Bool
== :: PauseClusterMessage -> PauseClusterMessage -> Bool
$c== :: PauseClusterMessage -> PauseClusterMessage -> Bool
Prelude.Eq, ReadPrec [PauseClusterMessage]
ReadPrec PauseClusterMessage
Int -> ReadS PauseClusterMessage
ReadS [PauseClusterMessage]
(Int -> ReadS PauseClusterMessage)
-> ReadS [PauseClusterMessage]
-> ReadPrec PauseClusterMessage
-> ReadPrec [PauseClusterMessage]
-> Read PauseClusterMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PauseClusterMessage]
$creadListPrec :: ReadPrec [PauseClusterMessage]
readPrec :: ReadPrec PauseClusterMessage
$creadPrec :: ReadPrec PauseClusterMessage
readList :: ReadS [PauseClusterMessage]
$creadList :: ReadS [PauseClusterMessage]
readsPrec :: Int -> ReadS PauseClusterMessage
$creadsPrec :: Int -> ReadS PauseClusterMessage
Prelude.Read, Int -> PauseClusterMessage -> ShowS
[PauseClusterMessage] -> ShowS
PauseClusterMessage -> String
(Int -> PauseClusterMessage -> ShowS)
-> (PauseClusterMessage -> String)
-> ([PauseClusterMessage] -> ShowS)
-> Show PauseClusterMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PauseClusterMessage] -> ShowS
$cshowList :: [PauseClusterMessage] -> ShowS
show :: PauseClusterMessage -> String
$cshow :: PauseClusterMessage -> String
showsPrec :: Int -> PauseClusterMessage -> ShowS
$cshowsPrec :: Int -> PauseClusterMessage -> ShowS
Prelude.Show, (forall x. PauseClusterMessage -> Rep PauseClusterMessage x)
-> (forall x. Rep PauseClusterMessage x -> PauseClusterMessage)
-> Generic PauseClusterMessage
forall x. Rep PauseClusterMessage x -> PauseClusterMessage
forall x. PauseClusterMessage -> Rep PauseClusterMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PauseClusterMessage x -> PauseClusterMessage
$cfrom :: forall x. PauseClusterMessage -> Rep PauseClusterMessage x
Prelude.Generic)

-- |
-- Create a value of 'PauseClusterMessage' 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:
--
-- 'clusterIdentifier', 'pauseClusterMessage_clusterIdentifier' - The identifier of the cluster to be paused.
newPauseClusterMessage ::
  -- | 'clusterIdentifier'
  Prelude.Text ->
  PauseClusterMessage
newPauseClusterMessage :: Text -> PauseClusterMessage
newPauseClusterMessage Text
pClusterIdentifier_ =
  PauseClusterMessage' :: Text -> PauseClusterMessage
PauseClusterMessage'
    { $sel:clusterIdentifier:PauseClusterMessage' :: Text
clusterIdentifier =
        Text
pClusterIdentifier_
    }

-- | The identifier of the cluster to be paused.
pauseClusterMessage_clusterIdentifier :: Lens.Lens' PauseClusterMessage Prelude.Text
pauseClusterMessage_clusterIdentifier :: (Text -> f Text) -> PauseClusterMessage -> f PauseClusterMessage
pauseClusterMessage_clusterIdentifier = (PauseClusterMessage -> Text)
-> (PauseClusterMessage -> Text -> PauseClusterMessage)
-> Lens PauseClusterMessage PauseClusterMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PauseClusterMessage' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:PauseClusterMessage' :: PauseClusterMessage -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: PauseClusterMessage
s@PauseClusterMessage' {} Text
a -> PauseClusterMessage
s {$sel:clusterIdentifier:PauseClusterMessage' :: Text
clusterIdentifier = Text
a} :: PauseClusterMessage)

instance Core.FromXML PauseClusterMessage where
  parseXML :: [Node] -> Either String PauseClusterMessage
parseXML [Node]
x =
    Text -> PauseClusterMessage
PauseClusterMessage'
      (Text -> PauseClusterMessage)
-> Either String Text -> Either String PauseClusterMessage
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"ClusterIdentifier")

instance Prelude.Hashable PauseClusterMessage

instance Prelude.NFData PauseClusterMessage

instance Core.ToQuery PauseClusterMessage where
  toQuery :: PauseClusterMessage -> QueryString
toQuery PauseClusterMessage' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:PauseClusterMessage' :: PauseClusterMessage -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"ClusterIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
clusterIdentifier]