module Network.AWS.Redshift.CreateClusterSnapshot
(
createClusterSnapshot
, CreateClusterSnapshot
, ccsTags
, ccsSnapshotIdentifier
, ccsClusterIdentifier
, createClusterSnapshotResponse
, CreateClusterSnapshotResponse
, crersSnapshot
, crersResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.Redshift.Types
import Network.AWS.Redshift.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data CreateClusterSnapshot = CreateClusterSnapshot'
{ _ccsTags :: !(Maybe [Tag])
, _ccsSnapshotIdentifier :: !Text
, _ccsClusterIdentifier :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createClusterSnapshot
:: Text
-> Text
-> CreateClusterSnapshot
createClusterSnapshot pSnapshotIdentifier_ pClusterIdentifier_ =
CreateClusterSnapshot'
{ _ccsTags = Nothing
, _ccsSnapshotIdentifier = pSnapshotIdentifier_
, _ccsClusterIdentifier = pClusterIdentifier_
}
ccsTags :: Lens' CreateClusterSnapshot [Tag]
ccsTags = lens _ccsTags (\ s a -> s{_ccsTags = a}) . _Default . _Coerce;
ccsSnapshotIdentifier :: Lens' CreateClusterSnapshot Text
ccsSnapshotIdentifier = lens _ccsSnapshotIdentifier (\ s a -> s{_ccsSnapshotIdentifier = a});
ccsClusterIdentifier :: Lens' CreateClusterSnapshot Text
ccsClusterIdentifier = lens _ccsClusterIdentifier (\ s a -> s{_ccsClusterIdentifier = a});
instance AWSRequest CreateClusterSnapshot where
type Rs CreateClusterSnapshot =
CreateClusterSnapshotResponse
request = postQuery redshift
response
= receiveXMLWrapper "CreateClusterSnapshotResult"
(\ s h x ->
CreateClusterSnapshotResponse' <$>
(x .@? "Snapshot") <*> (pure (fromEnum s)))
instance ToHeaders CreateClusterSnapshot where
toHeaders = const mempty
instance ToPath CreateClusterSnapshot where
toPath = const "/"
instance ToQuery CreateClusterSnapshot where
toQuery CreateClusterSnapshot'{..}
= mconcat
["Action" =: ("CreateClusterSnapshot" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _ccsTags),
"SnapshotIdentifier" =: _ccsSnapshotIdentifier,
"ClusterIdentifier" =: _ccsClusterIdentifier]
data CreateClusterSnapshotResponse = CreateClusterSnapshotResponse'
{ _crersSnapshot :: !(Maybe Snapshot)
, _crersResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createClusterSnapshotResponse
:: Int
-> CreateClusterSnapshotResponse
createClusterSnapshotResponse pResponseStatus_ =
CreateClusterSnapshotResponse'
{ _crersSnapshot = Nothing
, _crersResponseStatus = pResponseStatus_
}
crersSnapshot :: Lens' CreateClusterSnapshotResponse (Maybe Snapshot)
crersSnapshot = lens _crersSnapshot (\ s a -> s{_crersSnapshot = a});
crersResponseStatus :: Lens' CreateClusterSnapshotResponse Int
crersResponseStatus = lens _crersResponseStatus (\ s a -> s{_crersResponseStatus = a});