{-# 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.ResizeCluster
(
ResizeCluster (..),
newResizeCluster,
resizeCluster_numberOfNodes,
resizeCluster_classic,
resizeCluster_clusterType,
resizeCluster_nodeType,
resizeCluster_clusterIdentifier,
ResizeClusterResponse (..),
newResizeClusterResponse,
resizeClusterResponse_cluster,
resizeClusterResponse_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 ResizeCluster = ResizeCluster'
{
ResizeCluster -> Maybe Int
numberOfNodes :: Prelude.Maybe Prelude.Int,
ResizeCluster -> Maybe Bool
classic :: Prelude.Maybe Prelude.Bool,
ResizeCluster -> Maybe Text
clusterType :: Prelude.Maybe Prelude.Text,
ResizeCluster -> Maybe Text
nodeType :: Prelude.Maybe Prelude.Text,
ResizeCluster -> Text
clusterIdentifier :: Prelude.Text
}
deriving (ResizeCluster -> ResizeCluster -> Bool
(ResizeCluster -> ResizeCluster -> Bool)
-> (ResizeCluster -> ResizeCluster -> Bool) -> Eq ResizeCluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResizeCluster -> ResizeCluster -> Bool
$c/= :: ResizeCluster -> ResizeCluster -> Bool
== :: ResizeCluster -> ResizeCluster -> Bool
$c== :: ResizeCluster -> ResizeCluster -> Bool
Prelude.Eq, ReadPrec [ResizeCluster]
ReadPrec ResizeCluster
Int -> ReadS ResizeCluster
ReadS [ResizeCluster]
(Int -> ReadS ResizeCluster)
-> ReadS [ResizeCluster]
-> ReadPrec ResizeCluster
-> ReadPrec [ResizeCluster]
-> Read ResizeCluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResizeCluster]
$creadListPrec :: ReadPrec [ResizeCluster]
readPrec :: ReadPrec ResizeCluster
$creadPrec :: ReadPrec ResizeCluster
readList :: ReadS [ResizeCluster]
$creadList :: ReadS [ResizeCluster]
readsPrec :: Int -> ReadS ResizeCluster
$creadsPrec :: Int -> ReadS ResizeCluster
Prelude.Read, Int -> ResizeCluster -> ShowS
[ResizeCluster] -> ShowS
ResizeCluster -> String
(Int -> ResizeCluster -> ShowS)
-> (ResizeCluster -> String)
-> ([ResizeCluster] -> ShowS)
-> Show ResizeCluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResizeCluster] -> ShowS
$cshowList :: [ResizeCluster] -> ShowS
show :: ResizeCluster -> String
$cshow :: ResizeCluster -> String
showsPrec :: Int -> ResizeCluster -> ShowS
$cshowsPrec :: Int -> ResizeCluster -> ShowS
Prelude.Show, (forall x. ResizeCluster -> Rep ResizeCluster x)
-> (forall x. Rep ResizeCluster x -> ResizeCluster)
-> Generic ResizeCluster
forall x. Rep ResizeCluster x -> ResizeCluster
forall x. ResizeCluster -> Rep ResizeCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResizeCluster x -> ResizeCluster
$cfrom :: forall x. ResizeCluster -> Rep ResizeCluster x
Prelude.Generic)
newResizeCluster ::
Prelude.Text ->
ResizeCluster
newResizeCluster :: Text -> ResizeCluster
newResizeCluster Text
pClusterIdentifier_ =
ResizeCluster' :: Maybe Int
-> Maybe Bool -> Maybe Text -> Maybe Text -> Text -> ResizeCluster
ResizeCluster'
{ $sel:numberOfNodes:ResizeCluster' :: Maybe Int
numberOfNodes = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:classic:ResizeCluster' :: Maybe Bool
classic = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:clusterType:ResizeCluster' :: Maybe Text
clusterType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nodeType:ResizeCluster' :: Maybe Text
nodeType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:clusterIdentifier:ResizeCluster' :: Text
clusterIdentifier = Text
pClusterIdentifier_
}
resizeCluster_numberOfNodes :: Lens.Lens' ResizeCluster (Prelude.Maybe Prelude.Int)
resizeCluster_numberOfNodes :: (Maybe Int -> f (Maybe Int)) -> ResizeCluster -> f ResizeCluster
resizeCluster_numberOfNodes = (ResizeCluster -> Maybe Int)
-> (ResizeCluster -> Maybe Int -> ResizeCluster)
-> Lens ResizeCluster ResizeCluster (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResizeCluster' {Maybe Int
numberOfNodes :: Maybe Int
$sel:numberOfNodes:ResizeCluster' :: ResizeCluster -> Maybe Int
numberOfNodes} -> Maybe Int
numberOfNodes) (\s :: ResizeCluster
s@ResizeCluster' {} Maybe Int
a -> ResizeCluster
s {$sel:numberOfNodes:ResizeCluster' :: Maybe Int
numberOfNodes = Maybe Int
a} :: ResizeCluster)
resizeCluster_classic :: Lens.Lens' ResizeCluster (Prelude.Maybe Prelude.Bool)
resizeCluster_classic :: (Maybe Bool -> f (Maybe Bool)) -> ResizeCluster -> f ResizeCluster
resizeCluster_classic = (ResizeCluster -> Maybe Bool)
-> (ResizeCluster -> Maybe Bool -> ResizeCluster)
-> Lens ResizeCluster ResizeCluster (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResizeCluster' {Maybe Bool
classic :: Maybe Bool
$sel:classic:ResizeCluster' :: ResizeCluster -> Maybe Bool
classic} -> Maybe Bool
classic) (\s :: ResizeCluster
s@ResizeCluster' {} Maybe Bool
a -> ResizeCluster
s {$sel:classic:ResizeCluster' :: Maybe Bool
classic = Maybe Bool
a} :: ResizeCluster)
resizeCluster_clusterType :: Lens.Lens' ResizeCluster (Prelude.Maybe Prelude.Text)
resizeCluster_clusterType :: (Maybe Text -> f (Maybe Text)) -> ResizeCluster -> f ResizeCluster
resizeCluster_clusterType = (ResizeCluster -> Maybe Text)
-> (ResizeCluster -> Maybe Text -> ResizeCluster)
-> Lens ResizeCluster ResizeCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResizeCluster' {Maybe Text
clusterType :: Maybe Text
$sel:clusterType:ResizeCluster' :: ResizeCluster -> Maybe Text
clusterType} -> Maybe Text
clusterType) (\s :: ResizeCluster
s@ResizeCluster' {} Maybe Text
a -> ResizeCluster
s {$sel:clusterType:ResizeCluster' :: Maybe Text
clusterType = Maybe Text
a} :: ResizeCluster)
resizeCluster_nodeType :: Lens.Lens' ResizeCluster (Prelude.Maybe Prelude.Text)
resizeCluster_nodeType :: (Maybe Text -> f (Maybe Text)) -> ResizeCluster -> f ResizeCluster
resizeCluster_nodeType = (ResizeCluster -> Maybe Text)
-> (ResizeCluster -> Maybe Text -> ResizeCluster)
-> Lens ResizeCluster ResizeCluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResizeCluster' {Maybe Text
nodeType :: Maybe Text
$sel:nodeType:ResizeCluster' :: ResizeCluster -> Maybe Text
nodeType} -> Maybe Text
nodeType) (\s :: ResizeCluster
s@ResizeCluster' {} Maybe Text
a -> ResizeCluster
s {$sel:nodeType:ResizeCluster' :: Maybe Text
nodeType = Maybe Text
a} :: ResizeCluster)
resizeCluster_clusterIdentifier :: Lens.Lens' ResizeCluster Prelude.Text
resizeCluster_clusterIdentifier :: (Text -> f Text) -> ResizeCluster -> f ResizeCluster
resizeCluster_clusterIdentifier = (ResizeCluster -> Text)
-> (ResizeCluster -> Text -> ResizeCluster)
-> Lens ResizeCluster ResizeCluster Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResizeCluster' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:ResizeCluster' :: ResizeCluster -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: ResizeCluster
s@ResizeCluster' {} Text
a -> ResizeCluster
s {$sel:clusterIdentifier:ResizeCluster' :: Text
clusterIdentifier = Text
a} :: ResizeCluster)
instance Core.AWSRequest ResizeCluster where
type
AWSResponse ResizeCluster =
ResizeClusterResponse
request :: ResizeCluster -> Request ResizeCluster
request = Service -> ResizeCluster -> Request ResizeCluster
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy ResizeCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ResizeCluster)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ResizeCluster))
-> Logger
-> Service
-> Proxy ResizeCluster
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ResizeCluster)))
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
"ResizeClusterResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Cluster -> Int -> ResizeClusterResponse
ResizeClusterResponse'
(Maybe Cluster -> Int -> ResizeClusterResponse)
-> Either String (Maybe Cluster)
-> Either String (Int -> ResizeClusterResponse)
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 -> ResizeClusterResponse)
-> Either String Int -> Either String ResizeClusterResponse
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 ResizeCluster
instance Prelude.NFData ResizeCluster
instance Core.ToHeaders ResizeCluster where
toHeaders :: ResizeCluster -> ResponseHeaders
toHeaders = ResponseHeaders -> ResizeCluster -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ResizeCluster where
toPath :: ResizeCluster -> ByteString
toPath = ByteString -> ResizeCluster -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ResizeCluster where
toQuery :: ResizeCluster -> QueryString
toQuery ResizeCluster' {Maybe Bool
Maybe Int
Maybe Text
Text
clusterIdentifier :: Text
nodeType :: Maybe Text
clusterType :: Maybe Text
classic :: Maybe Bool
numberOfNodes :: Maybe Int
$sel:clusterIdentifier:ResizeCluster' :: ResizeCluster -> Text
$sel:nodeType:ResizeCluster' :: ResizeCluster -> Maybe Text
$sel:clusterType:ResizeCluster' :: ResizeCluster -> Maybe Text
$sel:classic:ResizeCluster' :: ResizeCluster -> Maybe Bool
$sel:numberOfNodes:ResizeCluster' :: ResizeCluster -> Maybe Int
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ResizeCluster" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"NumberOfNodes" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
numberOfNodes,
ByteString
"Classic" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
classic,
ByteString
"ClusterType" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clusterType,
ByteString
"NodeType" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nodeType,
ByteString
"ClusterIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
clusterIdentifier
]
data ResizeClusterResponse = ResizeClusterResponse'
{ ResizeClusterResponse -> Maybe Cluster
cluster :: Prelude.Maybe Cluster,
ResizeClusterResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ResizeClusterResponse -> ResizeClusterResponse -> Bool
(ResizeClusterResponse -> ResizeClusterResponse -> Bool)
-> (ResizeClusterResponse -> ResizeClusterResponse -> Bool)
-> Eq ResizeClusterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResizeClusterResponse -> ResizeClusterResponse -> Bool
$c/= :: ResizeClusterResponse -> ResizeClusterResponse -> Bool
== :: ResizeClusterResponse -> ResizeClusterResponse -> Bool
$c== :: ResizeClusterResponse -> ResizeClusterResponse -> Bool
Prelude.Eq, ReadPrec [ResizeClusterResponse]
ReadPrec ResizeClusterResponse
Int -> ReadS ResizeClusterResponse
ReadS [ResizeClusterResponse]
(Int -> ReadS ResizeClusterResponse)
-> ReadS [ResizeClusterResponse]
-> ReadPrec ResizeClusterResponse
-> ReadPrec [ResizeClusterResponse]
-> Read ResizeClusterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResizeClusterResponse]
$creadListPrec :: ReadPrec [ResizeClusterResponse]
readPrec :: ReadPrec ResizeClusterResponse
$creadPrec :: ReadPrec ResizeClusterResponse
readList :: ReadS [ResizeClusterResponse]
$creadList :: ReadS [ResizeClusterResponse]
readsPrec :: Int -> ReadS ResizeClusterResponse
$creadsPrec :: Int -> ReadS ResizeClusterResponse
Prelude.Read, Int -> ResizeClusterResponse -> ShowS
[ResizeClusterResponse] -> ShowS
ResizeClusterResponse -> String
(Int -> ResizeClusterResponse -> ShowS)
-> (ResizeClusterResponse -> String)
-> ([ResizeClusterResponse] -> ShowS)
-> Show ResizeClusterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResizeClusterResponse] -> ShowS
$cshowList :: [ResizeClusterResponse] -> ShowS
show :: ResizeClusterResponse -> String
$cshow :: ResizeClusterResponse -> String
showsPrec :: Int -> ResizeClusterResponse -> ShowS
$cshowsPrec :: Int -> ResizeClusterResponse -> ShowS
Prelude.Show, (forall x. ResizeClusterResponse -> Rep ResizeClusterResponse x)
-> (forall x. Rep ResizeClusterResponse x -> ResizeClusterResponse)
-> Generic ResizeClusterResponse
forall x. Rep ResizeClusterResponse x -> ResizeClusterResponse
forall x. ResizeClusterResponse -> Rep ResizeClusterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResizeClusterResponse x -> ResizeClusterResponse
$cfrom :: forall x. ResizeClusterResponse -> Rep ResizeClusterResponse x
Prelude.Generic)
newResizeClusterResponse ::
Prelude.Int ->
ResizeClusterResponse
newResizeClusterResponse :: Int -> ResizeClusterResponse
newResizeClusterResponse Int
pHttpStatus_ =
ResizeClusterResponse' :: Maybe Cluster -> Int -> ResizeClusterResponse
ResizeClusterResponse'
{ $sel:cluster:ResizeClusterResponse' :: Maybe Cluster
cluster = Maybe Cluster
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ResizeClusterResponse' :: Int
httpStatus = Int
pHttpStatus_
}
resizeClusterResponse_cluster :: Lens.Lens' ResizeClusterResponse (Prelude.Maybe Cluster)
resizeClusterResponse_cluster :: (Maybe Cluster -> f (Maybe Cluster))
-> ResizeClusterResponse -> f ResizeClusterResponse
resizeClusterResponse_cluster = (ResizeClusterResponse -> Maybe Cluster)
-> (ResizeClusterResponse
-> Maybe Cluster -> ResizeClusterResponse)
-> Lens
ResizeClusterResponse
ResizeClusterResponse
(Maybe Cluster)
(Maybe Cluster)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResizeClusterResponse' {Maybe Cluster
cluster :: Maybe Cluster
$sel:cluster:ResizeClusterResponse' :: ResizeClusterResponse -> Maybe Cluster
cluster} -> Maybe Cluster
cluster) (\s :: ResizeClusterResponse
s@ResizeClusterResponse' {} Maybe Cluster
a -> ResizeClusterResponse
s {$sel:cluster:ResizeClusterResponse' :: Maybe Cluster
cluster = Maybe Cluster
a} :: ResizeClusterResponse)
resizeClusterResponse_httpStatus :: Lens.Lens' ResizeClusterResponse Prelude.Int
resizeClusterResponse_httpStatus :: (Int -> f Int) -> ResizeClusterResponse -> f ResizeClusterResponse
resizeClusterResponse_httpStatus = (ResizeClusterResponse -> Int)
-> (ResizeClusterResponse -> Int -> ResizeClusterResponse)
-> Lens ResizeClusterResponse ResizeClusterResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResizeClusterResponse' {Int
httpStatus :: Int
$sel:httpStatus:ResizeClusterResponse' :: ResizeClusterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ResizeClusterResponse
s@ResizeClusterResponse' {} Int
a -> ResizeClusterResponse
s {$sel:httpStatus:ResizeClusterResponse' :: Int
httpStatus = Int
a} :: ResizeClusterResponse)
instance Prelude.NFData ResizeClusterResponse