module Network.AWS.ElasticBeanstalk.ListPlatformVersions
(
listPlatformVersions
, ListPlatformVersions
, lpvFilters
, lpvNextToken
, lpvMaxRecords
, listPlatformVersionsResponse
, ListPlatformVersionsResponse
, lpvrsNextToken
, lpvrsPlatformSummaryList
, lpvrsResponseStatus
) where
import Network.AWS.ElasticBeanstalk.Types
import Network.AWS.ElasticBeanstalk.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListPlatformVersions = ListPlatformVersions'
{ _lpvFilters :: !(Maybe [PlatformFilter])
, _lpvNextToken :: !(Maybe Text)
, _lpvMaxRecords :: !(Maybe Nat)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listPlatformVersions
:: ListPlatformVersions
listPlatformVersions =
ListPlatformVersions'
{_lpvFilters = Nothing, _lpvNextToken = Nothing, _lpvMaxRecords = Nothing}
lpvFilters :: Lens' ListPlatformVersions [PlatformFilter]
lpvFilters = lens _lpvFilters (\ s a -> s{_lpvFilters = a}) . _Default . _Coerce;
lpvNextToken :: Lens' ListPlatformVersions (Maybe Text)
lpvNextToken = lens _lpvNextToken (\ s a -> s{_lpvNextToken = a});
lpvMaxRecords :: Lens' ListPlatformVersions (Maybe Natural)
lpvMaxRecords = lens _lpvMaxRecords (\ s a -> s{_lpvMaxRecords = a}) . mapping _Nat;
instance AWSRequest ListPlatformVersions where
type Rs ListPlatformVersions =
ListPlatformVersionsResponse
request = postQuery elasticBeanstalk
response
= receiveXMLWrapper "ListPlatformVersionsResult"
(\ s h x ->
ListPlatformVersionsResponse' <$>
(x .@? "NextToken") <*>
(x .@? "PlatformSummaryList" .!@ mempty >>=
may (parseXMLList "member"))
<*> (pure (fromEnum s)))
instance Hashable ListPlatformVersions where
instance NFData ListPlatformVersions where
instance ToHeaders ListPlatformVersions where
toHeaders = const mempty
instance ToPath ListPlatformVersions where
toPath = const "/"
instance ToQuery ListPlatformVersions where
toQuery ListPlatformVersions'{..}
= mconcat
["Action" =: ("ListPlatformVersions" :: ByteString),
"Version" =: ("2010-12-01" :: ByteString),
"Filters" =:
toQuery (toQueryList "member" <$> _lpvFilters),
"NextToken" =: _lpvNextToken,
"MaxRecords" =: _lpvMaxRecords]
data ListPlatformVersionsResponse = ListPlatformVersionsResponse'
{ _lpvrsNextToken :: !(Maybe Text)
, _lpvrsPlatformSummaryList :: !(Maybe [PlatformSummary])
, _lpvrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listPlatformVersionsResponse
:: Int
-> ListPlatformVersionsResponse
listPlatformVersionsResponse pResponseStatus_ =
ListPlatformVersionsResponse'
{ _lpvrsNextToken = Nothing
, _lpvrsPlatformSummaryList = Nothing
, _lpvrsResponseStatus = pResponseStatus_
}
lpvrsNextToken :: Lens' ListPlatformVersionsResponse (Maybe Text)
lpvrsNextToken = lens _lpvrsNextToken (\ s a -> s{_lpvrsNextToken = a});
lpvrsPlatformSummaryList :: Lens' ListPlatformVersionsResponse [PlatformSummary]
lpvrsPlatformSummaryList = lens _lpvrsPlatformSummaryList (\ s a -> s{_lpvrsPlatformSummaryList = a}) . _Default . _Coerce;
lpvrsResponseStatus :: Lens' ListPlatformVersionsResponse Int
lpvrsResponseStatus = lens _lpvrsResponseStatus (\ s a -> s{_lpvrsResponseStatus = a});
instance NFData ListPlatformVersionsResponse where