{-# 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.ListAuthorizers
(
listAuthorizers
, ListAuthorizers
, laStatus
, laMarker
, laAscendingOrder
, laPageSize
, listAuthorizersResponse
, ListAuthorizersResponse
, larsAuthorizers
, larsNextMarker
, larsResponseStatus
) 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 ListAuthorizers = ListAuthorizers'
{ _laStatus :: !(Maybe AuthorizerStatus)
, _laMarker :: !(Maybe Text)
, _laAscendingOrder :: !(Maybe Bool)
, _laPageSize :: !(Maybe Nat)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listAuthorizers
:: ListAuthorizers
listAuthorizers =
ListAuthorizers'
{ _laStatus = Nothing
, _laMarker = Nothing
, _laAscendingOrder = Nothing
, _laPageSize = Nothing
}
laStatus :: Lens' ListAuthorizers (Maybe AuthorizerStatus)
laStatus = lens _laStatus (\ s a -> s{_laStatus = a})
laMarker :: Lens' ListAuthorizers (Maybe Text)
laMarker = lens _laMarker (\ s a -> s{_laMarker = a})
laAscendingOrder :: Lens' ListAuthorizers (Maybe Bool)
laAscendingOrder = lens _laAscendingOrder (\ s a -> s{_laAscendingOrder = a})
laPageSize :: Lens' ListAuthorizers (Maybe Natural)
laPageSize = lens _laPageSize (\ s a -> s{_laPageSize = a}) . mapping _Nat
instance AWSRequest ListAuthorizers where
type Rs ListAuthorizers = ListAuthorizersResponse
request = get ioT
response
= receiveJSON
(\ s h x ->
ListAuthorizersResponse' <$>
(x .?> "authorizers" .!@ mempty) <*>
(x .?> "nextMarker")
<*> (pure (fromEnum s)))
instance Hashable ListAuthorizers where
instance NFData ListAuthorizers where
instance ToHeaders ListAuthorizers where
toHeaders = const mempty
instance ToPath ListAuthorizers where
toPath = const "/authorizers/"
instance ToQuery ListAuthorizers where
toQuery ListAuthorizers'{..}
= mconcat
["status" =: _laStatus, "marker" =: _laMarker,
"isAscendingOrder" =: _laAscendingOrder,
"pageSize" =: _laPageSize]
data ListAuthorizersResponse = ListAuthorizersResponse'
{ _larsAuthorizers :: !(Maybe [AuthorizerSummary])
, _larsNextMarker :: !(Maybe Text)
, _larsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listAuthorizersResponse
:: Int
-> ListAuthorizersResponse
listAuthorizersResponse pResponseStatus_ =
ListAuthorizersResponse'
{ _larsAuthorizers = Nothing
, _larsNextMarker = Nothing
, _larsResponseStatus = pResponseStatus_
}
larsAuthorizers :: Lens' ListAuthorizersResponse [AuthorizerSummary]
larsAuthorizers = lens _larsAuthorizers (\ s a -> s{_larsAuthorizers = a}) . _Default . _Coerce
larsNextMarker :: Lens' ListAuthorizersResponse (Maybe Text)
larsNextMarker = lens _larsNextMarker (\ s a -> s{_larsNextMarker = a})
larsResponseStatus :: Lens' ListAuthorizersResponse Int
larsResponseStatus = lens _larsResponseStatus (\ s a -> s{_larsResponseStatus = a})
instance NFData ListAuthorizersResponse where