{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.SQS.Types
(
sqs
, _InvalidBatchEntryId
, _TooManyEntriesInBatchRequest
, _QueueDeletedRecently
, _QueueDoesNotExist
, _InvalidAttributeName
, _UnsupportedOperation
, _InvalidMessageContents
, _BatchRequestTooLong
, _OverLimit
, _QueueNameExists
, _PurgeQueueInProgress
, _InvalidIdFormat
, _ReceiptHandleIsInvalid
, _EmptyBatchRequest
, _BatchEntryIdsNotDistinct
, _MessageNotInflight
, MessageAttribute (..)
, QueueAttributeName (..)
, BatchResultErrorEntry
, batchResultErrorEntry
, breeMessage
, breeId
, breeSenderFault
, breeCode
, ChangeMessageVisibilityBatchRequestEntry
, changeMessageVisibilityBatchRequestEntry
, cVisibilityTimeout
, cId
, cReceiptHandle
, ChangeMessageVisibilityBatchResultEntry
, changeMessageVisibilityBatchResultEntry
, cmvbreId
, DeleteMessageBatchRequestEntry
, deleteMessageBatchRequestEntry
, dmbreId
, dmbreReceiptHandle
, DeleteMessageBatchResultEntry
, deleteMessageBatchResultEntry
, dId
, Message
, message
, mMessageAttributes
, mMD5OfBody
, mBody
, mAttributes
, mReceiptHandle
, mMessageId
, mMD5OfMessageAttributes
, MessageAttributeValue
, messageAttributeValue
, mavBinaryValue
, mavStringListValues
, mavStringValue
, mavBinaryListValues
, mavDataType
, SendMessageBatchRequestEntry
, sendMessageBatchRequestEntry
, sMessageAttributes
, sDelaySeconds
, sMessageDeduplicationId
, sMessageGroupId
, sId
, sMessageBody
, SendMessageBatchResultEntry
, sendMessageBatchResultEntry
, smbreSequenceNumber
, smbreMD5OfMessageAttributes
, smbreId
, smbreMessageId
, smbreMD5OfMessageBody
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
import Network.AWS.SQS.Types.Product
import Network.AWS.SQS.Types.Sum
sqs :: Service
sqs =
Service
{ _svcAbbrev = "SQS"
, _svcSigner = v4
, _svcPrefix = "sqs"
, _svcVersion = "2012-11-05"
, _svcEndpoint = defaultEndpoint sqs
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseXMLError "SQS"
, _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 (hasCode "RequestThrottled" . hasStatus 403) e =
Just "request_limit_exceeded"
| 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
_InvalidBatchEntryId :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidBatchEntryId =
_MatchServiceError sqs "AWS.SimpleQueueService.InvalidBatchEntryId" .
hasStatus 400
_TooManyEntriesInBatchRequest :: AsError a => Getting (First ServiceError) a ServiceError
_TooManyEntriesInBatchRequest =
_MatchServiceError sqs "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" .
hasStatus 400
_QueueDeletedRecently :: AsError a => Getting (First ServiceError) a ServiceError
_QueueDeletedRecently =
_MatchServiceError sqs "AWS.SimpleQueueService.QueueDeletedRecently" .
hasStatus 400
_QueueDoesNotExist :: AsError a => Getting (First ServiceError) a ServiceError
_QueueDoesNotExist =
_MatchServiceError sqs "AWS.SimpleQueueService.NonExistentQueue" .
hasStatus 400
_InvalidAttributeName :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidAttributeName = _MatchServiceError sqs "InvalidAttributeName"
_UnsupportedOperation :: AsError a => Getting (First ServiceError) a ServiceError
_UnsupportedOperation =
_MatchServiceError sqs "AWS.SimpleQueueService.UnsupportedOperation" .
hasStatus 400
_InvalidMessageContents :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidMessageContents = _MatchServiceError sqs "InvalidMessageContents"
_BatchRequestTooLong :: AsError a => Getting (First ServiceError) a ServiceError
_BatchRequestTooLong =
_MatchServiceError sqs "AWS.SimpleQueueService.BatchRequestTooLong" .
hasStatus 400
_OverLimit :: AsError a => Getting (First ServiceError) a ServiceError
_OverLimit = _MatchServiceError sqs "OverLimit" . hasStatus 403
_QueueNameExists :: AsError a => Getting (First ServiceError) a ServiceError
_QueueNameExists = _MatchServiceError sqs "QueueAlreadyExists" . hasStatus 400
_PurgeQueueInProgress :: AsError a => Getting (First ServiceError) a ServiceError
_PurgeQueueInProgress =
_MatchServiceError sqs "AWS.SimpleQueueService.PurgeQueueInProgress" .
hasStatus 403
_InvalidIdFormat :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidIdFormat = _MatchServiceError sqs "InvalidIdFormat"
_ReceiptHandleIsInvalid :: AsError a => Getting (First ServiceError) a ServiceError
_ReceiptHandleIsInvalid = _MatchServiceError sqs "ReceiptHandleIsInvalid"
_EmptyBatchRequest :: AsError a => Getting (First ServiceError) a ServiceError
_EmptyBatchRequest =
_MatchServiceError sqs "AWS.SimpleQueueService.EmptyBatchRequest" .
hasStatus 400
_BatchEntryIdsNotDistinct :: AsError a => Getting (First ServiceError) a ServiceError
_BatchEntryIdsNotDistinct =
_MatchServiceError sqs "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" .
hasStatus 400
_MessageNotInflight :: AsError a => Getting (First ServiceError) a ServiceError
_MessageNotInflight =
_MatchServiceError sqs "AWS.SimpleQueueService.MessageNotInflight" .
hasStatus 400