module Network.AWS.RDS.DescribeCertificates
(
describeCertificates
, DescribeCertificates
, dcFilters
, dcCertificateIdentifier
, dcMarker
, dcMaxRecords
, describeCertificatesResponse
, DescribeCertificatesResponse
, dcrsCertificates
, dcrsMarker
, dcrsResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data DescribeCertificates = DescribeCertificates'
{ _dcFilters :: !(Maybe [Filter])
, _dcCertificateIdentifier :: !(Maybe Text)
, _dcMarker :: !(Maybe Text)
, _dcMaxRecords :: !(Maybe Int)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeCertificates
:: DescribeCertificates
describeCertificates =
DescribeCertificates'
{ _dcFilters = Nothing
, _dcCertificateIdentifier = Nothing
, _dcMarker = Nothing
, _dcMaxRecords = Nothing
}
dcFilters :: Lens' DescribeCertificates [Filter]
dcFilters = lens _dcFilters (\ s a -> s{_dcFilters = a}) . _Default . _Coerce;
dcCertificateIdentifier :: Lens' DescribeCertificates (Maybe Text)
dcCertificateIdentifier = lens _dcCertificateIdentifier (\ s a -> s{_dcCertificateIdentifier = a});
dcMarker :: Lens' DescribeCertificates (Maybe Text)
dcMarker = lens _dcMarker (\ s a -> s{_dcMarker = a});
dcMaxRecords :: Lens' DescribeCertificates (Maybe Int)
dcMaxRecords = lens _dcMaxRecords (\ s a -> s{_dcMaxRecords = a});
instance AWSRequest DescribeCertificates where
type Rs DescribeCertificates =
DescribeCertificatesResponse
request = postQuery rDS
response
= receiveXMLWrapper "DescribeCertificatesResult"
(\ s h x ->
DescribeCertificatesResponse' <$>
(x .@? "Certificates" .!@ mempty >>=
may (parseXMLList "Certificate"))
<*> (x .@? "Marker")
<*> (pure (fromEnum s)))
instance ToHeaders DescribeCertificates where
toHeaders = const mempty
instance ToPath DescribeCertificates where
toPath = const "/"
instance ToQuery DescribeCertificates where
toQuery DescribeCertificates'{..}
= mconcat
["Action" =: ("DescribeCertificates" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"Filters" =:
toQuery (toQueryList "Filter" <$> _dcFilters),
"CertificateIdentifier" =: _dcCertificateIdentifier,
"Marker" =: _dcMarker, "MaxRecords" =: _dcMaxRecords]
data DescribeCertificatesResponse = DescribeCertificatesResponse'
{ _dcrsCertificates :: !(Maybe [Certificate])
, _dcrsMarker :: !(Maybe Text)
, _dcrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeCertificatesResponse
:: Int
-> DescribeCertificatesResponse
describeCertificatesResponse pResponseStatus_ =
DescribeCertificatesResponse'
{ _dcrsCertificates = Nothing
, _dcrsMarker = Nothing
, _dcrsResponseStatus = pResponseStatus_
}
dcrsCertificates :: Lens' DescribeCertificatesResponse [Certificate]
dcrsCertificates = lens _dcrsCertificates (\ s a -> s{_dcrsCertificates = a}) . _Default . _Coerce;
dcrsMarker :: Lens' DescribeCertificatesResponse (Maybe Text)
dcrsMarker = lens _dcrsMarker (\ s a -> s{_dcrsMarker = a});
dcrsResponseStatus :: Lens' DescribeCertificatesResponse Int
dcrsResponseStatus = lens _dcrsResponseStatus (\ s a -> s{_dcrsResponseStatus = a});