module Network.AWS.IoT.ListCACertificates
(
listCACertificates
, ListCACertificates
, lcacMarker
, lcacAscendingOrder
, lcacPageSize
, listCACertificatesResponse
, ListCACertificatesResponse
, lcacrsCertificates
, lcacrsNextMarker
, lcacrsResponseStatus
) 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 ListCACertificates = ListCACertificates'
{ _lcacMarker :: !(Maybe Text)
, _lcacAscendingOrder :: !(Maybe Bool)
, _lcacPageSize :: !(Maybe Nat)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listCACertificates
:: ListCACertificates
listCACertificates =
ListCACertificates'
{ _lcacMarker = Nothing
, _lcacAscendingOrder = Nothing
, _lcacPageSize = Nothing
}
lcacMarker :: Lens' ListCACertificates (Maybe Text)
lcacMarker = lens _lcacMarker (\ s a -> s{_lcacMarker = a});
lcacAscendingOrder :: Lens' ListCACertificates (Maybe Bool)
lcacAscendingOrder = lens _lcacAscendingOrder (\ s a -> s{_lcacAscendingOrder = a});
lcacPageSize :: Lens' ListCACertificates (Maybe Natural)
lcacPageSize = lens _lcacPageSize (\ s a -> s{_lcacPageSize = a}) . mapping _Nat;
instance AWSRequest ListCACertificates where
type Rs ListCACertificates =
ListCACertificatesResponse
request = get ioT
response
= receiveJSON
(\ s h x ->
ListCACertificatesResponse' <$>
(x .?> "certificates" .!@ mempty) <*>
(x .?> "nextMarker")
<*> (pure (fromEnum s)))
instance Hashable ListCACertificates
instance NFData ListCACertificates
instance ToHeaders ListCACertificates where
toHeaders = const mempty
instance ToPath ListCACertificates where
toPath = const "/cacertificates"
instance ToQuery ListCACertificates where
toQuery ListCACertificates'{..}
= mconcat
["marker" =: _lcacMarker,
"isAscendingOrder" =: _lcacAscendingOrder,
"pageSize" =: _lcacPageSize]
data ListCACertificatesResponse = ListCACertificatesResponse'
{ _lcacrsCertificates :: !(Maybe [CACertificate])
, _lcacrsNextMarker :: !(Maybe Text)
, _lcacrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listCACertificatesResponse
:: Int
-> ListCACertificatesResponse
listCACertificatesResponse pResponseStatus_ =
ListCACertificatesResponse'
{ _lcacrsCertificates = Nothing
, _lcacrsNextMarker = Nothing
, _lcacrsResponseStatus = pResponseStatus_
}
lcacrsCertificates :: Lens' ListCACertificatesResponse [CACertificate]
lcacrsCertificates = lens _lcacrsCertificates (\ s a -> s{_lcacrsCertificates = a}) . _Default . _Coerce;
lcacrsNextMarker :: Lens' ListCACertificatesResponse (Maybe Text)
lcacrsNextMarker = lens _lcacrsNextMarker (\ s a -> s{_lcacrsNextMarker = a});
lcacrsResponseStatus :: Lens' ListCACertificatesResponse Int
lcacrsResponseStatus = lens _lcacrsResponseStatus (\ s a -> s{_lcacrsResponseStatus = a});
instance NFData ListCACertificatesResponse