{-# 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.DescribeResize
(
DescribeResize (..),
newDescribeResize,
describeResize_clusterIdentifier,
ResizeProgressMessage (..),
newResizeProgressMessage,
resizeProgressMessage_importTablesNotStarted,
resizeProgressMessage_status,
resizeProgressMessage_estimatedTimeToCompletionInSeconds,
resizeProgressMessage_avgResizeRateInMegaBytesPerSecond,
resizeProgressMessage_targetNumberOfNodes,
resizeProgressMessage_targetEncryptionType,
resizeProgressMessage_targetNodeType,
resizeProgressMessage_importTablesInProgress,
resizeProgressMessage_resizeType,
resizeProgressMessage_importTablesCompleted,
resizeProgressMessage_progressInMegaBytes,
resizeProgressMessage_dataTransferProgressPercent,
resizeProgressMessage_totalResizeDataInMegaBytes,
resizeProgressMessage_targetClusterType,
resizeProgressMessage_message,
resizeProgressMessage_elapsedTimeInSeconds,
)
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 DescribeResize = DescribeResize'
{
DescribeResize -> Text
clusterIdentifier :: Prelude.Text
}
deriving (DescribeResize -> DescribeResize -> Bool
(DescribeResize -> DescribeResize -> Bool)
-> (DescribeResize -> DescribeResize -> Bool) -> Eq DescribeResize
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeResize -> DescribeResize -> Bool
$c/= :: DescribeResize -> DescribeResize -> Bool
== :: DescribeResize -> DescribeResize -> Bool
$c== :: DescribeResize -> DescribeResize -> Bool
Prelude.Eq, ReadPrec [DescribeResize]
ReadPrec DescribeResize
Int -> ReadS DescribeResize
ReadS [DescribeResize]
(Int -> ReadS DescribeResize)
-> ReadS [DescribeResize]
-> ReadPrec DescribeResize
-> ReadPrec [DescribeResize]
-> Read DescribeResize
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeResize]
$creadListPrec :: ReadPrec [DescribeResize]
readPrec :: ReadPrec DescribeResize
$creadPrec :: ReadPrec DescribeResize
readList :: ReadS [DescribeResize]
$creadList :: ReadS [DescribeResize]
readsPrec :: Int -> ReadS DescribeResize
$creadsPrec :: Int -> ReadS DescribeResize
Prelude.Read, Int -> DescribeResize -> ShowS
[DescribeResize] -> ShowS
DescribeResize -> String
(Int -> DescribeResize -> ShowS)
-> (DescribeResize -> String)
-> ([DescribeResize] -> ShowS)
-> Show DescribeResize
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeResize] -> ShowS
$cshowList :: [DescribeResize] -> ShowS
show :: DescribeResize -> String
$cshow :: DescribeResize -> String
showsPrec :: Int -> DescribeResize -> ShowS
$cshowsPrec :: Int -> DescribeResize -> ShowS
Prelude.Show, (forall x. DescribeResize -> Rep DescribeResize x)
-> (forall x. Rep DescribeResize x -> DescribeResize)
-> Generic DescribeResize
forall x. Rep DescribeResize x -> DescribeResize
forall x. DescribeResize -> Rep DescribeResize x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeResize x -> DescribeResize
$cfrom :: forall x. DescribeResize -> Rep DescribeResize x
Prelude.Generic)
newDescribeResize ::
Prelude.Text ->
DescribeResize
newDescribeResize :: Text -> DescribeResize
newDescribeResize Text
pClusterIdentifier_ =
DescribeResize' :: Text -> DescribeResize
DescribeResize'
{ $sel:clusterIdentifier:DescribeResize' :: Text
clusterIdentifier =
Text
pClusterIdentifier_
}
describeResize_clusterIdentifier :: Lens.Lens' DescribeResize Prelude.Text
describeResize_clusterIdentifier :: (Text -> f Text) -> DescribeResize -> f DescribeResize
describeResize_clusterIdentifier = (DescribeResize -> Text)
-> (DescribeResize -> Text -> DescribeResize)
-> Lens DescribeResize DescribeResize Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeResize' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:DescribeResize' :: DescribeResize -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: DescribeResize
s@DescribeResize' {} Text
a -> DescribeResize
s {$sel:clusterIdentifier:DescribeResize' :: Text
clusterIdentifier = Text
a} :: DescribeResize)
instance Core.AWSRequest DescribeResize where
type
AWSResponse DescribeResize =
ResizeProgressMessage
request :: DescribeResize -> Request DescribeResize
request = Service -> DescribeResize -> Request DescribeResize
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeResize
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeResize)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DescribeResize))
-> Logger
-> Service
-> Proxy DescribeResize
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeResize)))
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
"DescribeResizeResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String ResizeProgressMessage
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance Prelude.Hashable DescribeResize
instance Prelude.NFData DescribeResize
instance Core.ToHeaders DescribeResize where
toHeaders :: DescribeResize -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeResize -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeResize where
toPath :: DescribeResize -> ByteString
toPath = ByteString -> DescribeResize -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeResize where
toQuery :: DescribeResize -> QueryString
toQuery DescribeResize' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:DescribeResize' :: DescribeResize -> 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
"DescribeResize" :: 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
]