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

-- |
-- Create a value of 'ResumeClusterMessage' 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', 'resumeClusterMessage_clusterIdentifier' - The identifier of the cluster to be resumed.
newResumeClusterMessage ::
  -- | 'clusterIdentifier'
  Prelude.Text ->
  ResumeClusterMessage
newResumeClusterMessage :: Text -> ResumeClusterMessage
newResumeClusterMessage Text
pClusterIdentifier_ =
  ResumeClusterMessage' :: Text -> ResumeClusterMessage
ResumeClusterMessage'
    { $sel:clusterIdentifier:ResumeClusterMessage' :: Text
clusterIdentifier =
        Text
pClusterIdentifier_
    }

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

instance Core.FromXML ResumeClusterMessage where
  parseXML :: [Node] -> Either String ResumeClusterMessage
parseXML [Node]
x =
    Text -> ResumeClusterMessage
ResumeClusterMessage'
      (Text -> ResumeClusterMessage)
-> Either String Text -> Either String ResumeClusterMessage
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 ResumeClusterMessage

instance Prelude.NFData ResumeClusterMessage

instance Core.ToQuery ResumeClusterMessage where
  toQuery :: ResumeClusterMessage -> QueryString
toQuery ResumeClusterMessage' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:ResumeClusterMessage' :: ResumeClusterMessage -> 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]