{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.Polly.Types
(
polly
, _UnsupportedPlsLanguageException
, _InvalidSsmlException
, _InvalidSampleRateException
, _MaxLexiconsNumberExceededException
, _TextLengthExceededException
, _MaxLexemeLengthExceededException
, _InvalidLexiconException
, _ServiceFailureException
, _UnsupportedPlsAlphabetException
, _InvalidNextTokenException
, _MarksNotSupportedForFormatException
, _SsmlMarksNotSupportedForTextTypeException
, _LexiconSizeExceededException
, _LexiconNotFoundException
, Gender (..)
, LanguageCode (..)
, OutputFormat (..)
, SpeechMarkType (..)
, 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 (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
_UnsupportedPlsLanguageException :: AsError a => Getting (First ServiceError) a ServiceError
_UnsupportedPlsLanguageException =
_MatchServiceError polly "UnsupportedPlsLanguageException" . hasStatus 400
_InvalidSsmlException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidSsmlException =
_MatchServiceError polly "InvalidSsmlException" . hasStatus 400
_InvalidSampleRateException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidSampleRateException =
_MatchServiceError polly "InvalidSampleRateException" . hasStatus 400
_MaxLexiconsNumberExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_MaxLexiconsNumberExceededException =
_MatchServiceError polly "MaxLexiconsNumberExceededException" . hasStatus 400
_TextLengthExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_TextLengthExceededException =
_MatchServiceError polly "TextLengthExceededException" . hasStatus 400
_MaxLexemeLengthExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_MaxLexemeLengthExceededException =
_MatchServiceError polly "MaxLexemeLengthExceededException" . hasStatus 400
_InvalidLexiconException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidLexiconException =
_MatchServiceError polly "InvalidLexiconException" . hasStatus 400
_ServiceFailureException :: AsError a => Getting (First ServiceError) a ServiceError
_ServiceFailureException =
_MatchServiceError polly "ServiceFailureException" . hasStatus 500
_UnsupportedPlsAlphabetException :: AsError a => Getting (First ServiceError) a ServiceError
_UnsupportedPlsAlphabetException =
_MatchServiceError polly "UnsupportedPlsAlphabetException" . hasStatus 400
_InvalidNextTokenException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidNextTokenException =
_MatchServiceError polly "InvalidNextTokenException" . hasStatus 400
_MarksNotSupportedForFormatException :: AsError a => Getting (First ServiceError) a ServiceError
_MarksNotSupportedForFormatException =
_MatchServiceError polly "MarksNotSupportedForFormatException" . hasStatus 400
_SsmlMarksNotSupportedForTextTypeException :: AsError a => Getting (First ServiceError) a ServiceError
_SsmlMarksNotSupportedForTextTypeException =
_MatchServiceError polly "SsmlMarksNotSupportedForTextTypeException" .
hasStatus 400
_LexiconSizeExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_LexiconSizeExceededException =
_MatchServiceError polly "LexiconSizeExceededException" . hasStatus 400
_LexiconNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_LexiconNotFoundException =
_MatchServiceError polly "LexiconNotFoundException" . hasStatus 404