{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.CloudWatchEvents.Types
(
cloudWatchEvents
, _ConcurrentModificationException
, _InvalidEventPatternException
, _InternalException
, _ResourceNotFoundException
, _LimitExceededException
, RuleState (..)
, PutEventsRequestEntry
, putEventsRequestEntry
, pereTime
, pereDetailType
, pereResources
, pereSource
, pereDetail
, PutEventsResultEntry
, putEventsResultEntry
, pereErrorCode
, pereErrorMessage
, pereEventId
, PutTargetsResultEntry
, putTargetsResultEntry
, ptreTargetId
, ptreErrorCode
, ptreErrorMessage
, RemoveTargetsResultEntry
, removeTargetsResultEntry
, rtreTargetId
, rtreErrorCode
, rtreErrorMessage
, Rule
, rule
, rEventPattern
, rState
, rARN
, rScheduleExpression
, rName
, rDescription
, rRoleARN
, Target
, target
, tInput
, tInputPath
, tId
, tARN
) where
import Network.AWS.CloudWatchEvents.Types.Product
import Network.AWS.CloudWatchEvents.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
cloudWatchEvents :: Service
cloudWatchEvents =
Service
{ _svcAbbrev = "CloudWatchEvents"
, _svcSigner = v4
, _svcPrefix = "events"
, _svcVersion = "2015-10-07"
, _svcEndpoint = defaultEndpoint cloudWatchEvents
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "CloudWatchEvents"
, _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
_ConcurrentModificationException :: AsError a => Getting (First ServiceError) a ServiceError
_ConcurrentModificationException =
_ServiceError . hasCode "ConcurrentModificationException"
_InvalidEventPatternException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidEventPatternException =
_ServiceError . hasCode "InvalidEventPatternException"
_InternalException :: AsError a => Getting (First ServiceError) a ServiceError
_InternalException = _ServiceError . hasCode "InternalException"
_ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_ResourceNotFoundException =
_ServiceError . hasCode "ResourceNotFoundException"
_LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_LimitExceededException = _ServiceError . hasCode "LimitExceededException"