{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.Polly.Types
(
polly
, _UnsupportedPlsLanguageException
, _InvalidSsmlException
, _InvalidSampleRateException
, _MaxLexiconsNumberExceededException
, _TextLengthExceededException
, _MaxLexemeLengthExceededException
, _InvalidLexiconException
, _ServiceFailureException
, _UnsupportedPlsAlphabetException
, _InvalidNextTokenException
, _LexiconSizeExceededException
, _LexiconNotFoundException
, Gender (..)
, LanguageCode (..)
, OutputFormat (..)
, TextType (..)
, VoiceId (..)
, Lexicon
, lexicon
, lContent
, lName
, LexiconAttributes
, lexiconAttributes
, laLanguageCode
, laSize
, laLexemesCount
, laLexiconARN
, laAlphabet
, laLastModified
, LexiconDescription
, lexiconDescription
, ldAttributes
, ldName
, Voice
, voice
, vLanguageCode
, vLanguageName
, vGender
, vName
, vId
) where
import Network.AWS.Lens
import Network.AWS.Polly.Types.Product
import Network.AWS.Polly.Types.Sum
import Network.AWS.Prelude
import Network.AWS.Sign.V4
polly :: Service
polly =
Service
{ _svcAbbrev = "Polly"
, _svcSigner = v4
, _svcPrefix = "polly"
, _svcVersion = "2016-06-10"
, _svcEndpoint = defaultEndpoint polly
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "Polly"
, _svcRetry = retry
}
where
retry =
Exponential
{ _retryBase = 5.0e-2
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check e
| 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 (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
_UnsupportedPlsLanguageException :: AsError a => Getting (First ServiceError) a ServiceError
_UnsupportedPlsLanguageException =
_ServiceError . hasStatus 400 . hasCode "UnsupportedPlsLanguageException"
_InvalidSsmlException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidSsmlException =
_ServiceError . hasStatus 400 . hasCode "InvalidSsmlException"
_InvalidSampleRateException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidSampleRateException =
_ServiceError . hasStatus 400 . hasCode "InvalidSampleRateException"
_MaxLexiconsNumberExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_MaxLexiconsNumberExceededException =
_ServiceError .
hasStatus 400 . hasCode "MaxLexiconsNumberExceededException"
_TextLengthExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_TextLengthExceededException =
_ServiceError . hasStatus 400 . hasCode "TextLengthExceededException"
_MaxLexemeLengthExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_MaxLexemeLengthExceededException =
_ServiceError . hasStatus 400 . hasCode "MaxLexemeLengthExceededException"
_InvalidLexiconException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidLexiconException =
_ServiceError . hasStatus 400 . hasCode "InvalidLexiconException"
_ServiceFailureException :: AsError a => Getting (First ServiceError) a ServiceError
_ServiceFailureException =
_ServiceError . hasStatus 500 . hasCode "ServiceFailureException"
_UnsupportedPlsAlphabetException :: AsError a => Getting (First ServiceError) a ServiceError
_UnsupportedPlsAlphabetException =
_ServiceError . hasStatus 400 . hasCode "UnsupportedPlsAlphabetException"
_InvalidNextTokenException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidNextTokenException =
_ServiceError . hasStatus 400 . hasCode "InvalidNextTokenException"
_LexiconSizeExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_LexiconSizeExceededException =
_ServiceError . hasStatus 400 . hasCode "LexiconSizeExceededException"
_LexiconNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_LexiconNotFoundException =
_ServiceError . hasStatus 404 . hasCode "LexiconNotFoundException"