module Network.AWS.IAM.ListServerCertificates
(
listServerCertificates
, ListServerCertificates
, lscPathPrefix
, lscMaxItems
, lscMarker
, listServerCertificatesResponse
, ListServerCertificatesResponse
, lscrsMarker
, lscrsIsTruncated
, lscrsStatus
, lscrsServerCertificateMetadataList
) where
import Network.AWS.IAM.Types
import Network.AWS.IAM.Types.Product
import Network.AWS.Pager
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListServerCertificates = ListServerCertificates'
{ _lscPathPrefix :: !(Maybe Text)
, _lscMaxItems :: !(Maybe Nat)
, _lscMarker :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listServerCertificates
:: ListServerCertificates
listServerCertificates =
ListServerCertificates'
{ _lscPathPrefix = Nothing
, _lscMaxItems = Nothing
, _lscMarker = Nothing
}
lscPathPrefix :: Lens' ListServerCertificates (Maybe Text)
lscPathPrefix = lens _lscPathPrefix (\ s a -> s{_lscPathPrefix = a});
lscMaxItems :: Lens' ListServerCertificates (Maybe Natural)
lscMaxItems = lens _lscMaxItems (\ s a -> s{_lscMaxItems = a}) . mapping _Nat;
lscMarker :: Lens' ListServerCertificates (Maybe Text)
lscMarker = lens _lscMarker (\ s a -> s{_lscMarker = a});
instance AWSPager ListServerCertificates where
page rq rs
| stop (rs ^. lscrsIsTruncated) = Nothing
| isNothing (rs ^. lscrsMarker) = Nothing
| otherwise =
Just $ rq & lscMarker .~ rs ^. lscrsMarker
instance AWSRequest ListServerCertificates where
type Sv ListServerCertificates = IAM
type Rs ListServerCertificates =
ListServerCertificatesResponse
request = postQuery
response
= receiveXMLWrapper "ListServerCertificatesResult"
(\ s h x ->
ListServerCertificatesResponse' <$>
(x .@? "Marker") <*> (x .@? "IsTruncated") <*>
(pure (fromEnum s))
<*>
(x .@? "ServerCertificateMetadataList" .!@ mempty >>=
parseXMLList "member"))
instance ToHeaders ListServerCertificates where
toHeaders = const mempty
instance ToPath ListServerCertificates where
toPath = const "/"
instance ToQuery ListServerCertificates where
toQuery ListServerCertificates'{..}
= mconcat
["Action" =:
("ListServerCertificates" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"PathPrefix" =: _lscPathPrefix,
"MaxItems" =: _lscMaxItems, "Marker" =: _lscMarker]
data ListServerCertificatesResponse = ListServerCertificatesResponse'
{ _lscrsMarker :: !(Maybe Text)
, _lscrsIsTruncated :: !(Maybe Bool)
, _lscrsStatus :: !Int
, _lscrsServerCertificateMetadataList :: ![ServerCertificateMetadata]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listServerCertificatesResponse
:: Int
-> ListServerCertificatesResponse
listServerCertificatesResponse pStatus_ =
ListServerCertificatesResponse'
{ _lscrsMarker = Nothing
, _lscrsIsTruncated = Nothing
, _lscrsStatus = pStatus_
, _lscrsServerCertificateMetadataList = mempty
}
lscrsMarker :: Lens' ListServerCertificatesResponse (Maybe Text)
lscrsMarker = lens _lscrsMarker (\ s a -> s{_lscrsMarker = a});
lscrsIsTruncated :: Lens' ListServerCertificatesResponse (Maybe Bool)
lscrsIsTruncated = lens _lscrsIsTruncated (\ s a -> s{_lscrsIsTruncated = a});
lscrsStatus :: Lens' ListServerCertificatesResponse Int
lscrsStatus = lens _lscrsStatus (\ s a -> s{_lscrsStatus = a});
lscrsServerCertificateMetadataList :: Lens' ListServerCertificatesResponse [ServerCertificateMetadata]
lscrsServerCertificateMetadataList = lens _lscrsServerCertificateMetadataList (\ s a -> s{_lscrsServerCertificateMetadataList = a}) . _Coerce;