{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.IoT.ListOutgoingCertificates
(
listOutgoingCertificates
, ListOutgoingCertificates
, locMarker
, locAscendingOrder
, locPageSize
, listOutgoingCertificatesResponse
, ListOutgoingCertificatesResponse
, locrsNextMarker
, locrsOutgoingCertificates
, locrsResponseStatus
) 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 ListOutgoingCertificates = ListOutgoingCertificates'
{ _locMarker :: !(Maybe Text)
, _locAscendingOrder :: !(Maybe Bool)
, _locPageSize :: !(Maybe Nat)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listOutgoingCertificates
:: ListOutgoingCertificates
listOutgoingCertificates =
ListOutgoingCertificates'
{ _locMarker = Nothing
, _locAscendingOrder = Nothing
, _locPageSize = Nothing
}
locMarker :: Lens' ListOutgoingCertificates (Maybe Text)
locMarker = lens _locMarker (\ s a -> s{_locMarker = a});
locAscendingOrder :: Lens' ListOutgoingCertificates (Maybe Bool)
locAscendingOrder = lens _locAscendingOrder (\ s a -> s{_locAscendingOrder = a});
locPageSize :: Lens' ListOutgoingCertificates (Maybe Natural)
locPageSize = lens _locPageSize (\ s a -> s{_locPageSize = a}) . mapping _Nat;
instance AWSRequest ListOutgoingCertificates where
type Rs ListOutgoingCertificates =
ListOutgoingCertificatesResponse
request = get ioT
response
= receiveJSON
(\ s h x ->
ListOutgoingCertificatesResponse' <$>
(x .?> "nextMarker") <*>
(x .?> "outgoingCertificates" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable ListOutgoingCertificates
instance NFData ListOutgoingCertificates
instance ToHeaders ListOutgoingCertificates where
toHeaders = const mempty
instance ToPath ListOutgoingCertificates where
toPath = const "/certificates-out-going"
instance ToQuery ListOutgoingCertificates where
toQuery ListOutgoingCertificates'{..}
= mconcat
["marker" =: _locMarker,
"isAscendingOrder" =: _locAscendingOrder,
"pageSize" =: _locPageSize]
data ListOutgoingCertificatesResponse = ListOutgoingCertificatesResponse'
{ _locrsNextMarker :: !(Maybe Text)
, _locrsOutgoingCertificates :: !(Maybe [OutgoingCertificate])
, _locrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listOutgoingCertificatesResponse
:: Int
-> ListOutgoingCertificatesResponse
listOutgoingCertificatesResponse pResponseStatus_ =
ListOutgoingCertificatesResponse'
{ _locrsNextMarker = Nothing
, _locrsOutgoingCertificates = Nothing
, _locrsResponseStatus = pResponseStatus_
}
locrsNextMarker :: Lens' ListOutgoingCertificatesResponse (Maybe Text)
locrsNextMarker = lens _locrsNextMarker (\ s a -> s{_locrsNextMarker = a});
locrsOutgoingCertificates :: Lens' ListOutgoingCertificatesResponse [OutgoingCertificate]
locrsOutgoingCertificates = lens _locrsOutgoingCertificates (\ s a -> s{_locrsOutgoingCertificates = a}) . _Default . _Coerce;
locrsResponseStatus :: Lens' ListOutgoingCertificatesResponse Int
locrsResponseStatus = lens _locrsResponseStatus (\ s a -> s{_locrsResponseStatus = a});
instance NFData ListOutgoingCertificatesResponse