{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Redshift.PauseCluster
(
PauseCluster (..),
newPauseCluster,
pauseCluster_clusterIdentifier,
PauseClusterResponse (..),
newPauseClusterResponse,
pauseClusterResponse_cluster,
pauseClusterResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PauseCluster = PauseCluster'
{
PauseCluster -> Text
clusterIdentifier :: Prelude.Text
}
deriving (PauseCluster -> PauseCluster -> Bool
(PauseCluster -> PauseCluster -> Bool)
-> (PauseCluster -> PauseCluster -> Bool) -> Eq PauseCluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PauseCluster -> PauseCluster -> Bool
$c/= :: PauseCluster -> PauseCluster -> Bool
== :: PauseCluster -> PauseCluster -> Bool
$c== :: PauseCluster -> PauseCluster -> Bool
Prelude.Eq, ReadPrec [PauseCluster]
ReadPrec PauseCluster
Int -> ReadS PauseCluster
ReadS [PauseCluster]
(Int -> ReadS PauseCluster)
-> ReadS [PauseCluster]
-> ReadPrec PauseCluster
-> ReadPrec [PauseCluster]
-> Read PauseCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PauseCluster]
$creadListPrec :: ReadPrec [PauseCluster]
readPrec :: ReadPrec PauseCluster
$creadPrec :: ReadPrec PauseCluster
readList :: ReadS [PauseCluster]
$creadList :: ReadS [PauseCluster]
readsPrec :: Int -> ReadS PauseCluster
$creadsPrec :: Int -> ReadS PauseCluster
Prelude.Read, Int -> PauseCluster -> ShowS
[PauseCluster] -> ShowS
PauseCluster -> String
(Int -> PauseCluster -> ShowS)
-> (PauseCluster -> String)
-> ([PauseCluster] -> ShowS)
-> Show PauseCluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PauseCluster] -> ShowS
$cshowList :: [PauseCluster] -> ShowS
show :: PauseCluster -> String
$cshow :: PauseCluster -> String
showsPrec :: Int -> PauseCluster -> ShowS
$cshowsPrec :: Int -> PauseCluster -> ShowS
Prelude.Show, (forall x. PauseCluster -> Rep PauseCluster x)
-> (forall x. Rep PauseCluster x -> PauseCluster)
-> Generic PauseCluster
forall x. Rep PauseCluster x -> PauseCluster
forall x. PauseCluster -> Rep PauseCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PauseCluster x -> PauseCluster
$cfrom :: forall x. PauseCluster -> Rep PauseCluster x
Prelude.Generic)
newPauseCluster ::
Prelude.Text ->
PauseCluster
newPauseCluster :: Text -> PauseCluster
newPauseCluster Text
pClusterIdentifier_ =
PauseCluster' :: Text -> PauseCluster
PauseCluster'
{ $sel:clusterIdentifier:PauseCluster' :: Text
clusterIdentifier =
Text
pClusterIdentifier_
}
pauseCluster_clusterIdentifier :: Lens.Lens' PauseCluster Prelude.Text
pauseCluster_clusterIdentifier :: (Text -> f Text) -> PauseCluster -> f PauseCluster
pauseCluster_clusterIdentifier = (PauseCluster -> Text)
-> (PauseCluster -> Text -> PauseCluster)
-> Lens PauseCluster PauseCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PauseCluster' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:PauseCluster' :: PauseCluster -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: PauseCluster
s@PauseCluster' {} Text
a -> PauseCluster
s {$sel:clusterIdentifier:PauseCluster' :: Text
clusterIdentifier = Text
a} :: PauseCluster)
instance Core.AWSRequest PauseCluster where
type AWSResponse PauseCluster = PauseClusterResponse
request :: PauseCluster -> Request PauseCluster
request = Service -> PauseCluster -> Request PauseCluster
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy PauseCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PauseCluster)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse PauseCluster))
-> Logger
-> Service
-> Proxy PauseCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PauseCluster)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"PauseClusterResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Cluster -> Int -> PauseClusterResponse
PauseClusterResponse'
(Maybe Cluster -> Int -> PauseClusterResponse)
-> Either String (Maybe Cluster)
-> Either String (Int -> PauseClusterResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Cluster)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Cluster")
Either String (Int -> PauseClusterResponse)
-> Either String Int -> Either String PauseClusterResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PauseCluster
instance Prelude.NFData PauseCluster
instance Core.ToHeaders PauseCluster where
toHeaders :: PauseCluster -> ResponseHeaders
toHeaders = ResponseHeaders -> PauseCluster -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath PauseCluster where
toPath :: PauseCluster -> ByteString
toPath = ByteString -> PauseCluster -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PauseCluster where
toQuery :: PauseCluster -> QueryString
toQuery PauseCluster' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:PauseCluster' :: PauseCluster -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"PauseCluster" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"ClusterIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
clusterIdentifier
]
data PauseClusterResponse = PauseClusterResponse'
{ PauseClusterResponse -> Maybe Cluster
cluster :: Prelude.Maybe Cluster,
PauseClusterResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PauseClusterResponse -> PauseClusterResponse -> Bool
(PauseClusterResponse -> PauseClusterResponse -> Bool)
-> (PauseClusterResponse -> PauseClusterResponse -> Bool)
-> Eq PauseClusterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PauseClusterResponse -> PauseClusterResponse -> Bool
$c/= :: PauseClusterResponse -> PauseClusterResponse -> Bool
== :: PauseClusterResponse -> PauseClusterResponse -> Bool
$c== :: PauseClusterResponse -> PauseClusterResponse -> Bool
Prelude.Eq, ReadPrec [PauseClusterResponse]
ReadPrec PauseClusterResponse
Int -> ReadS PauseClusterResponse
ReadS [PauseClusterResponse]
(Int -> ReadS PauseClusterResponse)
-> ReadS [PauseClusterResponse]
-> ReadPrec PauseClusterResponse
-> ReadPrec [PauseClusterResponse]
-> Read PauseClusterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PauseClusterResponse]
$creadListPrec :: ReadPrec [PauseClusterResponse]
readPrec :: ReadPrec PauseClusterResponse
$creadPrec :: ReadPrec PauseClusterResponse
readList :: ReadS [PauseClusterResponse]
$creadList :: ReadS [PauseClusterResponse]
readsPrec :: Int -> ReadS PauseClusterResponse
$creadsPrec :: Int -> ReadS PauseClusterResponse
Prelude.Read, Int -> PauseClusterResponse -> ShowS
[PauseClusterResponse] -> ShowS
PauseClusterResponse -> String
(Int -> PauseClusterResponse -> ShowS)
-> (PauseClusterResponse -> String)
-> ([PauseClusterResponse] -> ShowS)
-> Show PauseClusterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PauseClusterResponse] -> ShowS
$cshowList :: [PauseClusterResponse] -> ShowS
show :: PauseClusterResponse -> String
$cshow :: PauseClusterResponse -> String
showsPrec :: Int -> PauseClusterResponse -> ShowS
$cshowsPrec :: Int -> PauseClusterResponse -> ShowS
Prelude.Show, (forall x. PauseClusterResponse -> Rep PauseClusterResponse x)
-> (forall x. Rep PauseClusterResponse x -> PauseClusterResponse)
-> Generic PauseClusterResponse
forall x. Rep PauseClusterResponse x -> PauseClusterResponse
forall x. PauseClusterResponse -> Rep PauseClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PauseClusterResponse x -> PauseClusterResponse
$cfrom :: forall x. PauseClusterResponse -> Rep PauseClusterResponse x
Prelude.Generic)
newPauseClusterResponse ::
Prelude.Int ->
PauseClusterResponse
newPauseClusterResponse :: Int -> PauseClusterResponse
newPauseClusterResponse Int
pHttpStatus_ =
PauseClusterResponse' :: Maybe Cluster -> Int -> PauseClusterResponse
PauseClusterResponse'
{ $sel:cluster:PauseClusterResponse' :: Maybe Cluster
cluster = Maybe Cluster
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PauseClusterResponse' :: Int
httpStatus = Int
pHttpStatus_
}
pauseClusterResponse_cluster :: Lens.Lens' PauseClusterResponse (Prelude.Maybe Cluster)
pauseClusterResponse_cluster :: (Maybe Cluster -> f (Maybe Cluster))
-> PauseClusterResponse -> f PauseClusterResponse
pauseClusterResponse_cluster = (PauseClusterResponse -> Maybe Cluster)
-> (PauseClusterResponse -> Maybe Cluster -> PauseClusterResponse)
-> Lens
PauseClusterResponse
PauseClusterResponse
(Maybe Cluster)
(Maybe Cluster)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PauseClusterResponse' {Maybe Cluster
cluster :: Maybe Cluster
$sel:cluster:PauseClusterResponse' :: PauseClusterResponse -> Maybe Cluster
cluster} -> Maybe Cluster
cluster) (\s :: PauseClusterResponse
s@PauseClusterResponse' {} Maybe Cluster
a -> PauseClusterResponse
s {$sel:cluster:PauseClusterResponse' :: Maybe Cluster
cluster = Maybe Cluster
a} :: PauseClusterResponse)
pauseClusterResponse_httpStatus :: Lens.Lens' PauseClusterResponse Prelude.Int
pauseClusterResponse_httpStatus :: (Int -> f Int) -> PauseClusterResponse -> f PauseClusterResponse
pauseClusterResponse_httpStatus = (PauseClusterResponse -> Int)
-> (PauseClusterResponse -> Int -> PauseClusterResponse)
-> Lens PauseClusterResponse PauseClusterResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PauseClusterResponse' {Int
httpStatus :: Int
$sel:httpStatus:PauseClusterResponse' :: PauseClusterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PauseClusterResponse
s@PauseClusterResponse' {} Int
a -> PauseClusterResponse
s {$sel:httpStatus:PauseClusterResponse' :: Int
httpStatus = Int
a} :: PauseClusterResponse)
instance Prelude.NFData PauseClusterResponse