{-# 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.DescribeSnapshotCopyGrants
(
describeSnapshotCopyGrants
, DescribeSnapshotCopyGrants
, dscgsTagValues
, dscgsTagKeys
, dscgsMarker
, dscgsMaxRecords
, dscgsSnapshotCopyGrantName
, describeSnapshotCopyGrantsResponse
, DescribeSnapshotCopyGrantsResponse
, dscgrsSnapshotCopyGrants
, dscgrsMarker
, dscgrsResponseStatus
) 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 DescribeSnapshotCopyGrants = DescribeSnapshotCopyGrants'
{ _dscgsTagValues :: !(Maybe [Text])
, _dscgsTagKeys :: !(Maybe [Text])
, _dscgsMarker :: !(Maybe Text)
, _dscgsMaxRecords :: !(Maybe Int)
, _dscgsSnapshotCopyGrantName :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeSnapshotCopyGrants
:: DescribeSnapshotCopyGrants
describeSnapshotCopyGrants =
DescribeSnapshotCopyGrants'
{ _dscgsTagValues = Nothing
, _dscgsTagKeys = Nothing
, _dscgsMarker = Nothing
, _dscgsMaxRecords = Nothing
, _dscgsSnapshotCopyGrantName = Nothing
}
dscgsTagValues :: Lens' DescribeSnapshotCopyGrants [Text]
dscgsTagValues = lens _dscgsTagValues (\ s a -> s{_dscgsTagValues = a}) . _Default . _Coerce;
dscgsTagKeys :: Lens' DescribeSnapshotCopyGrants [Text]
dscgsTagKeys = lens _dscgsTagKeys (\ s a -> s{_dscgsTagKeys = a}) . _Default . _Coerce;
dscgsMarker :: Lens' DescribeSnapshotCopyGrants (Maybe Text)
dscgsMarker = lens _dscgsMarker (\ s a -> s{_dscgsMarker = a});
dscgsMaxRecords :: Lens' DescribeSnapshotCopyGrants (Maybe Int)
dscgsMaxRecords = lens _dscgsMaxRecords (\ s a -> s{_dscgsMaxRecords = a});
dscgsSnapshotCopyGrantName :: Lens' DescribeSnapshotCopyGrants (Maybe Text)
dscgsSnapshotCopyGrantName = lens _dscgsSnapshotCopyGrantName (\ s a -> s{_dscgsSnapshotCopyGrantName = a});
instance AWSRequest DescribeSnapshotCopyGrants where
type Rs DescribeSnapshotCopyGrants =
DescribeSnapshotCopyGrantsResponse
request = postQuery redshift
response
= receiveXMLWrapper
"DescribeSnapshotCopyGrantsResult"
(\ s h x ->
DescribeSnapshotCopyGrantsResponse' <$>
(x .@? "SnapshotCopyGrants" .!@ mempty >>=
may (parseXMLList "SnapshotCopyGrant"))
<*> (x .@? "Marker")
<*> (pure (fromEnum s)))
instance Hashable DescribeSnapshotCopyGrants
instance NFData DescribeSnapshotCopyGrants
instance ToHeaders DescribeSnapshotCopyGrants where
toHeaders = const mempty
instance ToPath DescribeSnapshotCopyGrants where
toPath = const "/"
instance ToQuery DescribeSnapshotCopyGrants where
toQuery DescribeSnapshotCopyGrants'{..}
= mconcat
["Action" =:
("DescribeSnapshotCopyGrants" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"TagValues" =:
toQuery (toQueryList "TagValue" <$> _dscgsTagValues),
"TagKeys" =:
toQuery (toQueryList "TagKey" <$> _dscgsTagKeys),
"Marker" =: _dscgsMarker,
"MaxRecords" =: _dscgsMaxRecords,
"SnapshotCopyGrantName" =:
_dscgsSnapshotCopyGrantName]
data DescribeSnapshotCopyGrantsResponse = DescribeSnapshotCopyGrantsResponse'
{ _dscgrsSnapshotCopyGrants :: !(Maybe [SnapshotCopyGrant])
, _dscgrsMarker :: !(Maybe Text)
, _dscgrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeSnapshotCopyGrantsResponse
:: Int
-> DescribeSnapshotCopyGrantsResponse
describeSnapshotCopyGrantsResponse pResponseStatus_ =
DescribeSnapshotCopyGrantsResponse'
{ _dscgrsSnapshotCopyGrants = Nothing
, _dscgrsMarker = Nothing
, _dscgrsResponseStatus = pResponseStatus_
}
dscgrsSnapshotCopyGrants :: Lens' DescribeSnapshotCopyGrantsResponse [SnapshotCopyGrant]
dscgrsSnapshotCopyGrants = lens _dscgrsSnapshotCopyGrants (\ s a -> s{_dscgrsSnapshotCopyGrants = a}) . _Default . _Coerce;
dscgrsMarker :: Lens' DescribeSnapshotCopyGrantsResponse (Maybe Text)
dscgrsMarker = lens _dscgrsMarker (\ s a -> s{_dscgrsMarker = a});
dscgrsResponseStatus :: Lens' DescribeSnapshotCopyGrantsResponse Int
dscgrsResponseStatus = lens _dscgrsResponseStatus (\ s a -> s{_dscgrsResponseStatus = a});
instance NFData DescribeSnapshotCopyGrantsResponse