{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.Redshift.RebootCluster
(
rebootCluster
, RebootCluster
, rcClusterIdentifier
, rebootClusterResponse
, RebootClusterResponse
, rcrsCluster
, rcrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Redshift.Types
import Network.AWS.Redshift.Types.Product
import Network.AWS.Request
import Network.AWS.Response
newtype RebootCluster = RebootCluster'
{ _rcClusterIdentifier :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
rebootCluster
:: Text
-> RebootCluster
rebootCluster pClusterIdentifier_ =
RebootCluster' {_rcClusterIdentifier = pClusterIdentifier_}
rcClusterIdentifier :: Lens' RebootCluster Text
rcClusterIdentifier = lens _rcClusterIdentifier (\ s a -> s{_rcClusterIdentifier = a})
instance AWSRequest RebootCluster where
type Rs RebootCluster = RebootClusterResponse
request = postQuery redshift
response
= receiveXMLWrapper "RebootClusterResult"
(\ s h x ->
RebootClusterResponse' <$>
(x .@? "Cluster") <*> (pure (fromEnum s)))
instance Hashable RebootCluster where
instance NFData RebootCluster where
instance ToHeaders RebootCluster where
toHeaders = const mempty
instance ToPath RebootCluster where
toPath = const "/"
instance ToQuery RebootCluster where
toQuery RebootCluster'{..}
= mconcat
["Action" =: ("RebootCluster" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"ClusterIdentifier" =: _rcClusterIdentifier]
data RebootClusterResponse = RebootClusterResponse'
{ _rcrsCluster :: !(Maybe Cluster)
, _rcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
rebootClusterResponse
:: Int
-> RebootClusterResponse
rebootClusterResponse pResponseStatus_ =
RebootClusterResponse'
{_rcrsCluster = Nothing, _rcrsResponseStatus = pResponseStatus_}
rcrsCluster :: Lens' RebootClusterResponse (Maybe Cluster)
rcrsCluster = lens _rcrsCluster (\ s a -> s{_rcrsCluster = a})
rcrsResponseStatus :: Lens' RebootClusterResponse Int
rcrsResponseStatus = lens _rcrsResponseStatus (\ s a -> s{_rcrsResponseStatus = a})
instance NFData RebootClusterResponse where