module Network.AWS.Redshift.RevokeSnapshotAccess
(
RevokeSnapshotAccess
, revokeSnapshotAccess
, rsaAccountWithRestoreAccess
, rsaSnapshotClusterIdentifier
, rsaSnapshotIdentifier
, RevokeSnapshotAccessResponse
, revokeSnapshotAccessResponse
, rsarSnapshot
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.Redshift.Types
import qualified GHC.Exts
data RevokeSnapshotAccess = RevokeSnapshotAccess
{ _rsaAccountWithRestoreAccess :: Text
, _rsaSnapshotClusterIdentifier :: Maybe Text
, _rsaSnapshotIdentifier :: Text
} deriving (Eq, Ord, Read, Show)
revokeSnapshotAccess :: Text
-> Text
-> RevokeSnapshotAccess
revokeSnapshotAccess p1 p2 = RevokeSnapshotAccess
{ _rsaSnapshotIdentifier = p1
, _rsaAccountWithRestoreAccess = p2
, _rsaSnapshotClusterIdentifier = Nothing
}
rsaAccountWithRestoreAccess :: Lens' RevokeSnapshotAccess Text
rsaAccountWithRestoreAccess =
lens _rsaAccountWithRestoreAccess
(\s a -> s { _rsaAccountWithRestoreAccess = a })
rsaSnapshotClusterIdentifier :: Lens' RevokeSnapshotAccess (Maybe Text)
rsaSnapshotClusterIdentifier =
lens _rsaSnapshotClusterIdentifier
(\s a -> s { _rsaSnapshotClusterIdentifier = a })
rsaSnapshotIdentifier :: Lens' RevokeSnapshotAccess Text
rsaSnapshotIdentifier =
lens _rsaSnapshotIdentifier (\s a -> s { _rsaSnapshotIdentifier = a })
newtype RevokeSnapshotAccessResponse = RevokeSnapshotAccessResponse
{ _rsarSnapshot :: Maybe Snapshot
} deriving (Eq, Read, Show)
revokeSnapshotAccessResponse :: RevokeSnapshotAccessResponse
revokeSnapshotAccessResponse = RevokeSnapshotAccessResponse
{ _rsarSnapshot = Nothing
}
rsarSnapshot :: Lens' RevokeSnapshotAccessResponse (Maybe Snapshot)
rsarSnapshot = lens _rsarSnapshot (\s a -> s { _rsarSnapshot = a })
instance ToPath RevokeSnapshotAccess where
toPath = const "/"
instance ToQuery RevokeSnapshotAccess where
toQuery RevokeSnapshotAccess{..} = mconcat
[ "AccountWithRestoreAccess" =? _rsaAccountWithRestoreAccess
, "SnapshotClusterIdentifier" =? _rsaSnapshotClusterIdentifier
, "SnapshotIdentifier" =? _rsaSnapshotIdentifier
]
instance ToHeaders RevokeSnapshotAccess
instance AWSRequest RevokeSnapshotAccess where
type Sv RevokeSnapshotAccess = Redshift
type Rs RevokeSnapshotAccess = RevokeSnapshotAccessResponse
request = post "RevokeSnapshotAccess"
response = xmlResponse
instance FromXML RevokeSnapshotAccessResponse where
parseXML = withElement "RevokeSnapshotAccessResult" $ \x -> RevokeSnapshotAccessResponse
<$> x .@? "Snapshot"