{-# 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.ResumeCluster
(
ResumeCluster (..),
newResumeCluster,
resumeCluster_clusterIdentifier,
ResumeClusterResponse (..),
newResumeClusterResponse,
resumeClusterResponse_cluster,
resumeClusterResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ResumeCluster = ResumeCluster'
{
ResumeCluster -> Text
clusterIdentifier :: Prelude.Text
}
deriving (ResumeCluster -> ResumeCluster -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResumeCluster -> ResumeCluster -> Bool
$c/= :: ResumeCluster -> ResumeCluster -> Bool
== :: ResumeCluster -> ResumeCluster -> Bool
$c== :: ResumeCluster -> ResumeCluster -> Bool
Prelude.Eq, ReadPrec [ResumeCluster]
ReadPrec ResumeCluster
Int -> ReadS ResumeCluster
ReadS [ResumeCluster]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResumeCluster]
$creadListPrec :: ReadPrec [ResumeCluster]
readPrec :: ReadPrec ResumeCluster
$creadPrec :: ReadPrec ResumeCluster
readList :: ReadS [ResumeCluster]
$creadList :: ReadS [ResumeCluster]
readsPrec :: Int -> ReadS ResumeCluster
$creadsPrec :: Int -> ReadS ResumeCluster
Prelude.Read, Int -> ResumeCluster -> ShowS
[ResumeCluster] -> ShowS
ResumeCluster -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResumeCluster] -> ShowS
$cshowList :: [ResumeCluster] -> ShowS
show :: ResumeCluster -> String
$cshow :: ResumeCluster -> String
showsPrec :: Int -> ResumeCluster -> ShowS
$cshowsPrec :: Int -> ResumeCluster -> ShowS
Prelude.Show, forall x. Rep ResumeCluster x -> ResumeCluster
forall x. ResumeCluster -> Rep ResumeCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResumeCluster x -> ResumeCluster
$cfrom :: forall x. ResumeCluster -> Rep ResumeCluster x
Prelude.Generic)
newResumeCluster ::
Prelude.Text ->
ResumeCluster
newResumeCluster :: Text -> ResumeCluster
newResumeCluster Text
pClusterIdentifier_ =
ResumeCluster'
{ $sel:clusterIdentifier:ResumeCluster' :: Text
clusterIdentifier =
Text
pClusterIdentifier_
}
resumeCluster_clusterIdentifier :: Lens.Lens' ResumeCluster Prelude.Text
resumeCluster_clusterIdentifier :: Lens' ResumeCluster Text
resumeCluster_clusterIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeCluster' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:ResumeCluster' :: ResumeCluster -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: ResumeCluster
s@ResumeCluster' {} Text
a -> ResumeCluster
s {$sel:clusterIdentifier:ResumeCluster' :: Text
clusterIdentifier = Text
a} :: ResumeCluster)
instance Core.AWSRequest ResumeCluster where
type
AWSResponse ResumeCluster =
ResumeClusterResponse
request :: (Service -> Service) -> ResumeCluster -> Request ResumeCluster
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ResumeCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ResumeCluster)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ResumeClusterResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Cluster -> Int -> ResumeClusterResponse
ResumeClusterResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Cluster")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ResumeCluster where
hashWithSalt :: Int -> ResumeCluster -> Int
hashWithSalt Int
_salt ResumeCluster' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:ResumeCluster' :: ResumeCluster -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clusterIdentifier
instance Prelude.NFData ResumeCluster where
rnf :: ResumeCluster -> ()
rnf ResumeCluster' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:ResumeCluster' :: ResumeCluster -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
clusterIdentifier
instance Data.ToHeaders ResumeCluster where
toHeaders :: ResumeCluster -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ResumeCluster where
toPath :: ResumeCluster -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ResumeCluster where
toQuery :: ResumeCluster -> QueryString
toQuery ResumeCluster' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:ResumeCluster' :: ResumeCluster -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ResumeCluster" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"ClusterIdentifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
clusterIdentifier
]
data ResumeClusterResponse = ResumeClusterResponse'
{ ResumeClusterResponse -> Maybe Cluster
cluster :: Prelude.Maybe Cluster,
ResumeClusterResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ResumeClusterResponse -> ResumeClusterResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResumeClusterResponse -> ResumeClusterResponse -> Bool
$c/= :: ResumeClusterResponse -> ResumeClusterResponse -> Bool
== :: ResumeClusterResponse -> ResumeClusterResponse -> Bool
$c== :: ResumeClusterResponse -> ResumeClusterResponse -> Bool
Prelude.Eq, ReadPrec [ResumeClusterResponse]
ReadPrec ResumeClusterResponse
Int -> ReadS ResumeClusterResponse
ReadS [ResumeClusterResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResumeClusterResponse]
$creadListPrec :: ReadPrec [ResumeClusterResponse]
readPrec :: ReadPrec ResumeClusterResponse
$creadPrec :: ReadPrec ResumeClusterResponse
readList :: ReadS [ResumeClusterResponse]
$creadList :: ReadS [ResumeClusterResponse]
readsPrec :: Int -> ReadS ResumeClusterResponse
$creadsPrec :: Int -> ReadS ResumeClusterResponse
Prelude.Read, Int -> ResumeClusterResponse -> ShowS
[ResumeClusterResponse] -> ShowS
ResumeClusterResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResumeClusterResponse] -> ShowS
$cshowList :: [ResumeClusterResponse] -> ShowS
show :: ResumeClusterResponse -> String
$cshow :: ResumeClusterResponse -> String
showsPrec :: Int -> ResumeClusterResponse -> ShowS
$cshowsPrec :: Int -> ResumeClusterResponse -> ShowS
Prelude.Show, forall x. Rep ResumeClusterResponse x -> ResumeClusterResponse
forall x. ResumeClusterResponse -> Rep ResumeClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResumeClusterResponse x -> ResumeClusterResponse
$cfrom :: forall x. ResumeClusterResponse -> Rep ResumeClusterResponse x
Prelude.Generic)
newResumeClusterResponse ::
Prelude.Int ->
ResumeClusterResponse
newResumeClusterResponse :: Int -> ResumeClusterResponse
newResumeClusterResponse Int
pHttpStatus_ =
ResumeClusterResponse'
{ $sel:cluster:ResumeClusterResponse' :: Maybe Cluster
cluster = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ResumeClusterResponse' :: Int
httpStatus = Int
pHttpStatus_
}
resumeClusterResponse_cluster :: Lens.Lens' ResumeClusterResponse (Prelude.Maybe Cluster)
resumeClusterResponse_cluster :: Lens' ResumeClusterResponse (Maybe Cluster)
resumeClusterResponse_cluster = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeClusterResponse' {Maybe Cluster
cluster :: Maybe Cluster
$sel:cluster:ResumeClusterResponse' :: ResumeClusterResponse -> Maybe Cluster
cluster} -> Maybe Cluster
cluster) (\s :: ResumeClusterResponse
s@ResumeClusterResponse' {} Maybe Cluster
a -> ResumeClusterResponse
s {$sel:cluster:ResumeClusterResponse' :: Maybe Cluster
cluster = Maybe Cluster
a} :: ResumeClusterResponse)
resumeClusterResponse_httpStatus :: Lens.Lens' ResumeClusterResponse Prelude.Int
resumeClusterResponse_httpStatus :: Lens' ResumeClusterResponse Int
resumeClusterResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeClusterResponse' {Int
httpStatus :: Int
$sel:httpStatus:ResumeClusterResponse' :: ResumeClusterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ResumeClusterResponse
s@ResumeClusterResponse' {} Int
a -> ResumeClusterResponse
s {$sel:httpStatus:ResumeClusterResponse' :: Int
httpStatus = Int
a} :: ResumeClusterResponse)
instance Prelude.NFData ResumeClusterResponse where
rnf :: ResumeClusterResponse -> ()
rnf ResumeClusterResponse' {Int
Maybe Cluster
httpStatus :: Int
cluster :: Maybe Cluster
$sel:httpStatus:ResumeClusterResponse' :: ResumeClusterResponse -> Int
$sel:cluster:ResumeClusterResponse' :: ResumeClusterResponse -> Maybe Cluster
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Cluster
cluster
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus