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
instance NFData RebootCluster
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