module Network.AWS.CloudHSM.Types
(
CloudHSM
, _InvalidRequestException
, _CloudHSMServiceException
, _CloudHSMInternalException
, ClientVersion (..)
, CloudHSMObjectState (..)
, HSMStatus (..)
, SubscriptionType (..)
) where
import Network.AWS.CloudHSM.Types.Product
import Network.AWS.CloudHSM.Types.Sum
import Network.AWS.Prelude
import Network.AWS.Sign.V4
data CloudHSM
instance AWSService CloudHSM where
type Sg CloudHSM = V4
service = const svc
where
svc =
Service
{ _svcAbbrev = "CloudHSM"
, _svcPrefix = "cloudhsm"
, _svcVersion = "2014-05-30"
, _svcEndpoint = defaultEndpoint svc
, _svcTimeout = Just 70
, _svcStatus = statusSuccess
, _svcError = parseJSONError
, _svcRetry = retry
}
retry =
Exponential
{ _retryBase = 5.0e-2
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check e
| has (hasCode "ThrottlingException" . hasStatus 400) e =
Just "throttling_exception"
| has (hasCode "Throttling" . hasStatus 400) e = Just "throttling"
| 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 . hasCode "InvalidRequestException"
_CloudHSMServiceException :: AsError a => Getting (First ServiceError) a ServiceError
_CloudHSMServiceException = _ServiceError . hasCode "CloudHsmServiceException"
_CloudHSMInternalException :: AsError a => Getting (First ServiceError) a ServiceError
_CloudHSMInternalException =
_ServiceError . hasCode "CloudHsmInternalException"