module Network.AWS.CostAndUsageReport.Types
(
costAndUsageReport
, _ValidationException
, _InternalErrorException
, _DuplicateReportNameException
, _ReportLimitReachedException
, AWSRegion (..)
, AdditionalArtifact (..)
, CompressionFormat (..)
, ReportFormat (..)
, SchemaElement (..)
, TimeUnit (..)
, ReportDefinition
, reportDefinition
, rdAdditionalArtifacts
, rdReportName
, rdTimeUnit
, rdFormat
, rdCompression
, rdAdditionalSchemaElements
, rdS3Bucket
, rdS3Prefix
, rdS3Region
) where
import Network.AWS.CostAndUsageReport.Types.Product
import Network.AWS.CostAndUsageReport.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
costAndUsageReport :: Service
costAndUsageReport =
Service
{ _svcAbbrev = "CostAndUsageReport"
, _svcSigner = v4
, _svcPrefix = "cur"
, _svcVersion = "2017-01-06"
, _svcEndpoint = defaultEndpoint costAndUsageReport
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "CostAndUsageReport"
, _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 (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
_ValidationException :: AsError a => Getting (First ServiceError) a ServiceError
_ValidationException =
_MatchServiceError costAndUsageReport "ValidationException"
_InternalErrorException :: AsError a => Getting (First ServiceError) a ServiceError
_InternalErrorException =
_MatchServiceError costAndUsageReport "InternalErrorException"
_DuplicateReportNameException :: AsError a => Getting (First ServiceError) a ServiceError
_DuplicateReportNameException =
_MatchServiceError costAndUsageReport "DuplicateReportNameException"
_ReportLimitReachedException :: AsError a => Getting (First ServiceError) a ServiceError
_ReportLimitReachedException =
_MatchServiceError costAndUsageReport "ReportLimitReachedException"