{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.Comprehend.Types
(
comprehend
, _InvalidRequestException
, _TooManyRequestsException
, _InternalServerException
, _BatchSizeLimitExceededException
, _UnsupportedLanguageException
, _JobNotFoundException
, _InvalidFilterException
, _TextSizeLimitExceededException
, EntityType (..)
, InputFormat (..)
, JobStatus (..)
, LanguageCode (..)
, SentimentType (..)
, BatchDetectDominantLanguageItemResult
, batchDetectDominantLanguageItemResult
, bddlirLanguages
, bddlirIndex
, BatchDetectEntitiesItemResult
, batchDetectEntitiesItemResult
, bdeirEntities
, bdeirIndex
, BatchDetectKeyPhrasesItemResult
, batchDetectKeyPhrasesItemResult
, bdkpirIndex
, bdkpirKeyPhrases
, BatchDetectSentimentItemResult
, batchDetectSentimentItemResult
, bdsirSentiment
, bdsirSentimentScore
, bdsirIndex
, BatchItemError
, batchItemError
, bieErrorCode
, bieErrorMessage
, bieIndex
, DominantLanguage
, dominantLanguage
, dlLanguageCode
, dlScore
, Entity
, entity
, eBeginOffset
, eText
, eScore
, eEndOffset
, eType
, InputDataConfig
, inputDataConfig
, idcInputFormat
, idcS3URI
, KeyPhrase
, keyPhrase
, kpBeginOffset
, kpText
, kpScore
, kpEndOffset
, OutputDataConfig
, outputDataConfig
, odcS3URI
, SentimentScore
, sentimentScore
, ssMixed
, ssNegative
, ssNeutral
, ssPositive
, TopicsDetectionJobFilter
, topicsDetectionJobFilter
, tdjfSubmitTimeAfter
, tdjfSubmitTimeBefore
, tdjfJobName
, tdjfJobStatus
, TopicsDetectionJobProperties
, topicsDetectionJobProperties
, tdjpJobId
, tdjpJobName
, tdjpInputDataConfig
, tdjpEndTime
, tdjpOutputDataConfig
, tdjpNumberOfTopics
, tdjpJobStatus
, tdjpMessage
, tdjpSubmitTime
) where
import Network.AWS.Comprehend.Types.Product
import Network.AWS.Comprehend.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
comprehend :: Service
comprehend =
Service
{ _svcAbbrev = "Comprehend"
, _svcSigner = v4
, _svcPrefix = "comprehend"
, _svcVersion = "2017-11-27"
, _svcEndpoint = defaultEndpoint comprehend
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "Comprehend"
, _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
_InvalidRequestException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidRequestException =
_MatchServiceError comprehend "InvalidRequestException"
_TooManyRequestsException :: AsError a => Getting (First ServiceError) a ServiceError
_TooManyRequestsException =
_MatchServiceError comprehend "TooManyRequestsException"
_InternalServerException :: AsError a => Getting (First ServiceError) a ServiceError
_InternalServerException =
_MatchServiceError comprehend "InternalServerException"
_BatchSizeLimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_BatchSizeLimitExceededException =
_MatchServiceError comprehend "BatchSizeLimitExceededException"
_UnsupportedLanguageException :: AsError a => Getting (First ServiceError) a ServiceError
_UnsupportedLanguageException =
_MatchServiceError comprehend "UnsupportedLanguageException"
_JobNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_JobNotFoundException = _MatchServiceError comprehend "JobNotFoundException"
_InvalidFilterException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidFilterException = _MatchServiceError comprehend "InvalidFilterException"
_TextSizeLimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_TextSizeLimitExceededException =
_MatchServiceError comprehend "TextSizeLimitExceededException"