module Network.AWS.IoTDataPlane.Types
(
ioTDataPlane
, _InvalidRequestException
, _ConflictException
, _RequestEntityTooLargeException
, _ThrottlingException
, _MethodNotAllowedException
, _InternalFailureException
, _ServiceUnavailableException
, _UnauthorizedException
, _ResourceNotFoundException
, _UnsupportedDocumentEncodingException
) where
import Network.AWS.IoTDataPlane.Types.Product
import Network.AWS.IoTDataPlane.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
ioTDataPlane :: Service
ioTDataPlane =
Service
{ _svcAbbrev = "IoTDataPlane"
, _svcSigner = v4
, _svcPrefix = "data.iot"
, _svcVersion = "2015-05-28"
, _svcEndpoint = defaultEndpoint ioTDataPlane
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "IoTDataPlane"
, _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
_InvalidRequestException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidRequestException =
_ServiceError . hasStatus 400 . hasCode "InvalidRequestException"
_ConflictException :: AsError a => Getting (First ServiceError) a ServiceError
_ConflictException =
_ServiceError . hasStatus 409 . hasCode "ConflictException"
_RequestEntityTooLargeException :: AsError a => Getting (First ServiceError) a ServiceError
_RequestEntityTooLargeException =
_ServiceError . hasStatus 413 . hasCode "RequestEntityTooLargeException"
_ThrottlingException :: AsError a => Getting (First ServiceError) a ServiceError
_ThrottlingException =
_ServiceError . hasStatus 429 . hasCode "ThrottlingException"
_MethodNotAllowedException :: AsError a => Getting (First ServiceError) a ServiceError
_MethodNotAllowedException =
_ServiceError . hasStatus 405 . hasCode "MethodNotAllowedException"
_InternalFailureException :: AsError a => Getting (First ServiceError) a ServiceError
_InternalFailureException =
_ServiceError . hasStatus 500 . hasCode "InternalFailureException"
_ServiceUnavailableException :: AsError a => Getting (First ServiceError) a ServiceError
_ServiceUnavailableException =
_ServiceError . hasStatus 503 . hasCode "ServiceUnavailableException"
_UnauthorizedException :: AsError a => Getting (First ServiceError) a ServiceError
_UnauthorizedException =
_ServiceError . hasStatus 401 . hasCode "UnauthorizedException"
_ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_ResourceNotFoundException =
_ServiceError . hasStatus 404 . hasCode "ResourceNotFoundException"
_UnsupportedDocumentEncodingException :: AsError a => Getting (First ServiceError) a ServiceError
_UnsupportedDocumentEncodingException =
_ServiceError .
hasStatus 415 . hasCode "UnsupportedDocumentEncodingException"