{-# LANGUAGE DisambiguateRecordFields #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.APIGateway.Types
(
defaultService,
_BadRequestException,
_ConflictException,
_LimitExceededException,
_NotFoundException,
_ServiceUnavailableException,
_TooManyRequestsException,
_UnauthorizedException,
ApiKeySourceType (..),
ApiKeysFormat (..),
AuthorizerType (..),
CacheClusterSize (..),
CacheClusterStatus (..),
ConnectionType (..),
ContentHandlingStrategy (..),
DocumentationPartType (..),
DomainNameStatus (..),
EndpointType (..),
GatewayResponseType (..),
IntegrationType (..),
LocationStatusType (..),
Op (..),
PutMode (..),
QuotaPeriodType (..),
SecurityPolicy (..),
UnauthorizedCacheControlHeaderStrategy (..),
VpcLinkStatus (..),
AccessLogSettings (..),
newAccessLogSettings,
accessLogSettings_destinationArn,
accessLogSettings_format,
Account (..),
newAccount,
account_apiKeyVersion,
account_cloudwatchRoleArn,
account_features,
account_throttleSettings,
ApiKey (..),
newApiKey,
apiKey_createdDate,
apiKey_customerId,
apiKey_description,
apiKey_enabled,
apiKey_id,
apiKey_lastUpdatedDate,
apiKey_name,
apiKey_stageKeys,
apiKey_tags,
apiKey_value,
ApiStage (..),
newApiStage,
apiStage_apiId,
apiStage_stage,
apiStage_throttle,
Authorizer (..),
newAuthorizer,
authorizer_authType,
authorizer_authorizerCredentials,
authorizer_authorizerResultTtlInSeconds,
authorizer_authorizerUri,
authorizer_id,
authorizer_identitySource,
authorizer_identityValidationExpression,
authorizer_name,
authorizer_providerARNs,
authorizer_type,
BasePathMapping (..),
newBasePathMapping,
basePathMapping_basePath,
basePathMapping_restApiId,
basePathMapping_stage,
CanarySettings (..),
newCanarySettings,
canarySettings_deploymentId,
canarySettings_percentTraffic,
canarySettings_stageVariableOverrides,
canarySettings_useStageCache,
ClientCertificate (..),
newClientCertificate,
clientCertificate_clientCertificateId,
clientCertificate_createdDate,
clientCertificate_description,
clientCertificate_expirationDate,
clientCertificate_pemEncodedCertificate,
clientCertificate_tags,
Deployment (..),
newDeployment,
deployment_apiSummary,
deployment_createdDate,
deployment_description,
deployment_id,
DeploymentCanarySettings (..),
newDeploymentCanarySettings,
deploymentCanarySettings_percentTraffic,
deploymentCanarySettings_stageVariableOverrides,
deploymentCanarySettings_useStageCache,
DocumentationPart (..),
newDocumentationPart,
documentationPart_id,
documentationPart_location,
documentationPart_properties,
DocumentationPartLocation (..),
newDocumentationPartLocation,
documentationPartLocation_method,
documentationPartLocation_name,
documentationPartLocation_path,
documentationPartLocation_statusCode,
documentationPartLocation_type,
DocumentationVersion (..),
newDocumentationVersion,
documentationVersion_createdDate,
documentationVersion_description,
documentationVersion_version,
DomainName (..),
newDomainName,
domainName_certificateArn,
domainName_certificateName,
domainName_certificateUploadDate,
domainName_distributionDomainName,
domainName_distributionHostedZoneId,
domainName_domainName,
domainName_domainNameStatus,
domainName_domainNameStatusMessage,
domainName_endpointConfiguration,
domainName_mutualTlsAuthentication,
domainName_ownershipVerificationCertificateArn,
domainName_regionalCertificateArn,
domainName_regionalCertificateName,
domainName_regionalDomainName,
domainName_regionalHostedZoneId,
domainName_securityPolicy,
domainName_tags,
EndpointConfiguration (..),
newEndpointConfiguration,
endpointConfiguration_types,
endpointConfiguration_vpcEndpointIds,
GatewayResponse (..),
newGatewayResponse,
gatewayResponse_defaultResponse,
gatewayResponse_responseParameters,
gatewayResponse_responseTemplates,
gatewayResponse_responseType,
gatewayResponse_statusCode,
Integration (..),
newIntegration,
integration_cacheKeyParameters,
integration_cacheNamespace,
integration_connectionId,
integration_connectionType,
integration_contentHandling,
integration_credentials,
integration_httpMethod,
integration_integrationResponses,
integration_passthroughBehavior,
integration_requestParameters,
integration_requestTemplates,
integration_timeoutInMillis,
integration_tlsConfig,
integration_type,
integration_uri,
IntegrationResponse (..),
newIntegrationResponse,
integrationResponse_contentHandling,
integrationResponse_responseParameters,
integrationResponse_responseTemplates,
integrationResponse_selectionPattern,
integrationResponse_statusCode,
Method (..),
newMethod,
method_apiKeyRequired,
method_authorizationScopes,
method_authorizationType,
method_authorizerId,
method_httpMethod,
method_methodIntegration,
method_methodResponses,
method_operationName,
method_requestModels,
method_requestParameters,
method_requestValidatorId,
MethodResponse (..),
newMethodResponse,
methodResponse_responseModels,
methodResponse_responseParameters,
methodResponse_statusCode,
MethodSetting (..),
newMethodSetting,
methodSetting_cacheDataEncrypted,
methodSetting_cacheTtlInSeconds,
methodSetting_cachingEnabled,
methodSetting_dataTraceEnabled,
methodSetting_loggingLevel,
methodSetting_metricsEnabled,
methodSetting_requireAuthorizationForCacheControl,
methodSetting_throttlingBurstLimit,
methodSetting_throttlingRateLimit,
methodSetting_unauthorizedCacheControlHeaderStrategy,
MethodSnapshot (..),
newMethodSnapshot,
methodSnapshot_apiKeyRequired,
methodSnapshot_authorizationType,
Model (..),
newModel,
model_contentType,
model_description,
model_id,
model_name,
model_schema,
MutualTlsAuthentication (..),
newMutualTlsAuthentication,
mutualTlsAuthentication_truststoreUri,
mutualTlsAuthentication_truststoreVersion,
mutualTlsAuthentication_truststoreWarnings,
MutualTlsAuthenticationInput (..),
newMutualTlsAuthenticationInput,
mutualTlsAuthenticationInput_truststoreUri,
mutualTlsAuthenticationInput_truststoreVersion,
PatchOperation (..),
newPatchOperation,
patchOperation_from,
patchOperation_op,
patchOperation_path,
patchOperation_value,
QuotaSettings (..),
newQuotaSettings,
quotaSettings_limit,
quotaSettings_offset,
quotaSettings_period,
RequestValidator (..),
newRequestValidator,
requestValidator_id,
requestValidator_name,
requestValidator_validateRequestBody,
requestValidator_validateRequestParameters,
Resource (..),
newResource,
resource_id,
resource_parentId,
resource_path,
resource_pathPart,
resource_resourceMethods,
RestApi (..),
newRestApi,
restApi_apiKeySource,
restApi_binaryMediaTypes,
restApi_createdDate,
restApi_description,
restApi_disableExecuteApiEndpoint,
restApi_endpointConfiguration,
restApi_id,
restApi_minimumCompressionSize,
restApi_name,
restApi_policy,
restApi_tags,
restApi_version,
restApi_warnings,
SdkConfigurationProperty (..),
newSdkConfigurationProperty,
sdkConfigurationProperty_defaultValue,
sdkConfigurationProperty_description,
sdkConfigurationProperty_friendlyName,
sdkConfigurationProperty_name,
sdkConfigurationProperty_required,
SdkType (..),
newSdkType,
sdkType_configurationProperties,
sdkType_description,
sdkType_friendlyName,
sdkType_id,
Stage (..),
newStage,
stage_accessLogSettings,
stage_cacheClusterEnabled,
stage_cacheClusterSize,
stage_cacheClusterStatus,
stage_canarySettings,
stage_clientCertificateId,
stage_createdDate,
stage_deploymentId,
stage_description,
stage_documentationVersion,
stage_lastUpdatedDate,
stage_methodSettings,
stage_stageName,
stage_tags,
stage_tracingEnabled,
stage_variables,
stage_webAclArn,
StageKey (..),
newStageKey,
stageKey_restApiId,
stageKey_stageName,
ThrottleSettings (..),
newThrottleSettings,
throttleSettings_burstLimit,
throttleSettings_rateLimit,
TlsConfig (..),
newTlsConfig,
tlsConfig_insecureSkipVerification,
Usage (..),
newUsage,
usage_endDate,
usage_items,
usage_position,
usage_startDate,
usage_usagePlanId,
UsagePlan (..),
newUsagePlan,
usagePlan_apiStages,
usagePlan_description,
usagePlan_id,
usagePlan_name,
usagePlan_productCode,
usagePlan_quota,
usagePlan_tags,
usagePlan_throttle,
UsagePlanKey (..),
newUsagePlanKey,
usagePlanKey_id,
usagePlanKey_name,
usagePlanKey_type,
usagePlanKey_value,
VpcLink (..),
newVpcLink,
vpcLink_description,
vpcLink_id,
vpcLink_name,
vpcLink_status,
vpcLink_statusMessage,
vpcLink_tags,
vpcLink_targetArns,
)
where
import Amazonka.APIGateway.Types.AccessLogSettings
import Amazonka.APIGateway.Types.Account
import Amazonka.APIGateway.Types.ApiKey
import Amazonka.APIGateway.Types.ApiKeySourceType
import Amazonka.APIGateway.Types.ApiKeysFormat
import Amazonka.APIGateway.Types.ApiStage
import Amazonka.APIGateway.Types.Authorizer
import Amazonka.APIGateway.Types.AuthorizerType
import Amazonka.APIGateway.Types.BasePathMapping
import Amazonka.APIGateway.Types.CacheClusterSize
import Amazonka.APIGateway.Types.CacheClusterStatus
import Amazonka.APIGateway.Types.CanarySettings
import Amazonka.APIGateway.Types.ClientCertificate
import Amazonka.APIGateway.Types.ConnectionType
import Amazonka.APIGateway.Types.ContentHandlingStrategy
import Amazonka.APIGateway.Types.Deployment
import Amazonka.APIGateway.Types.DeploymentCanarySettings
import Amazonka.APIGateway.Types.DocumentationPart
import Amazonka.APIGateway.Types.DocumentationPartLocation
import Amazonka.APIGateway.Types.DocumentationPartType
import Amazonka.APIGateway.Types.DocumentationVersion
import Amazonka.APIGateway.Types.DomainName
import Amazonka.APIGateway.Types.DomainNameStatus
import Amazonka.APIGateway.Types.EndpointConfiguration
import Amazonka.APIGateway.Types.EndpointType
import Amazonka.APIGateway.Types.GatewayResponse
import Amazonka.APIGateway.Types.GatewayResponseType
import Amazonka.APIGateway.Types.Integration
import Amazonka.APIGateway.Types.IntegrationResponse
import Amazonka.APIGateway.Types.IntegrationType
import Amazonka.APIGateway.Types.LocationStatusType
import Amazonka.APIGateway.Types.Method
import Amazonka.APIGateway.Types.MethodResponse
import Amazonka.APIGateway.Types.MethodSetting
import Amazonka.APIGateway.Types.MethodSnapshot
import Amazonka.APIGateway.Types.Model
import Amazonka.APIGateway.Types.MutualTlsAuthentication
import Amazonka.APIGateway.Types.MutualTlsAuthenticationInput
import Amazonka.APIGateway.Types.Op
import Amazonka.APIGateway.Types.PatchOperation
import Amazonka.APIGateway.Types.PutMode
import Amazonka.APIGateway.Types.QuotaPeriodType
import Amazonka.APIGateway.Types.QuotaSettings
import Amazonka.APIGateway.Types.RequestValidator
import Amazonka.APIGateway.Types.Resource
import Amazonka.APIGateway.Types.RestApi
import Amazonka.APIGateway.Types.SdkConfigurationProperty
import Amazonka.APIGateway.Types.SdkType
import Amazonka.APIGateway.Types.SecurityPolicy
import Amazonka.APIGateway.Types.Stage
import Amazonka.APIGateway.Types.StageKey
import Amazonka.APIGateway.Types.ThrottleSettings
import Amazonka.APIGateway.Types.TlsConfig
import Amazonka.APIGateway.Types.UnauthorizedCacheControlHeaderStrategy
import Amazonka.APIGateway.Types.Usage
import Amazonka.APIGateway.Types.UsagePlan
import Amazonka.APIGateway.Types.UsagePlanKey
import Amazonka.APIGateway.Types.VpcLink
import Amazonka.APIGateway.Types.VpcLinkStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Sign.V4 as Sign
defaultService :: Core.Service
defaultService :: Service
defaultService =
Core.Service
{ $sel:abbrev:Service :: Abbrev
Core.abbrev = Abbrev
"APIGateway",
$sel:signer:Service :: Signer
Core.signer = Signer
Sign.v4,
$sel:endpointPrefix:Service :: ByteString
Core.endpointPrefix = ByteString
"apigateway",
$sel:signingName:Service :: ByteString
Core.signingName = ByteString
"apigateway",
$sel:version:Service :: ByteString
Core.version = ByteString
"2015-07-09",
$sel:s3AddressingStyle:Service :: S3AddressingStyle
Core.s3AddressingStyle = S3AddressingStyle
Core.S3AddressingStyleAuto,
$sel:endpoint:Service :: Region -> Endpoint
Core.endpoint = Service -> Region -> Endpoint
Core.defaultEndpoint Service
defaultService,
$sel:timeout:Service :: Maybe Seconds
Core.timeout = forall a. a -> Maybe a
Prelude.Just Seconds
70,
$sel:check:Service :: Status -> Bool
Core.check = Status -> Bool
Core.statusSuccess,
$sel:error:Service :: Status -> [Header] -> ByteStringLazy -> Error
Core.error = Abbrev -> Status -> [Header] -> ByteStringLazy -> Error
Core.parseJSONError Abbrev
"APIGateway",
$sel:retry:Service :: Retry
Core.retry = Retry
retry
}
where
retry :: Retry
retry =
Core.Exponential
{ $sel:base:Exponential :: Double
Core.base = Double
5.0e-2,
$sel:growth:Exponential :: Int
Core.growth = Int
2,
$sel:attempts:Exponential :: Int
Core.attempts = Int
5,
$sel:check:Exponential :: ServiceError -> Maybe Text
Core.check = forall {a}. IsString a => ServiceError -> Maybe a
check
}
check :: ServiceError -> Maybe a
check ServiceError
e
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
502) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"bad_gateway"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
504) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"gateway_timeout"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
500) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"general_server_error"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
509) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"limit_exceeded"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"RequestThrottledException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"request_throttled_exception"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
503) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"service_unavailable"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottledException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throttled_exception"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"Throttling"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throttling"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottlingException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throttling_exception"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode
ErrorCode
"ProvisionedThroughputExceededException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throughput_exceeded"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
429) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"too_many_requests"
| Bool
Prelude.otherwise = forall a. Maybe a
Prelude.Nothing
_BadRequestException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_BadRequestException :: forall a. AsError a => Fold a ServiceError
_BadRequestException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"BadRequestException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
_ConflictException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ConflictException :: forall a. AsError a => Fold a ServiceError
_ConflictException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ConflictException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
409
_LimitExceededException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_LimitExceededException :: forall a. AsError a => Fold a ServiceError
_LimitExceededException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"LimitExceededException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
429
_NotFoundException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_NotFoundException :: forall a. AsError a => Fold a ServiceError
_NotFoundException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"NotFoundException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
404
_ServiceUnavailableException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ServiceUnavailableException :: forall a. AsError a => Fold a ServiceError
_ServiceUnavailableException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ServiceUnavailableException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
503
_TooManyRequestsException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_TooManyRequestsException :: forall a. AsError a => Fold a ServiceError
_TooManyRequestsException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"TooManyRequestsException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
429
_UnauthorizedException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_UnauthorizedException :: forall a. AsError a => Fold a ServiceError
_UnauthorizedException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"UnauthorizedException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
401