{-# 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.ElasticBeanstalk.DescribeApplicationVersions
(
describeApplicationVersions
, DescribeApplicationVersions
, dVersionLabels
, dNextToken
, dMaxRecords
, dApplicationName
, describeApplicationVersionsResponse
, DescribeApplicationVersionsResponse
, davrsApplicationVersions
, davrsNextToken
, davrsResponseStatus
) 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 DescribeApplicationVersions = DescribeApplicationVersions'
{ _dVersionLabels :: !(Maybe [Text])
, _dNextToken :: !(Maybe Text)
, _dMaxRecords :: !(Maybe Nat)
, _dApplicationName :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeApplicationVersions
:: DescribeApplicationVersions
describeApplicationVersions =
DescribeApplicationVersions'
{ _dVersionLabels = Nothing
, _dNextToken = Nothing
, _dMaxRecords = Nothing
, _dApplicationName = Nothing
}
dVersionLabels :: Lens' DescribeApplicationVersions [Text]
dVersionLabels = lens _dVersionLabels (\ s a -> s{_dVersionLabels = a}) . _Default . _Coerce
dNextToken :: Lens' DescribeApplicationVersions (Maybe Text)
dNextToken = lens _dNextToken (\ s a -> s{_dNextToken = a})
dMaxRecords :: Lens' DescribeApplicationVersions (Maybe Natural)
dMaxRecords = lens _dMaxRecords (\ s a -> s{_dMaxRecords = a}) . mapping _Nat
dApplicationName :: Lens' DescribeApplicationVersions (Maybe Text)
dApplicationName = lens _dApplicationName (\ s a -> s{_dApplicationName = a})
instance AWSRequest DescribeApplicationVersions where
type Rs DescribeApplicationVersions =
DescribeApplicationVersionsResponse
request = postQuery elasticBeanstalk
response
= receiveXMLWrapper
"DescribeApplicationVersionsResult"
(\ s h x ->
DescribeApplicationVersionsResponse' <$>
(x .@? "ApplicationVersions" .!@ mempty >>=
may (parseXMLList "member"))
<*> (x .@? "NextToken")
<*> (pure (fromEnum s)))
instance Hashable DescribeApplicationVersions where
instance NFData DescribeApplicationVersions where
instance ToHeaders DescribeApplicationVersions where
toHeaders = const mempty
instance ToPath DescribeApplicationVersions where
toPath = const "/"
instance ToQuery DescribeApplicationVersions where
toQuery DescribeApplicationVersions'{..}
= mconcat
["Action" =:
("DescribeApplicationVersions" :: ByteString),
"Version" =: ("2010-12-01" :: ByteString),
"VersionLabels" =:
toQuery (toQueryList "member" <$> _dVersionLabels),
"NextToken" =: _dNextToken,
"MaxRecords" =: _dMaxRecords,
"ApplicationName" =: _dApplicationName]
data DescribeApplicationVersionsResponse = DescribeApplicationVersionsResponse'
{ _davrsApplicationVersions :: !(Maybe [ApplicationVersionDescription])
, _davrsNextToken :: !(Maybe Text)
, _davrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeApplicationVersionsResponse
:: Int
-> DescribeApplicationVersionsResponse
describeApplicationVersionsResponse pResponseStatus_ =
DescribeApplicationVersionsResponse'
{ _davrsApplicationVersions = Nothing
, _davrsNextToken = Nothing
, _davrsResponseStatus = pResponseStatus_
}
davrsApplicationVersions :: Lens' DescribeApplicationVersionsResponse [ApplicationVersionDescription]
davrsApplicationVersions = lens _davrsApplicationVersions (\ s a -> s{_davrsApplicationVersions = a}) . _Default . _Coerce
davrsNextToken :: Lens' DescribeApplicationVersionsResponse (Maybe Text)
davrsNextToken = lens _davrsNextToken (\ s a -> s{_davrsNextToken = a})
davrsResponseStatus :: Lens' DescribeApplicationVersionsResponse Int
davrsResponseStatus = lens _davrsResponseStatus (\ s a -> s{_davrsResponseStatus = a})
instance NFData DescribeApplicationVersionsResponse
where