module Network.AWS.Route53.GetHealthCheckLastFailureReason
(
getHealthCheckLastFailureReason
, GetHealthCheckLastFailureReason
, ghclfrHealthCheckId
, getHealthCheckLastFailureReasonResponse
, GetHealthCheckLastFailureReasonResponse
, ghclfrrsResponseStatus
, ghclfrrsHealthCheckObservations
) where
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.Route53.Types
import Network.AWS.Route53.Types.Product
newtype GetHealthCheckLastFailureReason = GetHealthCheckLastFailureReason'
{ _ghclfrHealthCheckId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getHealthCheckLastFailureReason
:: Text
-> GetHealthCheckLastFailureReason
getHealthCheckLastFailureReason pHealthCheckId_ =
GetHealthCheckLastFailureReason'
{ _ghclfrHealthCheckId = pHealthCheckId_
}
ghclfrHealthCheckId :: Lens' GetHealthCheckLastFailureReason Text
ghclfrHealthCheckId = lens _ghclfrHealthCheckId (\ s a -> s{_ghclfrHealthCheckId = a});
instance AWSRequest GetHealthCheckLastFailureReason
where
type Rs GetHealthCheckLastFailureReason =
GetHealthCheckLastFailureReasonResponse
request = get route53
response
= receiveXML
(\ s h x ->
GetHealthCheckLastFailureReasonResponse' <$>
(pure (fromEnum s)) <*>
(x .@? "HealthCheckObservations" .!@ mempty >>=
parseXMLList "HealthCheckObservation"))
instance ToHeaders GetHealthCheckLastFailureReason
where
toHeaders = const mempty
instance ToPath GetHealthCheckLastFailureReason where
toPath GetHealthCheckLastFailureReason'{..}
= mconcat
["/2013-04-01/healthcheck/",
toBS _ghclfrHealthCheckId, "/lastfailurereason"]
instance ToQuery GetHealthCheckLastFailureReason
where
toQuery = const mempty
data GetHealthCheckLastFailureReasonResponse = GetHealthCheckLastFailureReasonResponse'
{ _ghclfrrsResponseStatus :: !Int
, _ghclfrrsHealthCheckObservations :: ![HealthCheckObservation]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getHealthCheckLastFailureReasonResponse
:: Int
-> GetHealthCheckLastFailureReasonResponse
getHealthCheckLastFailureReasonResponse pResponseStatus_ =
GetHealthCheckLastFailureReasonResponse'
{ _ghclfrrsResponseStatus = pResponseStatus_
, _ghclfrrsHealthCheckObservations = mempty
}
ghclfrrsResponseStatus :: Lens' GetHealthCheckLastFailureReasonResponse Int
ghclfrrsResponseStatus = lens _ghclfrrsResponseStatus (\ s a -> s{_ghclfrrsResponseStatus = a});
ghclfrrsHealthCheckObservations :: Lens' GetHealthCheckLastFailureReasonResponse [HealthCheckObservation]
ghclfrrsHealthCheckObservations = lens _ghclfrrsHealthCheckObservations (\ s a -> s{_ghclfrrsHealthCheckObservations = a}) . _Coerce;