module Network.AWS.Redshift.RotateEncryptionKey
(
rotateEncryptionKey
, RotateEncryptionKey
, rekClusterIdentifier
, rotateEncryptionKeyResponse
, RotateEncryptionKeyResponse
, rekrsCluster
, rekrsResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.Redshift.Types
import Network.AWS.Redshift.Types.Product
import Network.AWS.Request
import Network.AWS.Response
newtype RotateEncryptionKey = RotateEncryptionKey'
{ _rekClusterIdentifier :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
rotateEncryptionKey
:: Text
-> RotateEncryptionKey
rotateEncryptionKey pClusterIdentifier_ =
RotateEncryptionKey'
{ _rekClusterIdentifier = pClusterIdentifier_
}
rekClusterIdentifier :: Lens' RotateEncryptionKey Text
rekClusterIdentifier = lens _rekClusterIdentifier (\ s a -> s{_rekClusterIdentifier = a});
instance AWSRequest RotateEncryptionKey where
type Rs RotateEncryptionKey =
RotateEncryptionKeyResponse
request = postQuery redshift
response
= receiveXMLWrapper "RotateEncryptionKeyResult"
(\ s h x ->
RotateEncryptionKeyResponse' <$>
(x .@? "Cluster") <*> (pure (fromEnum s)))
instance ToHeaders RotateEncryptionKey where
toHeaders = const mempty
instance ToPath RotateEncryptionKey where
toPath = const "/"
instance ToQuery RotateEncryptionKey where
toQuery RotateEncryptionKey'{..}
= mconcat
["Action" =: ("RotateEncryptionKey" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"ClusterIdentifier" =: _rekClusterIdentifier]
data RotateEncryptionKeyResponse = RotateEncryptionKeyResponse'
{ _rekrsCluster :: !(Maybe Cluster)
, _rekrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
rotateEncryptionKeyResponse
:: Int
-> RotateEncryptionKeyResponse
rotateEncryptionKeyResponse pResponseStatus_ =
RotateEncryptionKeyResponse'
{ _rekrsCluster = Nothing
, _rekrsResponseStatus = pResponseStatus_
}
rekrsCluster :: Lens' RotateEncryptionKeyResponse (Maybe Cluster)
rekrsCluster = lens _rekrsCluster (\ s a -> s{_rekrsCluster = a});
rekrsResponseStatus :: Lens' RotateEncryptionKeyResponse Int
rekrsResponseStatus = lens _rekrsResponseStatus (\ s a -> s{_rekrsResponseStatus = a});