{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.FMS.Types
(
fms
, _InternalErrorException
, _InvalidInputException
, _InvalidOperationException
, _ResourceNotFoundException
, _LimitExceededException
, PolicyComplianceStatusType (..)
, SecurityServiceType (..)
, ViolationReason (..)
, ComplianceViolator
, complianceViolator
, cvResourceId
, cvResourceType
, cvViolationReason
, EvaluationResult
, evaluationResult
, erViolatorCount
, erComplianceStatus
, erEvaluationLimitExceeded
, Policy
, policy
, pPolicyId
, pResourceTags
, pPolicyUpdateToken
, pPolicyName
, pSecurityServicePolicyData
, pResourceType
, pExcludeResourceTags
, pRemediationEnabled
, PolicyComplianceDetail
, policyComplianceDetail
, pcdExpiredAt
, pcdPolicyId
, pcdViolators
, pcdEvaluationLimitExceeded
, pcdPolicyOwner
, pcdMemberAccount
, PolicyComplianceStatus
, policyComplianceStatus
, pcsEvaluationResults
, pcsLastUpdated
, pcsPolicyName
, pcsPolicyId
, pcsPolicyOwner
, pcsMemberAccount
, PolicySummary
, policySummary
, psPolicyName
, psRemediationEnabled
, psResourceType
, psPolicyId
, psPolicyARN
, psSecurityServiceType
, ResourceTag
, resourceTag
, rtValue
, rtKey
, SecurityServicePolicyData
, securityServicePolicyData
, sspdManagedServiceData
, sspdType
) where
import Network.AWS.FMS.Types.Product
import Network.AWS.FMS.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
fms :: Service
fms =
Service
{ _svcAbbrev = "FMS"
, _svcSigner = v4
, _svcPrefix = "fms"
, _svcVersion = "2018-01-01"
, _svcEndpoint = defaultEndpoint fms
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "FMS"
, _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
_InternalErrorException :: AsError a => Getting (First ServiceError) a ServiceError
_InternalErrorException = _MatchServiceError fms "InternalErrorException"
_InvalidInputException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidInputException = _MatchServiceError fms "InvalidInputException"
_InvalidOperationException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidOperationException = _MatchServiceError fms "InvalidOperationException"
_ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_ResourceNotFoundException = _MatchServiceError fms "ResourceNotFoundException"
_LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_LimitExceededException = _MatchServiceError fms "LimitExceededException"