{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.SDB.Types
(
sdb
, _InvalidNumberValueTests
, _NoSuchDomain
, _NumberSubmittedItemsExceeded
, _AttributeDoesNotExist
, _NumberDomainAttributesExceeded
, _DuplicateItemName
, _MissingParameter
, _InvalidNextToken
, _InvalidParameterValue
, _NumberItemAttributesExceeded
, _RequestTimeout
, _TooManyRequestedAttributes
, _InvalidNumberPredicates
, _NumberDomainsExceeded
, _NumberSubmittedAttributesExceeded
, _NumberDomainBytesExceeded
, _InvalidQueryExpression
, Attribute
, attribute
, aAlternateValueEncoding
, aAlternateNameEncoding
, aName
, aValue
, DeletableItem
, deletableItem
, diAttributes
, diName
, Item
, item
, iAlternateNameEncoding
, iName
, iAttributes
, ReplaceableAttribute
, replaceableAttribute
, raReplace
, raName
, raValue
, ReplaceableItem
, replaceableItem
, riName
, riAttributes
, UpdateCondition
, updateCondition
, ucExists
, ucValue
, ucName
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.SDB.Types.Product
import Network.AWS.SDB.Types.Sum
import Network.AWS.Sign.V2
sdb :: Service
sdb =
Service
{ _svcAbbrev = "SDB"
, _svcSigner = v2
, _svcPrefix = "sdb"
, _svcVersion = "2009-04-15"
, _svcEndpoint = defaultEndpoint sdb
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseXMLError "SDB"
, _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
_InvalidNumberValueTests :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidNumberValueTests =
_MatchServiceError sdb "InvalidNumberValueTests" . hasStatus 400
_NoSuchDomain :: AsError a => Getting (First ServiceError) a ServiceError
_NoSuchDomain = _MatchServiceError sdb "NoSuchDomain" . hasStatus 400
_NumberSubmittedItemsExceeded :: AsError a => Getting (First ServiceError) a ServiceError
_NumberSubmittedItemsExceeded =
_MatchServiceError sdb "NumberSubmittedItemsExceeded" . hasStatus 409
_AttributeDoesNotExist :: AsError a => Getting (First ServiceError) a ServiceError
_AttributeDoesNotExist =
_MatchServiceError sdb "AttributeDoesNotExist" . hasStatus 404
_NumberDomainAttributesExceeded :: AsError a => Getting (First ServiceError) a ServiceError
_NumberDomainAttributesExceeded =
_MatchServiceError sdb "NumberDomainAttributesExceeded" . hasStatus 409
_DuplicateItemName :: AsError a => Getting (First ServiceError) a ServiceError
_DuplicateItemName = _MatchServiceError sdb "DuplicateItemName" . hasStatus 400
_MissingParameter :: AsError a => Getting (First ServiceError) a ServiceError
_MissingParameter = _MatchServiceError sdb "MissingParameter" . hasStatus 400
_InvalidNextToken :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidNextToken = _MatchServiceError sdb "InvalidNextToken" . hasStatus 400
_InvalidParameterValue :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidParameterValue =
_MatchServiceError sdb "InvalidParameterValue" . hasStatus 400
_NumberItemAttributesExceeded :: AsError a => Getting (First ServiceError) a ServiceError
_NumberItemAttributesExceeded =
_MatchServiceError sdb "NumberItemAttributesExceeded" . hasStatus 409
_RequestTimeout :: AsError a => Getting (First ServiceError) a ServiceError
_RequestTimeout = _MatchServiceError sdb "RequestTimeout" . hasStatus 408
_TooManyRequestedAttributes :: AsError a => Getting (First ServiceError) a ServiceError
_TooManyRequestedAttributes =
_MatchServiceError sdb "TooManyRequestedAttributes" . hasStatus 400
_InvalidNumberPredicates :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidNumberPredicates =
_MatchServiceError sdb "InvalidNumberPredicates" . hasStatus 400
_NumberDomainsExceeded :: AsError a => Getting (First ServiceError) a ServiceError
_NumberDomainsExceeded =
_MatchServiceError sdb "NumberDomainsExceeded" . hasStatus 409
_NumberSubmittedAttributesExceeded :: AsError a => Getting (First ServiceError) a ServiceError
_NumberSubmittedAttributesExceeded =
_MatchServiceError sdb "NumberSubmittedAttributesExceeded" . hasStatus 409
_NumberDomainBytesExceeded :: AsError a => Getting (First ServiceError) a ServiceError
_NumberDomainBytesExceeded =
_MatchServiceError sdb "NumberDomainBytesExceeded" . hasStatus 409
_InvalidQueryExpression :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidQueryExpression =
_MatchServiceError sdb "InvalidQueryExpression" . hasStatus 400