module Network.AWS.ElasticBeanstalk.RetrieveEnvironmentInfo
(
retrieveEnvironmentInfo
, RetrieveEnvironmentInfo
, rEnvironmentName
, rEnvironmentId
, rInfoType
, retrieveEnvironmentInfoResponse
, RetrieveEnvironmentInfoResponse
, reirsEnvironmentInfo
, reirsResponseStatus
) 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 RetrieveEnvironmentInfo = RetrieveEnvironmentInfo'
{ _rEnvironmentName :: !(Maybe Text)
, _rEnvironmentId :: !(Maybe Text)
, _rInfoType :: !EnvironmentInfoType
} deriving (Eq,Read,Show,Data,Typeable,Generic)
retrieveEnvironmentInfo
:: EnvironmentInfoType
-> RetrieveEnvironmentInfo
retrieveEnvironmentInfo pInfoType_ =
RetrieveEnvironmentInfo'
{ _rEnvironmentName = Nothing
, _rEnvironmentId = Nothing
, _rInfoType = pInfoType_
}
rEnvironmentName :: Lens' RetrieveEnvironmentInfo (Maybe Text)
rEnvironmentName = lens _rEnvironmentName (\ s a -> s{_rEnvironmentName = a});
rEnvironmentId :: Lens' RetrieveEnvironmentInfo (Maybe Text)
rEnvironmentId = lens _rEnvironmentId (\ s a -> s{_rEnvironmentId = a});
rInfoType :: Lens' RetrieveEnvironmentInfo EnvironmentInfoType
rInfoType = lens _rInfoType (\ s a -> s{_rInfoType = a});
instance AWSRequest RetrieveEnvironmentInfo where
type Rs RetrieveEnvironmentInfo =
RetrieveEnvironmentInfoResponse
request = postQuery elasticBeanstalk
response
= receiveXMLWrapper "RetrieveEnvironmentInfoResult"
(\ s h x ->
RetrieveEnvironmentInfoResponse' <$>
(x .@? "EnvironmentInfo" .!@ mempty >>=
may (parseXMLList "member"))
<*> (pure (fromEnum s)))
instance Hashable RetrieveEnvironmentInfo
instance ToHeaders RetrieveEnvironmentInfo where
toHeaders = const mempty
instance ToPath RetrieveEnvironmentInfo where
toPath = const "/"
instance ToQuery RetrieveEnvironmentInfo where
toQuery RetrieveEnvironmentInfo'{..}
= mconcat
["Action" =:
("RetrieveEnvironmentInfo" :: ByteString),
"Version" =: ("2010-12-01" :: ByteString),
"EnvironmentName" =: _rEnvironmentName,
"EnvironmentId" =: _rEnvironmentId,
"InfoType" =: _rInfoType]
data RetrieveEnvironmentInfoResponse = RetrieveEnvironmentInfoResponse'
{ _reirsEnvironmentInfo :: !(Maybe [EnvironmentInfoDescription])
, _reirsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
retrieveEnvironmentInfoResponse
:: Int
-> RetrieveEnvironmentInfoResponse
retrieveEnvironmentInfoResponse pResponseStatus_ =
RetrieveEnvironmentInfoResponse'
{ _reirsEnvironmentInfo = Nothing
, _reirsResponseStatus = pResponseStatus_
}
reirsEnvironmentInfo :: Lens' RetrieveEnvironmentInfoResponse [EnvironmentInfoDescription]
reirsEnvironmentInfo = lens _reirsEnvironmentInfo (\ s a -> s{_reirsEnvironmentInfo = a}) . _Default . _Coerce;
reirsResponseStatus :: Lens' RetrieveEnvironmentInfoResponse Int
reirsResponseStatus = lens _reirsResponseStatus (\ s a -> s{_reirsResponseStatus = a});