{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.Shield.Types
(
shield
, _InvalidResourceException
, _InvalidParameterException
, _LimitsExceededException
, _InternalErrorException
, _ResourceAlreadyExistsException
, _OptimisticLockException
, _InvalidOperationException
, _LockedSubscriptionException
, _ResourceNotFoundException
, AttackLayer (..)
, AttackPropertyIdentifier (..)
, SubResourceType (..)
, SubscriptionState (..)
, Unit (..)
, AttackDetail
, attackDetail
, adAttackId
, adStartTime
, adSubResources
, adMitigations
, adAttackProperties
, adAttackCounters
, adResourceARN
, adEndTime
, AttackProperty
, attackProperty
, apAttackLayer
, apTopContributors
, apAttackPropertyIdentifier
, apTotal
, apUnit
, AttackSummary
, attackSummary
, asAttackVectors
, asAttackId
, asStartTime
, asResourceARN
, asEndTime
, AttackVectorDescription
, attackVectorDescription
, avdVectorType
, Contributor
, contributor
, cValue
, cName
, Mitigation
, mitigation
, mMitigationName
, Protection
, protection
, pResourceARN
, pName
, pId
, SubResourceSummary
, subResourceSummary
, srsCounters
, srsAttackVectors
, srsId
, srsType
, Subscription
, subscription
, sTimeCommitmentInSeconds
, sStartTime
, SummarizedAttackVector
, summarizedAttackVector
, savVectorCounters
, savVectorType
, SummarizedCounter
, summarizedCounter
, scMax
, scAverage
, scN
, scName
, scSum
, scUnit
, TimeRange
, timeRange
, trFromInclusive
, trToExclusive
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Shield.Types.Product
import Network.AWS.Shield.Types.Sum
import Network.AWS.Sign.V4
shield :: Service
shield =
Service
{ _svcAbbrev = "Shield"
, _svcSigner = v4
, _svcPrefix = "shield"
, _svcVersion = "2016-06-02"
, _svcEndpoint = defaultEndpoint shield
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "Shield"
, _svcRetry = retry
}
where
retry =
Exponential
{ _retryBase = 5.0e-2
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check e
| has (hasCode "ThrottledException" . hasStatus 400) e =
Just "throttled_exception"
| 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 (hasCode "RequestThrottledException" . hasStatus 400) e =
Just "request_throttled_exception"
| 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
_InvalidResourceException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidResourceException = _MatchServiceError shield "InvalidResourceException"
_InvalidParameterException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidParameterException =
_MatchServiceError shield "InvalidParameterException"
_LimitsExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_LimitsExceededException = _MatchServiceError shield "LimitsExceededException"
_InternalErrorException :: AsError a => Getting (First ServiceError) a ServiceError
_InternalErrorException = _MatchServiceError shield "InternalErrorException"
_ResourceAlreadyExistsException :: AsError a => Getting (First ServiceError) a ServiceError
_ResourceAlreadyExistsException =
_MatchServiceError shield "ResourceAlreadyExistsException"
_OptimisticLockException :: AsError a => Getting (First ServiceError) a ServiceError
_OptimisticLockException = _MatchServiceError shield "OptimisticLockException"
_InvalidOperationException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidOperationException =
_MatchServiceError shield "InvalidOperationException"
_LockedSubscriptionException :: AsError a => Getting (First ServiceError) a ServiceError
_LockedSubscriptionException =
_MatchServiceError shield "LockedSubscriptionException"
_ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_ResourceNotFoundException =
_MatchServiceError shield "ResourceNotFoundException"