{-# 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.AuthorizeSnapshotAccess
(
authorizeSnapshotAccess
, AuthorizeSnapshotAccess
, asaSnapshotClusterIdentifier
, asaSnapshotIdentifier
, asaAccountWithRestoreAccess
, authorizeSnapshotAccessResponse
, AuthorizeSnapshotAccessResponse
, asarsSnapshot
, asarsResponseStatus
) 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
data AuthorizeSnapshotAccess = AuthorizeSnapshotAccess'
{ _asaSnapshotClusterIdentifier :: !(Maybe Text)
, _asaSnapshotIdentifier :: !Text
, _asaAccountWithRestoreAccess :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
authorizeSnapshotAccess
:: Text
-> Text
-> AuthorizeSnapshotAccess
authorizeSnapshotAccess pSnapshotIdentifier_ pAccountWithRestoreAccess_ =
AuthorizeSnapshotAccess'
{ _asaSnapshotClusterIdentifier = Nothing
, _asaSnapshotIdentifier = pSnapshotIdentifier_
, _asaAccountWithRestoreAccess = pAccountWithRestoreAccess_
}
asaSnapshotClusterIdentifier :: Lens' AuthorizeSnapshotAccess (Maybe Text)
asaSnapshotClusterIdentifier = lens _asaSnapshotClusterIdentifier (\ s a -> s{_asaSnapshotClusterIdentifier = a});
asaSnapshotIdentifier :: Lens' AuthorizeSnapshotAccess Text
asaSnapshotIdentifier = lens _asaSnapshotIdentifier (\ s a -> s{_asaSnapshotIdentifier = a});
asaAccountWithRestoreAccess :: Lens' AuthorizeSnapshotAccess Text
asaAccountWithRestoreAccess = lens _asaAccountWithRestoreAccess (\ s a -> s{_asaAccountWithRestoreAccess = a});
instance AWSRequest AuthorizeSnapshotAccess where
type Rs AuthorizeSnapshotAccess =
AuthorizeSnapshotAccessResponse
request = postQuery redshift
response
= receiveXMLWrapper "AuthorizeSnapshotAccessResult"
(\ s h x ->
AuthorizeSnapshotAccessResponse' <$>
(x .@? "Snapshot") <*> (pure (fromEnum s)))
instance Hashable AuthorizeSnapshotAccess
instance NFData AuthorizeSnapshotAccess
instance ToHeaders AuthorizeSnapshotAccess where
toHeaders = const mempty
instance ToPath AuthorizeSnapshotAccess where
toPath = const "/"
instance ToQuery AuthorizeSnapshotAccess where
toQuery AuthorizeSnapshotAccess'{..}
= mconcat
["Action" =:
("AuthorizeSnapshotAccess" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"SnapshotClusterIdentifier" =:
_asaSnapshotClusterIdentifier,
"SnapshotIdentifier" =: _asaSnapshotIdentifier,
"AccountWithRestoreAccess" =:
_asaAccountWithRestoreAccess]
data AuthorizeSnapshotAccessResponse = AuthorizeSnapshotAccessResponse'
{ _asarsSnapshot :: !(Maybe Snapshot)
, _asarsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
authorizeSnapshotAccessResponse
:: Int
-> AuthorizeSnapshotAccessResponse
authorizeSnapshotAccessResponse pResponseStatus_ =
AuthorizeSnapshotAccessResponse'
{ _asarsSnapshot = Nothing
, _asarsResponseStatus = pResponseStatus_
}
asarsSnapshot :: Lens' AuthorizeSnapshotAccessResponse (Maybe Snapshot)
asarsSnapshot = lens _asarsSnapshot (\ s a -> s{_asarsSnapshot = a});
asarsResponseStatus :: Lens' AuthorizeSnapshotAccessResponse Int
asarsResponseStatus = lens _asarsResponseStatus (\ s a -> s{_asarsResponseStatus = a});
instance NFData AuthorizeSnapshotAccessResponse