{-# 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.DescribeEnvironmentHealth
(
describeEnvironmentHealth
, DescribeEnvironmentHealth
, dehEnvironmentName
, dehAttributeNames
, dehEnvironmentId
, describeEnvironmentHealthResponse
, DescribeEnvironmentHealthResponse
, dehrsStatus
, dehrsCauses
, dehrsApplicationMetrics
, dehrsColor
, dehrsEnvironmentName
, dehrsHealthStatus
, dehrsInstancesHealth
, dehrsRefreshedAt
, dehrsResponseStatus
) 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 DescribeEnvironmentHealth = DescribeEnvironmentHealth'
{ _dehEnvironmentName :: !(Maybe Text)
, _dehAttributeNames :: !(Maybe [EnvironmentHealthAttribute])
, _dehEnvironmentId :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeEnvironmentHealth
:: DescribeEnvironmentHealth
describeEnvironmentHealth =
DescribeEnvironmentHealth'
{ _dehEnvironmentName = Nothing
, _dehAttributeNames = Nothing
, _dehEnvironmentId = Nothing
}
dehEnvironmentName :: Lens' DescribeEnvironmentHealth (Maybe Text)
dehEnvironmentName = lens _dehEnvironmentName (\ s a -> s{_dehEnvironmentName = a})
dehAttributeNames :: Lens' DescribeEnvironmentHealth [EnvironmentHealthAttribute]
dehAttributeNames = lens _dehAttributeNames (\ s a -> s{_dehAttributeNames = a}) . _Default . _Coerce
dehEnvironmentId :: Lens' DescribeEnvironmentHealth (Maybe Text)
dehEnvironmentId = lens _dehEnvironmentId (\ s a -> s{_dehEnvironmentId = a})
instance AWSRequest DescribeEnvironmentHealth where
type Rs DescribeEnvironmentHealth =
DescribeEnvironmentHealthResponse
request = postQuery elasticBeanstalk
response
= receiveXMLWrapper "DescribeEnvironmentHealthResult"
(\ s h x ->
DescribeEnvironmentHealthResponse' <$>
(x .@? "Status") <*>
(x .@? "Causes" .!@ mempty >>=
may (parseXMLList "member"))
<*> (x .@? "ApplicationMetrics")
<*> (x .@? "Color")
<*> (x .@? "EnvironmentName")
<*> (x .@? "HealthStatus")
<*> (x .@? "InstancesHealth")
<*> (x .@? "RefreshedAt")
<*> (pure (fromEnum s)))
instance Hashable DescribeEnvironmentHealth where
instance NFData DescribeEnvironmentHealth where
instance ToHeaders DescribeEnvironmentHealth where
toHeaders = const mempty
instance ToPath DescribeEnvironmentHealth where
toPath = const "/"
instance ToQuery DescribeEnvironmentHealth where
toQuery DescribeEnvironmentHealth'{..}
= mconcat
["Action" =:
("DescribeEnvironmentHealth" :: ByteString),
"Version" =: ("2010-12-01" :: ByteString),
"EnvironmentName" =: _dehEnvironmentName,
"AttributeNames" =:
toQuery
(toQueryList "member" <$> _dehAttributeNames),
"EnvironmentId" =: _dehEnvironmentId]
data DescribeEnvironmentHealthResponse = DescribeEnvironmentHealthResponse'
{ _dehrsStatus :: !(Maybe EnvironmentHealth)
, _dehrsCauses :: !(Maybe [Text])
, _dehrsApplicationMetrics :: !(Maybe ApplicationMetrics)
, _dehrsColor :: !(Maybe Text)
, _dehrsEnvironmentName :: !(Maybe Text)
, _dehrsHealthStatus :: !(Maybe Text)
, _dehrsInstancesHealth :: !(Maybe InstanceHealthSummary)
, _dehrsRefreshedAt :: !(Maybe ISO8601)
, _dehrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeEnvironmentHealthResponse
:: Int
-> DescribeEnvironmentHealthResponse
describeEnvironmentHealthResponse pResponseStatus_ =
DescribeEnvironmentHealthResponse'
{ _dehrsStatus = Nothing
, _dehrsCauses = Nothing
, _dehrsApplicationMetrics = Nothing
, _dehrsColor = Nothing
, _dehrsEnvironmentName = Nothing
, _dehrsHealthStatus = Nothing
, _dehrsInstancesHealth = Nothing
, _dehrsRefreshedAt = Nothing
, _dehrsResponseStatus = pResponseStatus_
}
dehrsStatus :: Lens' DescribeEnvironmentHealthResponse (Maybe EnvironmentHealth)
dehrsStatus = lens _dehrsStatus (\ s a -> s{_dehrsStatus = a})
dehrsCauses :: Lens' DescribeEnvironmentHealthResponse [Text]
dehrsCauses = lens _dehrsCauses (\ s a -> s{_dehrsCauses = a}) . _Default . _Coerce
dehrsApplicationMetrics :: Lens' DescribeEnvironmentHealthResponse (Maybe ApplicationMetrics)
dehrsApplicationMetrics = lens _dehrsApplicationMetrics (\ s a -> s{_dehrsApplicationMetrics = a})
dehrsColor :: Lens' DescribeEnvironmentHealthResponse (Maybe Text)
dehrsColor = lens _dehrsColor (\ s a -> s{_dehrsColor = a})
dehrsEnvironmentName :: Lens' DescribeEnvironmentHealthResponse (Maybe Text)
dehrsEnvironmentName = lens _dehrsEnvironmentName (\ s a -> s{_dehrsEnvironmentName = a})
dehrsHealthStatus :: Lens' DescribeEnvironmentHealthResponse (Maybe Text)
dehrsHealthStatus = lens _dehrsHealthStatus (\ s a -> s{_dehrsHealthStatus = a})
dehrsInstancesHealth :: Lens' DescribeEnvironmentHealthResponse (Maybe InstanceHealthSummary)
dehrsInstancesHealth = lens _dehrsInstancesHealth (\ s a -> s{_dehrsInstancesHealth = a})
dehrsRefreshedAt :: Lens' DescribeEnvironmentHealthResponse (Maybe UTCTime)
dehrsRefreshedAt = lens _dehrsRefreshedAt (\ s a -> s{_dehrsRefreshedAt = a}) . mapping _Time
dehrsResponseStatus :: Lens' DescribeEnvironmentHealthResponse Int
dehrsResponseStatus = lens _dehrsResponseStatus (\ s a -> s{_dehrsResponseStatus = a})
instance NFData DescribeEnvironmentHealthResponse
where