{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.DynamoDBStreams.Types
(
dynamoDBStreams
, _ExpiredIteratorException
, _InternalServerError
, _TrimmedDataAccessException
, _ResourceNotFoundException
, _LimitExceededException
, KeyType (..)
, OperationType (..)
, ShardIteratorType (..)
, StreamStatus (..)
, StreamViewType (..)
, AttributeValue
, attributeValue
, avL
, avNS
, avM
, avNULL
, avN
, avBS
, avB
, avSS
, avS
, avBOOL
, Identity
, identity
, iPrincipalId
, iType
, KeySchemaElement
, keySchemaElement
, kseAttributeName
, kseKeyType
, Record
, record
, rUserIdentity
, rEventVersion
, rDynamodb
, rAwsRegion
, rEventName
, rEventSource
, rEventId
, SequenceNumberRange
, sequenceNumberRange
, snrStartingSequenceNumber
, snrEndingSequenceNumber
, Shard
, shard
, sParentShardId
, sSequenceNumberRange
, sShardId
, Stream
, stream
, sStreamLabel
, sStreamARN
, sTableName
, StreamDescription
, streamDescription
, sdLastEvaluatedShardId
, sdStreamLabel
, sdStreamStatus
, sdKeySchema
, sdStreamViewType
, sdStreamARN
, sdShards
, sdTableName
, sdCreationRequestDateTime
, StreamRecord
, streamRecord
, srSizeBytes
, srSequenceNumber
, srApproximateCreationDateTime
, srStreamViewType
, srKeys
, srOldImage
, srNewImage
) where
import Network.AWS.DynamoDBStreams.Types.Product
import Network.AWS.DynamoDBStreams.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
dynamoDBStreams :: Service
dynamoDBStreams =
Service
{ _svcAbbrev = "DynamoDBStreams"
, _svcSigner = v4
, _svcPrefix = "streams.dynamodb"
, _svcVersion = "2012-08-10"
, _svcEndpoint = defaultEndpoint dynamoDBStreams
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "DynamoDBStreams"
, _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
_ExpiredIteratorException :: AsError a => Getting (First ServiceError) a ServiceError
_ExpiredIteratorException =
_MatchServiceError dynamoDBStreams "ExpiredIteratorException"
_InternalServerError :: AsError a => Getting (First ServiceError) a ServiceError
_InternalServerError = _MatchServiceError dynamoDBStreams "InternalServerError"
_TrimmedDataAccessException :: AsError a => Getting (First ServiceError) a ServiceError
_TrimmedDataAccessException =
_MatchServiceError dynamoDBStreams "TrimmedDataAccessException"
_ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_ResourceNotFoundException =
_MatchServiceError dynamoDBStreams "ResourceNotFoundException"
_LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_LimitExceededException =
_MatchServiceError dynamoDBStreams "LimitExceededException"