module Network.AWS.IoT.ListCertificatesByCA
(
listCertificatesByCA
, ListCertificatesByCA
, lcbcaMarker
, lcbcaAscendingOrder
, lcbcaPageSize
, lcbcaCaCertificateId
, listCertificatesByCAResponse
, ListCertificatesByCAResponse
, lcbcarsCertificates
, lcbcarsNextMarker
, lcbcarsResponseStatus
) 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 ListCertificatesByCA = ListCertificatesByCA'
{ _lcbcaMarker :: !(Maybe Text)
, _lcbcaAscendingOrder :: !(Maybe Bool)
, _lcbcaPageSize :: !(Maybe Nat)
, _lcbcaCaCertificateId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listCertificatesByCA
:: Text
-> ListCertificatesByCA
listCertificatesByCA pCaCertificateId_ =
ListCertificatesByCA'
{ _lcbcaMarker = Nothing
, _lcbcaAscendingOrder = Nothing
, _lcbcaPageSize = Nothing
, _lcbcaCaCertificateId = pCaCertificateId_
}
lcbcaMarker :: Lens' ListCertificatesByCA (Maybe Text)
lcbcaMarker = lens _lcbcaMarker (\ s a -> s{_lcbcaMarker = a});
lcbcaAscendingOrder :: Lens' ListCertificatesByCA (Maybe Bool)
lcbcaAscendingOrder = lens _lcbcaAscendingOrder (\ s a -> s{_lcbcaAscendingOrder = a});
lcbcaPageSize :: Lens' ListCertificatesByCA (Maybe Natural)
lcbcaPageSize = lens _lcbcaPageSize (\ s a -> s{_lcbcaPageSize = a}) . mapping _Nat;
lcbcaCaCertificateId :: Lens' ListCertificatesByCA Text
lcbcaCaCertificateId = lens _lcbcaCaCertificateId (\ s a -> s{_lcbcaCaCertificateId = a});
instance AWSRequest ListCertificatesByCA where
type Rs ListCertificatesByCA =
ListCertificatesByCAResponse
request = get ioT
response
= receiveJSON
(\ s h x ->
ListCertificatesByCAResponse' <$>
(x .?> "certificates" .!@ mempty) <*>
(x .?> "nextMarker")
<*> (pure (fromEnum s)))
instance Hashable ListCertificatesByCA
instance NFData ListCertificatesByCA
instance ToHeaders ListCertificatesByCA where
toHeaders = const mempty
instance ToPath ListCertificatesByCA where
toPath ListCertificatesByCA'{..}
= mconcat
["/certificates-by-ca/", toBS _lcbcaCaCertificateId]
instance ToQuery ListCertificatesByCA where
toQuery ListCertificatesByCA'{..}
= mconcat
["marker" =: _lcbcaMarker,
"isAscendingOrder" =: _lcbcaAscendingOrder,
"pageSize" =: _lcbcaPageSize]
data ListCertificatesByCAResponse = ListCertificatesByCAResponse'
{ _lcbcarsCertificates :: !(Maybe [Certificate])
, _lcbcarsNextMarker :: !(Maybe Text)
, _lcbcarsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listCertificatesByCAResponse
:: Int
-> ListCertificatesByCAResponse
listCertificatesByCAResponse pResponseStatus_ =
ListCertificatesByCAResponse'
{ _lcbcarsCertificates = Nothing
, _lcbcarsNextMarker = Nothing
, _lcbcarsResponseStatus = pResponseStatus_
}
lcbcarsCertificates :: Lens' ListCertificatesByCAResponse [Certificate]
lcbcarsCertificates = lens _lcbcarsCertificates (\ s a -> s{_lcbcarsCertificates = a}) . _Default . _Coerce;
lcbcarsNextMarker :: Lens' ListCertificatesByCAResponse (Maybe Text)
lcbcarsNextMarker = lens _lcbcarsNextMarker (\ s a -> s{_lcbcarsNextMarker = a});
lcbcarsResponseStatus :: Lens' ListCertificatesByCAResponse Int
lcbcarsResponseStatus = lens _lcbcarsResponseStatus (\ s a -> s{_lcbcarsResponseStatus = a});
instance NFData ListCertificatesByCAResponse