{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.APIGateway.Types
(
apiGateway
, _ConflictException
, _NotFoundException
, _TooManyRequestsException
, _ServiceUnavailableException
, _UnauthorizedException
, _BadRequestException
, _LimitExceededException
, APIKeysFormat (..)
, AuthorizerType (..)
, CacheClusterSize (..)
, CacheClusterStatus (..)
, IntegrationType (..)
, Op (..)
, PutMode (..)
, QuotaPeriodType (..)
, UnauthorizedCacheControlHeaderStrategy (..)
, APIKey
, apiKey
, akEnabled
, akValue
, akCreatedDate
, akName
, akId
, akStageKeys
, akLastUpdatedDate
, akDescription
, APIStage
, apiStage
, asStage
, asApiId
, Account
, account
, aApiKeyVersion
, aCloudwatchRoleARN
, aFeatures
, aThrottleSettings
, Authorizer
, authorizer
, aAuthorizerURI
, aIdentityValidationExpression
, aProviderARNs
, aName
, aId
, aAuthorizerResultTtlInSeconds
, aAuthType
, aType
, aIdentitySource
, aAuthorizerCredentials
, BasePathMapping
, basePathMapping
, bpmStage
, bpmBasePath
, bpmRestAPIId
, ClientCertificate
, clientCertificate
, ccPemEncodedCertificate
, ccClientCertificateId
, ccCreatedDate
, ccExpirationDate
, ccDescription
, Deployment
, deployment
, dApiSummary
, dCreatedDate
, dId
, dDescription
, DomainName
, domainName
, dnCertificateName
, dnDomainName
, dnCertificateUploadDate
, dnDistributionDomainName
, Integration
, integration
, iHttpMethod
, iRequestTemplates
, iCredentials
, iRequestParameters
, iPassthroughBehavior
, iUri
, iIntegrationResponses
, iCacheNamespace
, iType
, iCacheKeyParameters
, IntegrationResponse
, integrationResponse
, iResponseTemplates
, iSelectionPattern
, iStatusCode
, iResponseParameters
, Method
, method
, mMethodResponses
, mHttpMethod
, mRequestModels
, mRequestParameters
, mAuthorizerId
, mAuthorizationType
, mApiKeyRequired
, mMethodIntegration
, MethodResponse
, methodResponse
, mResponseModels
, mStatusCode
, mResponseParameters
, MethodSetting
, methodSetting
, msCacheTtlInSeconds
, msDataTraceEnabled
, msThrottlingBurstLimit
, msCacheDataEncrypted
, msLoggingLevel
, msRequireAuthorizationForCacheControl
, msCachingEnabled
, msMetricsEnabled
, msThrottlingRateLimit
, msUnauthorizedCacheControlHeaderStrategy
, MethodSnapshot
, methodSnapshot
, msAuthorizationType
, msApiKeyRequired
, Model
, model
, mSchema
, mName
, mId
, mDescription
, mContentType
, PatchOperation
, patchOperation
, poOp
, poPath
, poValue
, poFrom
, QuotaSettings
, quotaSettings
, qsOffset
, qsPeriod
, qsLimit
, Resource
, resource
, rPathPart
, rPath
, rId
, rResourceMethods
, rParentId
, RestAPI
, restAPI
, raWarnings
, raCreatedDate
, raName
, raId
, raDescription
, Stage
, stage
, sDeploymentId
, sVariables
, sClientCertificateId
, sCreatedDate
, sCacheClusterStatus
, sMethodSettings
, sLastUpdatedDate
, sCacheClusterSize
, sCacheClusterEnabled
, sStageName
, sDescription
, StageKey
, stageKey
, skRestAPIId
, skStageName
, ThrottleSettings
, throttleSettings
, tsBurstLimit
, tsRateLimit
, Usage
, usage
, uUsagePlanId
, uEndDate
, uItems
, uStartDate
, uPosition
, UsagePlan
, usagePlan
, upApiStages
, upName
, upId
, upThrottle
, upQuota
, upDescription
, UsagePlanKey
, usagePlanKey
, upkValue
, upkName
, upkId
, upkType
) where
import Network.AWS.APIGateway.Types.Product
import Network.AWS.APIGateway.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
apiGateway :: Service
apiGateway =
Service
{ _svcAbbrev = "APIGateway"
, _svcSigner = v4
, _svcPrefix = "apigateway"
, _svcVersion = "2015-07-09"
, _svcEndpoint = defaultEndpoint apiGateway
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "APIGateway"
, _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
_ConflictException :: AsError a => Getting (First ServiceError) a ServiceError
_ConflictException =
_ServiceError . hasStatus 409 . hasCode "ConflictException"
_NotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_NotFoundException =
_ServiceError . hasStatus 404 . hasCode "NotFoundException"
_TooManyRequestsException :: AsError a => Getting (First ServiceError) a ServiceError
_TooManyRequestsException =
_ServiceError . hasStatus 429 . hasCode "TooManyRequestsException"
_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"
_BadRequestException :: AsError a => Getting (First ServiceError) a ServiceError
_BadRequestException =
_ServiceError . hasStatus 400 . hasCode "BadRequestException"
_LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_LimitExceededException =
_ServiceError . hasStatus 429 . hasCode "LimitExceededException"