{-# 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 #-}
module Amazonka.Redshift.Types.ResizeClusterMessage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal
data ResizeClusterMessage = ResizeClusterMessage'
{
ResizeClusterMessage -> Maybe Int
numberOfNodes :: Prelude.Maybe Prelude.Int,
ResizeClusterMessage -> Maybe Bool
classic :: Prelude.Maybe Prelude.Bool,
ResizeClusterMessage -> Maybe Text
clusterType :: Prelude.Maybe Prelude.Text,
ResizeClusterMessage -> Maybe Text
nodeType :: Prelude.Maybe Prelude.Text,
ResizeClusterMessage -> Text
clusterIdentifier :: Prelude.Text
}
deriving (ResizeClusterMessage -> ResizeClusterMessage -> Bool
(ResizeClusterMessage -> ResizeClusterMessage -> Bool)
-> (ResizeClusterMessage -> ResizeClusterMessage -> Bool)
-> Eq ResizeClusterMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResizeClusterMessage -> ResizeClusterMessage -> Bool
$c/= :: ResizeClusterMessage -> ResizeClusterMessage -> Bool
== :: ResizeClusterMessage -> ResizeClusterMessage -> Bool
$c== :: ResizeClusterMessage -> ResizeClusterMessage -> Bool
Prelude.Eq, ReadPrec [ResizeClusterMessage]
ReadPrec ResizeClusterMessage
Int -> ReadS ResizeClusterMessage
ReadS [ResizeClusterMessage]
(Int -> ReadS ResizeClusterMessage)
-> ReadS [ResizeClusterMessage]
-> ReadPrec ResizeClusterMessage
-> ReadPrec [ResizeClusterMessage]
-> Read ResizeClusterMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResizeClusterMessage]
$creadListPrec :: ReadPrec [ResizeClusterMessage]
readPrec :: ReadPrec ResizeClusterMessage
$creadPrec :: ReadPrec ResizeClusterMessage
readList :: ReadS [ResizeClusterMessage]
$creadList :: ReadS [ResizeClusterMessage]
readsPrec :: Int -> ReadS ResizeClusterMessage
$creadsPrec :: Int -> ReadS ResizeClusterMessage
Prelude.Read, Int -> ResizeClusterMessage -> ShowS
[ResizeClusterMessage] -> ShowS
ResizeClusterMessage -> String
(Int -> ResizeClusterMessage -> ShowS)
-> (ResizeClusterMessage -> String)
-> ([ResizeClusterMessage] -> ShowS)
-> Show ResizeClusterMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResizeClusterMessage] -> ShowS
$cshowList :: [ResizeClusterMessage] -> ShowS
show :: ResizeClusterMessage -> String
$cshow :: ResizeClusterMessage -> String
showsPrec :: Int -> ResizeClusterMessage -> ShowS
$cshowsPrec :: Int -> ResizeClusterMessage -> ShowS
Prelude.Show, (forall x. ResizeClusterMessage -> Rep ResizeClusterMessage x)
-> (forall x. Rep ResizeClusterMessage x -> ResizeClusterMessage)
-> Generic ResizeClusterMessage
forall x. Rep ResizeClusterMessage x -> ResizeClusterMessage
forall x. ResizeClusterMessage -> Rep ResizeClusterMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResizeClusterMessage x -> ResizeClusterMessage
$cfrom :: forall x. ResizeClusterMessage -> Rep ResizeClusterMessage x
Prelude.Generic)
newResizeClusterMessage ::
Prelude.Text ->
ResizeClusterMessage
newResizeClusterMessage :: Text -> ResizeClusterMessage
newResizeClusterMessage Text
pClusterIdentifier_ =
ResizeClusterMessage' :: Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Text
-> ResizeClusterMessage
ResizeClusterMessage'
{ $sel:numberOfNodes:ResizeClusterMessage' :: Maybe Int
numberOfNodes =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:classic:ResizeClusterMessage' :: Maybe Bool
classic = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:clusterType:ResizeClusterMessage' :: Maybe Text
clusterType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nodeType:ResizeClusterMessage' :: Maybe Text
nodeType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:clusterIdentifier:ResizeClusterMessage' :: Text
clusterIdentifier = Text
pClusterIdentifier_
}
resizeClusterMessage_numberOfNodes :: Lens.Lens' ResizeClusterMessage (Prelude.Maybe Prelude.Int)
resizeClusterMessage_numberOfNodes :: (Maybe Int -> f (Maybe Int))
-> ResizeClusterMessage -> f ResizeClusterMessage
resizeClusterMessage_numberOfNodes = (ResizeClusterMessage -> Maybe Int)
-> (ResizeClusterMessage -> Maybe Int -> ResizeClusterMessage)
-> Lens
ResizeClusterMessage ResizeClusterMessage (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResizeClusterMessage' {Maybe Int
numberOfNodes :: Maybe Int
$sel:numberOfNodes:ResizeClusterMessage' :: ResizeClusterMessage -> Maybe Int
numberOfNodes} -> Maybe Int
numberOfNodes) (\s :: ResizeClusterMessage
s@ResizeClusterMessage' {} Maybe Int
a -> ResizeClusterMessage
s {$sel:numberOfNodes:ResizeClusterMessage' :: Maybe Int
numberOfNodes = Maybe Int
a} :: ResizeClusterMessage)
resizeClusterMessage_classic :: Lens.Lens' ResizeClusterMessage (Prelude.Maybe Prelude.Bool)
resizeClusterMessage_classic :: (Maybe Bool -> f (Maybe Bool))
-> ResizeClusterMessage -> f ResizeClusterMessage
resizeClusterMessage_classic = (ResizeClusterMessage -> Maybe Bool)
-> (ResizeClusterMessage -> Maybe Bool -> ResizeClusterMessage)
-> Lens
ResizeClusterMessage ResizeClusterMessage (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResizeClusterMessage' {Maybe Bool
classic :: Maybe Bool
$sel:classic:ResizeClusterMessage' :: ResizeClusterMessage -> Maybe Bool
classic} -> Maybe Bool
classic) (\s :: ResizeClusterMessage
s@ResizeClusterMessage' {} Maybe Bool
a -> ResizeClusterMessage
s {$sel:classic:ResizeClusterMessage' :: Maybe Bool
classic = Maybe Bool
a} :: ResizeClusterMessage)
resizeClusterMessage_clusterType :: Lens.Lens' ResizeClusterMessage (Prelude.Maybe Prelude.Text)
resizeClusterMessage_clusterType :: (Maybe Text -> f (Maybe Text))
-> ResizeClusterMessage -> f ResizeClusterMessage
resizeClusterMessage_clusterType = (ResizeClusterMessage -> Maybe Text)
-> (ResizeClusterMessage -> Maybe Text -> ResizeClusterMessage)
-> Lens
ResizeClusterMessage ResizeClusterMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResizeClusterMessage' {Maybe Text
clusterType :: Maybe Text
$sel:clusterType:ResizeClusterMessage' :: ResizeClusterMessage -> Maybe Text
clusterType} -> Maybe Text
clusterType) (\s :: ResizeClusterMessage
s@ResizeClusterMessage' {} Maybe Text
a -> ResizeClusterMessage
s {$sel:clusterType:ResizeClusterMessage' :: Maybe Text
clusterType = Maybe Text
a} :: ResizeClusterMessage)
resizeClusterMessage_nodeType :: Lens.Lens' ResizeClusterMessage (Prelude.Maybe Prelude.Text)
resizeClusterMessage_nodeType :: (Maybe Text -> f (Maybe Text))
-> ResizeClusterMessage -> f ResizeClusterMessage
resizeClusterMessage_nodeType = (ResizeClusterMessage -> Maybe Text)
-> (ResizeClusterMessage -> Maybe Text -> ResizeClusterMessage)
-> Lens
ResizeClusterMessage ResizeClusterMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResizeClusterMessage' {Maybe Text
nodeType :: Maybe Text
$sel:nodeType:ResizeClusterMessage' :: ResizeClusterMessage -> Maybe Text
nodeType} -> Maybe Text
nodeType) (\s :: ResizeClusterMessage
s@ResizeClusterMessage' {} Maybe Text
a -> ResizeClusterMessage
s {$sel:nodeType:ResizeClusterMessage' :: Maybe Text
nodeType = Maybe Text
a} :: ResizeClusterMessage)
resizeClusterMessage_clusterIdentifier :: Lens.Lens' ResizeClusterMessage Prelude.Text
resizeClusterMessage_clusterIdentifier :: (Text -> f Text) -> ResizeClusterMessage -> f ResizeClusterMessage
resizeClusterMessage_clusterIdentifier = (ResizeClusterMessage -> Text)
-> (ResizeClusterMessage -> Text -> ResizeClusterMessage)
-> Lens ResizeClusterMessage ResizeClusterMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResizeClusterMessage' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:ResizeClusterMessage' :: ResizeClusterMessage -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: ResizeClusterMessage
s@ResizeClusterMessage' {} Text
a -> ResizeClusterMessage
s {$sel:clusterIdentifier:ResizeClusterMessage' :: Text
clusterIdentifier = Text
a} :: ResizeClusterMessage)
instance Core.FromXML ResizeClusterMessage where
parseXML :: [Node] -> Either String ResizeClusterMessage
parseXML [Node]
x =
Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Text
-> ResizeClusterMessage
ResizeClusterMessage'
(Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Text
-> ResizeClusterMessage)
-> Either String (Maybe Int)
-> Either
String
(Maybe Bool
-> Maybe Text -> Maybe Text -> Text -> ResizeClusterMessage)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NumberOfNodes")
Either
String
(Maybe Bool
-> Maybe Text -> Maybe Text -> Text -> ResizeClusterMessage)
-> Either String (Maybe Bool)
-> Either
String (Maybe Text -> Maybe Text -> Text -> ResizeClusterMessage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Classic")
Either
String (Maybe Text -> Maybe Text -> Text -> ResizeClusterMessage)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Text -> ResizeClusterMessage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ClusterType")
Either String (Maybe Text -> Text -> ResizeClusterMessage)
-> Either String (Maybe Text)
-> Either String (Text -> ResizeClusterMessage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NodeType")
Either String (Text -> ResizeClusterMessage)
-> Either String Text -> Either String ResizeClusterMessage
forall (f :: * -> *) a b. Applicative f => 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 ResizeClusterMessage
instance Prelude.NFData ResizeClusterMessage
instance Core.ToQuery ResizeClusterMessage where
toQuery :: ResizeClusterMessage -> QueryString
toQuery ResizeClusterMessage' {Maybe Bool
Maybe Int
Maybe Text
Text
clusterIdentifier :: Text
nodeType :: Maybe Text
clusterType :: Maybe Text
classic :: Maybe Bool
numberOfNodes :: Maybe Int
$sel:clusterIdentifier:ResizeClusterMessage' :: ResizeClusterMessage -> Text
$sel:nodeType:ResizeClusterMessage' :: ResizeClusterMessage -> Maybe Text
$sel:clusterType:ResizeClusterMessage' :: ResizeClusterMessage -> Maybe Text
$sel:classic:ResizeClusterMessage' :: ResizeClusterMessage -> Maybe Bool
$sel:numberOfNodes:ResizeClusterMessage' :: ResizeClusterMessage -> Maybe Int
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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
]