module Network.AWS.RDS.DescribeCertificates
(
describeCertificates
, DescribeCertificates
, dcFilters
, dcCertificateIdentifier
, dcMaxRecords
, dcMarker
, describeCertificatesResponse
, DescribeCertificatesResponse
, dcrsCertificates
, dcrsMarker
, dcrsStatus
) 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)
, _dcMaxRecords :: !(Maybe Int)
, _dcMarker :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeCertificates
:: DescribeCertificates
describeCertificates =
DescribeCertificates'
{ _dcFilters = Nothing
, _dcCertificateIdentifier = Nothing
, _dcMaxRecords = Nothing
, _dcMarker = 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});
dcMaxRecords :: Lens' DescribeCertificates (Maybe Int)
dcMaxRecords = lens _dcMaxRecords (\ s a -> s{_dcMaxRecords = a});
dcMarker :: Lens' DescribeCertificates (Maybe Text)
dcMarker = lens _dcMarker (\ s a -> s{_dcMarker = a});
instance AWSRequest DescribeCertificates where
type Sv DescribeCertificates = RDS
type Rs DescribeCertificates =
DescribeCertificatesResponse
request = postQuery
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,
"MaxRecords" =: _dcMaxRecords, "Marker" =: _dcMarker]
data DescribeCertificatesResponse = DescribeCertificatesResponse'
{ _dcrsCertificates :: !(Maybe [Certificate])
, _dcrsMarker :: !(Maybe Text)
, _dcrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeCertificatesResponse
:: Int
-> DescribeCertificatesResponse
describeCertificatesResponse pStatus_ =
DescribeCertificatesResponse'
{ _dcrsCertificates = Nothing
, _dcrsMarker = Nothing
, _dcrsStatus = pStatus_
}
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});
dcrsStatus :: Lens' DescribeCertificatesResponse Int
dcrsStatus = lens _dcrsStatus (\ s a -> s{_dcrsStatus = a});