module Network.AWS.IoT.ListCertificates
(
listCertificates
, ListCertificates
, lcMarker
, lcAscendingOrder
, lcPageSize
, listCertificatesResponse
, ListCertificatesResponse
, lcrsCertificates
, lcrsNextMarker
, lcrsResponseStatus
) where
import Network.AWS.IoT.Types
import Network.AWS.IoT.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListCertificates = ListCertificates'
{ _lcMarker :: !(Maybe Text)
, _lcAscendingOrder :: !(Maybe Bool)
, _lcPageSize :: !(Maybe Nat)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listCertificates
:: ListCertificates
listCertificates =
ListCertificates'
{ _lcMarker = Nothing
, _lcAscendingOrder = Nothing
, _lcPageSize = Nothing
}
lcMarker :: Lens' ListCertificates (Maybe Text)
lcMarker = lens _lcMarker (\ s a -> s{_lcMarker = a});
lcAscendingOrder :: Lens' ListCertificates (Maybe Bool)
lcAscendingOrder = lens _lcAscendingOrder (\ s a -> s{_lcAscendingOrder = a});
lcPageSize :: Lens' ListCertificates (Maybe Natural)
lcPageSize = lens _lcPageSize (\ s a -> s{_lcPageSize = a}) . mapping _Nat;
instance AWSRequest ListCertificates where
type Rs ListCertificates = ListCertificatesResponse
request = get ioT
response
= receiveJSON
(\ s h x ->
ListCertificatesResponse' <$>
(x .?> "certificates" .!@ mempty) <*>
(x .?> "nextMarker")
<*> (pure (fromEnum s)))
instance Hashable ListCertificates
instance NFData ListCertificates
instance ToHeaders ListCertificates where
toHeaders = const mempty
instance ToPath ListCertificates where
toPath = const "/certificates"
instance ToQuery ListCertificates where
toQuery ListCertificates'{..}
= mconcat
["marker" =: _lcMarker,
"isAscendingOrder" =: _lcAscendingOrder,
"pageSize" =: _lcPageSize]
data ListCertificatesResponse = ListCertificatesResponse'
{ _lcrsCertificates :: !(Maybe [Certificate])
, _lcrsNextMarker :: !(Maybe Text)
, _lcrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listCertificatesResponse
:: Int
-> ListCertificatesResponse
listCertificatesResponse pResponseStatus_ =
ListCertificatesResponse'
{ _lcrsCertificates = Nothing
, _lcrsNextMarker = Nothing
, _lcrsResponseStatus = pResponseStatus_
}
lcrsCertificates :: Lens' ListCertificatesResponse [Certificate]
lcrsCertificates = lens _lcrsCertificates (\ s a -> s{_lcrsCertificates = a}) . _Default . _Coerce;
lcrsNextMarker :: Lens' ListCertificatesResponse (Maybe Text)
lcrsNextMarker = lens _lcrsNextMarker (\ s a -> s{_lcrsNextMarker = a});
lcrsResponseStatus :: Lens' ListCertificatesResponse Int
lcrsResponseStatus = lens _lcrsResponseStatus (\ s a -> s{_lcrsResponseStatus = a});
instance NFData ListCertificatesResponse