{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.AWSHealth.Types
(
awsHealth
, _InvalidPaginationToken
, _UnsupportedLocale
, EntityStatusCode (..)
, EventAggregateField (..)
, EventStatusCode (..)
, EventTypeCategory (..)
, AffectedEntity
, affectedEntity
, aeLastUpdatedTime
, aeEntityValue
, aeAwsAccountId
, aeEventARN
, aeEntityARN
, aeTags
, aeStatusCode
, DateTimeRange
, dateTimeRange
, dtrTo
, dtrFrom
, EntityAggregate
, entityAggregate
, eCount
, eEventARN
, EntityFilter
, entityFilter
, eStatusCodes
, eEntityARNs
, eEntityValues
, eTags
, eLastUpdatedTimes
, eEventARNs
, Event
, event
, eLastUpdatedTime
, eArn
, eService
, eStartTime
, eEventTypeCode
, eEventTypeCategory
, eAvailabilityZone
, eEndTime
, eRegion
, eStatusCode
, EventAggregate
, eventAggregate
, eaCount
, eaAggregateValue
, EventDescription
, eventDescription
, edLatestDescription
, EventDetails
, eventDetails
, edEvent
, edEventDescription
, edEventMetadata
, EventDetailsErrorItem
, eventDetailsErrorItem
, edeiEventARN
, edeiErrorName
, edeiErrorMessage
, EventFilter
, eventFilter
, efEventARNs
, efEventTypeCategories
, efEventTypeCodes
, efRegions
, efEventStatusCodes
, efEndTimes
, efAvailabilityZones
, efEntityARNs
, efEntityValues
, efStartTimes
, efServices
, efTags
, efLastUpdatedTimes
, EventType
, eventType
, etService
, etCategory
, etCode
, EventTypeFilter
, eventTypeFilter
, etfEventTypeCategories
, etfEventTypeCodes
, etfServices
) where
import Network.AWS.AWSHealth.Types.Product
import Network.AWS.AWSHealth.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
awsHealth :: Service
awsHealth =
Service
{ _svcAbbrev = "AWSHealth"
, _svcSigner = v4
, _svcPrefix = "health"
, _svcVersion = "2016-08-04"
, _svcEndpoint = defaultEndpoint awsHealth
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "AWSHealth"
, _svcRetry = retry
}
where
retry =
Exponential
{ _retryBase = 5.0e-2
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check e
| has (hasStatus 429) e = Just "too_many_requests"
| has (hasCode "ThrottlingException" . hasStatus 400) e =
Just "throttling_exception"
| has (hasCode "Throttling" . hasStatus 400) e = Just "throttling"
| has (hasStatus 504) e = Just "gateway_timeout"
| has (hasStatus 502) e = Just "bad_gateway"
| has (hasStatus 503) e = Just "service_unavailable"
| has (hasStatus 500) e = Just "general_server_error"
| has (hasStatus 509) e = Just "limit_exceeded"
| otherwise = Nothing
_InvalidPaginationToken :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidPaginationToken = _ServiceError . hasCode "InvalidPaginationToken"
_UnsupportedLocale :: AsError a => Getting (First ServiceError) a ServiceError
_UnsupportedLocale = _ServiceError . hasCode "UnsupportedLocale"