{-# 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.DirectoryService.ListIPRoutes
(
listIPRoutes
, ListIPRoutes
, lirNextToken
, lirLimit
, lirDirectoryId
, listIPRoutesResponse
, ListIPRoutesResponse
, lirrsIPRoutesInfo
, lirrsNextToken
, lirrsResponseStatus
) where
import Network.AWS.DirectoryService.Types
import Network.AWS.DirectoryService.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListIPRoutes = ListIPRoutes'
{ _lirNextToken :: !(Maybe Text)
, _lirLimit :: !(Maybe Nat)
, _lirDirectoryId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listIPRoutes
:: Text
-> ListIPRoutes
listIPRoutes pDirectoryId_ =
ListIPRoutes'
{ _lirNextToken = Nothing
, _lirLimit = Nothing
, _lirDirectoryId = pDirectoryId_
}
lirNextToken :: Lens' ListIPRoutes (Maybe Text)
lirNextToken = lens _lirNextToken (\ s a -> s{_lirNextToken = a});
lirLimit :: Lens' ListIPRoutes (Maybe Natural)
lirLimit = lens _lirLimit (\ s a -> s{_lirLimit = a}) . mapping _Nat;
lirDirectoryId :: Lens' ListIPRoutes Text
lirDirectoryId = lens _lirDirectoryId (\ s a -> s{_lirDirectoryId = a});
instance AWSRequest ListIPRoutes where
type Rs ListIPRoutes = ListIPRoutesResponse
request = postJSON directoryService
response
= receiveJSON
(\ s h x ->
ListIPRoutesResponse' <$>
(x .?> "IpRoutesInfo" .!@ mempty) <*>
(x .?> "NextToken")
<*> (pure (fromEnum s)))
instance Hashable ListIPRoutes
instance NFData ListIPRoutes
instance ToHeaders ListIPRoutes where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DirectoryService_20150416.ListIpRoutes" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListIPRoutes where
toJSON ListIPRoutes'{..}
= object
(catMaybes
[("NextToken" .=) <$> _lirNextToken,
("Limit" .=) <$> _lirLimit,
Just ("DirectoryId" .= _lirDirectoryId)])
instance ToPath ListIPRoutes where
toPath = const "/"
instance ToQuery ListIPRoutes where
toQuery = const mempty
data ListIPRoutesResponse = ListIPRoutesResponse'
{ _lirrsIPRoutesInfo :: !(Maybe [IPRouteInfo])
, _lirrsNextToken :: !(Maybe Text)
, _lirrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listIPRoutesResponse
:: Int
-> ListIPRoutesResponse
listIPRoutesResponse pResponseStatus_ =
ListIPRoutesResponse'
{ _lirrsIPRoutesInfo = Nothing
, _lirrsNextToken = Nothing
, _lirrsResponseStatus = pResponseStatus_
}
lirrsIPRoutesInfo :: Lens' ListIPRoutesResponse [IPRouteInfo]
lirrsIPRoutesInfo = lens _lirrsIPRoutesInfo (\ s a -> s{_lirrsIPRoutesInfo = a}) . _Default . _Coerce;
lirrsNextToken :: Lens' ListIPRoutesResponse (Maybe Text)
lirrsNextToken = lens _lirrsNextToken (\ s a -> s{_lirrsNextToken = a});
lirrsResponseStatus :: Lens' ListIPRoutesResponse Int
lirrsResponseStatus = lens _lirrsResponseStatus (\ s a -> s{_lirrsResponseStatus = a});
instance NFData ListIPRoutesResponse