{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.MarketplaceMetering.Types
(
marketplaceMetering
, _InvalidEndpointRegionException
, _InvalidProductCodeException
, _InvalidUsageDimensionException
, _DuplicateRequestException
, _TimestampOutOfBoundsException
, _ThrottlingException
, _InternalServiceErrorException
, _InvalidTokenException
, _ExpiredTokenException
, _InvalidCustomerIdentifierException
, UsageRecordResultStatus (..)
, UsageRecord
, usageRecord
, urTimestamp
, urCustomerIdentifier
, urDimension
, urQuantity
, UsageRecordResult
, usageRecordResult
, urrStatus
, urrUsageRecord
, urrMeteringRecordId
) where
import Network.AWS.Lens
import Network.AWS.MarketplaceMetering.Types.Product
import Network.AWS.MarketplaceMetering.Types.Sum
import Network.AWS.Prelude
import Network.AWS.Sign.V4
marketplaceMetering :: Service
marketplaceMetering =
Service
{ _svcAbbrev = "MarketplaceMetering"
, _svcSigner = v4
, _svcPrefix = "metering.marketplace"
, _svcVersion = "2016-01-14"
, _svcEndpoint = defaultEndpoint marketplaceMetering
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "MarketplaceMetering"
, _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
_InvalidEndpointRegionException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidEndpointRegionException =
_MatchServiceError marketplaceMetering "InvalidEndpointRegionException"
_InvalidProductCodeException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidProductCodeException =
_MatchServiceError marketplaceMetering "InvalidProductCodeException"
_InvalidUsageDimensionException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidUsageDimensionException =
_MatchServiceError marketplaceMetering "InvalidUsageDimensionException"
_DuplicateRequestException :: AsError a => Getting (First ServiceError) a ServiceError
_DuplicateRequestException =
_MatchServiceError marketplaceMetering "DuplicateRequestException"
_TimestampOutOfBoundsException :: AsError a => Getting (First ServiceError) a ServiceError
_TimestampOutOfBoundsException =
_MatchServiceError marketplaceMetering "TimestampOutOfBoundsException"
_ThrottlingException :: AsError a => Getting (First ServiceError) a ServiceError
_ThrottlingException =
_MatchServiceError marketplaceMetering "ThrottlingException"
_InternalServiceErrorException :: AsError a => Getting (First ServiceError) a ServiceError
_InternalServiceErrorException =
_MatchServiceError marketplaceMetering "InternalServiceErrorException"
_InvalidTokenException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidTokenException =
_MatchServiceError marketplaceMetering "InvalidTokenException"
_ExpiredTokenException :: AsError a => Getting (First ServiceError) a ServiceError
_ExpiredTokenException =
_MatchServiceError marketplaceMetering "ExpiredTokenException"
_InvalidCustomerIdentifierException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidCustomerIdentifierException =
_MatchServiceError marketplaceMetering "InvalidCustomerIdentifierException"