{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.LexRuntime.Types
(
lexRuntime
, _NotAcceptableException
, _DependencyFailedException
, _UnsupportedMediaTypeException
, _ConflictException
, _NotFoundException
, _RequestTimeoutException
, _LoopDetectedException
, _InternalFailureException
, _BadGatewayException
, _BadRequestException
, _LimitExceededException
, ContentType (..)
, DialogState (..)
, MessageFormatType (..)
, Button
, button
, bText
, bValue
, GenericAttachment
, genericAttachment
, gaButtons
, gaSubTitle
, gaImageURL
, gaAttachmentLinkURL
, gaTitle
, ResponseCard
, responseCard
, rcGenericAttachments
, rcVersion
, rcContentType
) where
import Network.AWS.Lens
import Network.AWS.LexRuntime.Types.Product
import Network.AWS.LexRuntime.Types.Sum
import Network.AWS.Prelude
import Network.AWS.Sign.V4
lexRuntime :: Service
lexRuntime =
Service
{ _svcAbbrev = "LexRuntime"
, _svcSigner = v4
, _svcPrefix = "runtime.lex"
, _svcVersion = "2016-11-28"
, _svcEndpoint = defaultEndpoint lexRuntime
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "LexRuntime"
, _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
_NotAcceptableException :: AsError a => Getting (First ServiceError) a ServiceError
_NotAcceptableException =
_MatchServiceError lexRuntime "NotAcceptableException" . hasStatus 406
_DependencyFailedException :: AsError a => Getting (First ServiceError) a ServiceError
_DependencyFailedException =
_MatchServiceError lexRuntime "DependencyFailedException" . hasStatus 424
_UnsupportedMediaTypeException :: AsError a => Getting (First ServiceError) a ServiceError
_UnsupportedMediaTypeException =
_MatchServiceError lexRuntime "UnsupportedMediaTypeException" . hasStatus 415
_ConflictException :: AsError a => Getting (First ServiceError) a ServiceError
_ConflictException =
_MatchServiceError lexRuntime "ConflictException" . hasStatus 409
_NotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_NotFoundException =
_MatchServiceError lexRuntime "NotFoundException" . hasStatus 404
_RequestTimeoutException :: AsError a => Getting (First ServiceError) a ServiceError
_RequestTimeoutException =
_MatchServiceError lexRuntime "RequestTimeoutException" . hasStatus 408
_LoopDetectedException :: AsError a => Getting (First ServiceError) a ServiceError
_LoopDetectedException =
_MatchServiceError lexRuntime "LoopDetectedException" . hasStatus 508
_InternalFailureException :: AsError a => Getting (First ServiceError) a ServiceError
_InternalFailureException =
_MatchServiceError lexRuntime "InternalFailureException" . hasStatus 500
_BadGatewayException :: AsError a => Getting (First ServiceError) a ServiceError
_BadGatewayException =
_MatchServiceError lexRuntime "BadGatewayException" . hasStatus 502
_BadRequestException :: AsError a => Getting (First ServiceError) a ServiceError
_BadRequestException =
_MatchServiceError lexRuntime "BadRequestException" . hasStatus 400
_LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_LimitExceededException =
_MatchServiceError lexRuntime "LimitExceededException" . hasStatus 429