apigateway

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 41 Imported by: 0

README

API Gateway

Parity grade: A · SDK aws-sdk-go-v2/service/apigateway@v1.42.4 · last audited 2026-07-23 (01f7563b)

Coverage

Metric Value
Operations audited 123 (123 ok)
Feature families 3 (3 ok)
Known gaps 10
Deferred items 2
Resource leaks clean
Known gaps
  • PATCH 'remove' on bare top-level SCALAR fields is a no-op EXCEPT for the instances now fixed (RestApi./description, Authorizer./identitySource, DomainName./certificateArn + /regionalCertificateArn + /certificateName + /regionalCertificateName + /ownershipVerificationCertificateArn, and UsagePlan./productCode — all via string UpdateInput fields, verified against patch-operations.html as remove-supported paths on their resources' Update tables). Every OTHER UpdateInput still uses a zero-value-means-not-provided check, so explicit remove still can't be distinguished from absence there. Audited against patch-operations.html's full per-resource table: almost every other top-level scalar (UpdateApiKey's customerId/description/enabled/name, UpdateAccount's cloudwatchRoleArn, UpdateStage's description/cacheCluster/tracingEnabled/clientCertificateId, UpdateUsagePlan's name/description, UpdateModel's description/schema, UpdateRequestValidator's fields, UpdateResource's fields, UpdateVpcLink's fields, etc.) is documented replace-only with remove NOT supported, so no fix is needed there. Map/list-valued fields (variables, binaryMediaTypes, apiStages, responseParameters/Templates, methodSettings, stageKeys) support remove correctly because their merge goes through a full non-nil replacement value. (bd: gopherstack-vvsy, gopherstack-npq5)
  • FIXED (bd: gopherstack-vvsy): the multi-op-per-request PATCH clobbering bug (resource-specific resolvers re-deriving their starting map/struct from CURRENT BACKEND STATE instead of checking out[field] for what an earlier op in the SAME request already staged) is now fixed in all six resolvers that had it (applyStageVariablePatch, applyStageCanaryPatch, applyStageAccessLogPatch, applyRestAPIPatchOp's binaryMediaTypes case, applyAccountPatchOp, applyGatewayResponsePatchOp), via the same stagedValue[T] helper the prior sweep introduced. Verified by Test_ApplyStructuredPatch_MultiOpSameRequest (stage variables/canary/accessLog) plus Test_ApplyStructuredPatch_{RestAPIBinaryMediaTypesMultiOp,AccountThrottleMultiOp,GatewayResponseMultiOp} — each drives a real two-op PATCH request through the handler and asserts both ops land; each test was confirmed to fail against the pre-fix code (git-stashing patch.go alone) before the fix landed.
  • FIXED (bd: gopherstack-vvsy): applyResourcePatchOp now has a case for opUpdateDomainName (applyDomainNamePatchOp), handling the nested paths "/endpointConfiguration/types" (add/remove), "/endpointConfiguration/ipAddressType" (replace), and "/mutualTlsAuthentication/{truststoreUri,truststoreVersion}" (add/replace/remove) — DomainName.MutualTLSAuthentication and EndpointConfiguration.IPAddressType are new fields added this follow-up. Verified by Test_ApplyStructuredPatch_DomainNameNestedPaths (four ops across two nested fields in one request, plus a remove). FIXED (bd: gopherstack-npq5, 2026-08-09): the remaining top-level scalars patch-operations.html's UpdateDomainName table documents — /certificateName, /regionalCertificateName, /ownershipVerificationCertificateArn (remove-supported, now *string on UpdateDomainNameInput) and /managementPolicy, /policy, /routingMode, /endpointAccessMode (replace-only, plain string) — are now DomainName/UpdateDomainNameInput fields; all seven route through the existing applyTopLevelPatchOp fallback, no new resolver needed. Verified against a live patch-operations.html fetch and aws-sdk-go-v2/service/apigateway@v1.42.4's deserializers.go for wire field names, and proven via real aws-sdk-go-v2 client integration tests (TestIntegration_APIGatewayAudit_UpdateDomainNameDocumentedFields). One item the tracking ticket listed under DomainName was found to actually belong to UpdateRestApi instead: /endpointConfiguration/vpcEndpointIds appears only in patch-operations.html's UpdateRestApi table, not UpdateDomainName's — left unmodeled here (UpdateRestApi doesn't handle nested endpointConfiguration paths at all yet; a RestApi-scoped gap, out of this fix's scope).
  • The exact property-path strings for per-route stage method settings (stageMethodSettingProperty in patch.go, e.g. "logging/dataTrace", "caching/dataEncrypted", "caching/unauthorizedCacheControlHeaderStrategy") were fetched and verified this sweep directly against the live AWS documentation page https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html (UpdateStage table) — every string in the map matches exactly, including the two new caching/* entries added this sweep. Still not backed by an SDK-level typed enum (PatchOperation.Path is a free string in aws-sdk-go-v2), so this remains a doc-fetch verification rather than a compile-time guarantee; re-verify if AWS changes the doc.
  • UsagePlan.apiStages per-route throttle PATCH path shape RE-VERIFIED this follow-up (bd: gopherstack-vvsy) directly against a fresh fetch of patch-operations.html's UpdateUsagePlan table: "/apiStages/{apidId:stageName}/throttle/{resourcePath}/{httpMethod}" (remove-only) and the same path + "/rateLimit" or "/burstLimit" (add/replace) — gopherstack's usagePlanThrottlePathMinSegs=5 segmentation and the "restApiId:stage" colon-separated composite key both match AWS's own path notation exactly (AWS's doc literally uses the "{apidId:stageName}" spelling as the path placeholder). No wire capture example exists for the exact /apiStages add/remove Value string format, but the colon convention is corroborated by the path notation itself. No code change was needed — the existing implementation already matches.
  • 2026-08-11 (gopherstack-oius) FULL 22-OP CLASSIFICATION of every op whose real aws-sdk-go-v2 request shape is {...ids, patchOperations} (verified against botocore apigateway 2015-07-09 service-2.json — all 22 request shapes carry ONLY id fields + patchOperations, no flat scalars): ALREADY CORRECT before this sweep (single-segment scalars all route through applyTopLevelPatchOp and match their Update*Input json tag, or already had a dedicated resolver) — UpdateAccount, UpdateApiKey, UpdateAuthorizer (see caveat below), UpdateClientCertificate, UpdateDeployment, UpdateDocumentationPart, UpdateDocumentationVersion, UpdateDomainName, UpdateGatewayResponse, UpdateModel, UpdateRequestValidator, UpdateRestApi, UpdateStage, UpdateUsage, UpdateUsagePlan, UpdateVpcLink. FIXED this sweep (real bugs — see the 5 op lines above for details) — UpdateResource, UpdateMethod, UpdateIntegration, UpdateIntegrationResponse, UpdateMethodResponse. NOT reached this sweep, deferred — UpdateBasePathMapping (see gaps below: wire-casing bug found, not fixed).
  • FIXED (bd: gopherstack-6q5h): UpdateAccount's "/features" add/remove (patch-operations.html: add supported, remove supported except for the UsagePlans feature). Features field added to UpdateAccountInput (nil-checked, not len()>0, so removing the last feature actually clears it) and a features case added to applyAccountPatchOp — merges with the account's existing Features (initialized to ["UsagePlans"] at store setup, store.go:451) rather than replacing wholesale. Removing "UsagePlans" specifically, and any op but add/remove, are REJECTED (BadRequestException) per the doc table's exception. Verified with TestSDK_UpdateAccount_FeaturesPatch (patch_ops_sdk_test.go) against a real aws-sdk-go-v2 client; confirmed failing pre-fix (add silently dropped, both rejections returned 200 nil-error instead of an error).
  • FIXED (bd: gopherstack-6q5h): UpdateAuthorizer's "/providerARNs" add/remove (patch-operations.html: add/remove supported, replace not). Added applyAuthorizerPatchOp, merging with the authorizer's existing ProviderARNs (a wholesale replace would otherwise drop every other ARN) the same way applyAPIKeyPatchOp's /stages case does. InMemoryBackend.UpdateAuthorizer's ProviderARNs merge switched from len()>0 to != nil so removing the last ARN actually clears it (same class of bug the gopherstack-oius sweep fixed 'everywhere these paths reach', but Authorizer wasn't in that sweep's scope). Before this fix the raw Value JSON string unmarshaled straight into a []string field via the generic fallback and FAILED THE WHOLE PATCH REQUEST with a 500 (same bug class as UpdateIntegration's /cacheKeyParameters) — confirmed against a git-worktree checkout of the pre-fix commit with TestSDK_UpdateAuthorizer_ProviderARNsPatch (patch_ops_sdk_test.go), a real aws-sdk-go-v2 client test.
  • FIXED (bd: gopherstack-6q5h): UpdateBasePathMapping's PATCH paths were far more broken than a casing bug. patch-operations.html spells them lowercase ("/basepath", "/restapiId" — note even here the doc keeps a capital I in "restapiId"), but the AWS CLI reference's own worked example (docs.aws.amazon.com/cli/latest/reference/apigateway/update-base-path-mapping.html, mirrored in the AWS Doc SDK Examples code-library page) uses path='/basePath' and shows a real, changed "basePath" in its output — AWS's own sources disagree on the casing, so BOTH spellings are now accepted rather than picking one. But even the EXACT struct-tag-matching spelling "/basePath" did not work before this fix, for a reason unrelated to casing: UpdateBasePathMappingInput.BasePath is the REQUIRED identity used to find the mapping (populated from the URL path segment), and handler.go's pathParams-merge step (injectJSONFieldAPIGW) runs AFTER applyStructuredPatch and unconditionally overwrites whatever the patch resolver staged under "basePath" with the URL's OLD value — so a rename could never take effect regardless of spelling, and InMemoryBackend.UpdateBasePathMapping had no rename logic at all (BasePath was read-only, used solely as a lookup key). Fixed both: applyBasePathMappingPatchOp now stages a rename under a new NewBasePath field (private to this backend, no equivalent on the real AWS wire) that InMemoryBackend.UpdateBasePathMapping applies as an actual store.Table key rename (delete old key, mutate BasePath, re-Put — rejecting a collision with an existing mapping at the new path). "/restapiId" is now explicitly aliased to RestAPIID too, rather than relying on it incidentally working via json.Unmarshal's case-insensitive field match (it does, since RestAPIID isn't pathParams-clobbered, but that's an accident worth not depending on). "/restApiId" and "/stage" already worked via the generic fallback and needed no change. Verified with TestSDK_UpdateBasePathMapping_PatchOperations (patch_ops_sdk_test.go) against a real aws-sdk-go-v2 client, confirmed failing pre-fix for both "/basepath" (404 on the renamed lookup) and "/basePath" (silently kept the old value).
  • CASING SWEEP (bd: gopherstack-6q5h): compared all 22 patchOperations-taking ops' documented paths (a fresh patch-operations.html fetch) against their Update*Input json tags and, for UpdateStage's per-route method-settings properties and UpdateUsagePlan's per-route throttle path, the literal strings this dispatcher compares against (patch.go's stageMethodSettingProperty map / usagePlanThrottlePathMinSegs segmentation). UpdateBasePathMapping's /basepath and /restapiId (fixed this pass) were the ONLY casing mismatch found; every other operation's json tags match their documented path spelling exactly, letter for letter. Also found in passing, NOT fixed (a real casing question but out of this ticket's scope): UpdateAuthorizer's PATCH table separately documents "/authType" (types.Authorizer.AuthType, a real but different field from Authorizer's existing "Type"/authorizerType) which this backend does not model at all — an unmodeled-field gap, not a casing one; and UpdateRestApi's table documents "/securityPolicy", but neither RestAPI nor UpdateRestAPIInput has a SecurityPolicy field (only DomainName does) — also unmodeled, not casing.
Deferred
  • ApiKey.StageKeys's PATCH /labels add/remove path (listed in patch-operations.html's UpdateApiKey table) still has no corresponding field anywhere in aws-sdk-go-v2/service/apigateway/types.ApiKey (re-verified this sweep) — likely a stale doc artifact from a pre-Tags API generation. Nothing to implement against; distinct from /stages, which this sweep DID implement (see Notes).
  • 2026-08-11 (gopherstack-oius): Method.AuthorizationScopes is not modeled anywhere in this backend (not on Method, not on PutMethodInput/CreateAuthorizerInput's COGNITO_USER_POOLS flow) even though patch-operations.html documents UpdateMethod's "/authorizationScopes" as add/remove-supported and it's a real, commonly-used field (COGNITO_USER_POOLS authorizer scope matching). UpdateMethod now explicitly REJECTS this path (BadRequestException) rather than silently accepting a patch that changes nothing — see applyMethodPatchOp. Properly modeling it needs PutMethod/PutMethodInput plumbing too, a larger change than this PATCH-focused sweep; tracked here as the next real step.

More

Documentation

Index

Constants

View Source
const (
	IntegrationTypeMock      = "MOCK"
	IntegrationTypeHTTP      = "HTTP"
	IntegrationTypeHTTPProxy = "HTTP_PROXY"
	IntegrationTypeAWS       = "AWS"
	IntegrationTypeAWSProxy  = "AWS_PROXY"
)

Integration type constants.

View Source
const (
	AuthTypeNone            = "NONE"
	AuthTypeAWSIAM          = "AWS_IAM"
	AuthTypeCustom          = "CUSTOM"
	AuthTypeCognitoUserPool = "COGNITO_USER_POOLS"
)

Authorization type constants.

Variables

View Source
var (
	ErrRestAPINotFound                     = errors.New("NotFoundException")
	ErrResourceNotFound                    = errors.New("NotFoundException")
	ErrMethodNotFound                      = errors.New("NotFoundException")
	ErrMethodResponseNotFound              = errors.New("NotFoundException")
	ErrIntegrationResponseNotFound         = errors.New("NotFoundException")
	ErrDeploymentNotFound                  = errors.New("NotFoundException")
	ErrAuthorizerNotFound                  = errors.New("NotFoundException")
	ErrValidatorNotFound                   = errors.New("NotFoundException")
	ErrAPIKeyNotFound                      = errors.New("NotFoundException")
	ErrBasePathMappingNotFound             = errors.New("NotFoundException")
	ErrDocumentationPartNotFound           = errors.New("NotFoundException")
	ErrDocumentationVersionNotFound        = errors.New("NotFoundException")
	ErrDomainNameNotFound                  = errors.New("NotFoundException")
	ErrDomainNameAccessAssociationNotFound = errors.New("NotFoundException")
	ErrModelNotFound                       = errors.New("NotFoundException")
	ErrUsagePlanNotFound                   = errors.New("NotFoundException")
	ErrUsagePlanKeyNotFound                = errors.New("NotFoundException")
	ErrStageNotFound                       = errors.New("NotFoundException")
	ErrNotFound                            = errors.New("NotFoundException")
	ErrAlreadyExists                       = awserr.New("ConflictException", awserr.ErrAlreadyExists)
	ErrInvalidParameter                    = errors.New("BadRequestException")

	// ErrQuotaExceeded is returned by the data plane when an API key has exhausted
	// its usage-plan quota for the current period (AWS maps this to HTTP 429).
	ErrQuotaExceeded = errors.New("LimitExceededException")
	// ErrThrottled is returned by the data plane when an API key exceeds the
	// usage-plan rate/burst throttle (AWS maps this to HTTP 429).
	ErrThrottled = errors.New("TooManyRequestsException")
)

Functions

func ExtractLambdaFunctionName

func ExtractLambdaFunctionName(uri string) string

ExtractLambdaFunctionName extracts a Lambda function name (or short ARN) from either:

  • A plain function name: "my-function"
  • A Lambda ARN: "arn:aws:lambda:region:account:function:my-function"
  • An API Gateway invoke URI containing "arn:aws:apigateway:region:lambda:path/.../functions/{lambdaArn}/invocations"

Returns the input unchanged if it does not match any known pattern.

func RenderTemplate

func RenderTemplate(tmpl string, ctx VTLContext) string

RenderTemplate renders a Velocity Template Language (VTL) template string using the provided context.

Types

type APIKey

type APIKey struct {
	CreatedDate     unixEpochTime `json:"createdDate"`
	LastUpdatedDate unixEpochTime `json:"lastUpdatedDate"`
	Tags            *tags.Tags    `json:"tags,omitempty"`
	ID              string        `json:"id"`
	Name            string        `json:"name"`
	Description     string        `json:"description,omitempty"`
	Value           string        `json:"value,omitempty"`
	// CustomerID is an AWS Marketplace customer identifier, when integrating
	// with the AWS SaaS Marketplace (types.ApiKey.CustomerId in the SDK).
	CustomerID string `json:"customerId,omitempty"`
	// StageKeys lists the "{restApiId}/{stageName}" stage associations for
	// this API key (types.ApiKey.StageKeys / types.CreateApiKeyOutput.StageKeys
	// in the SDK -- deprecated in favor of usage plans, but still a real,
	// settable field: CreateApiKeyInput.StageKeys and UpdateApiKey's
	// "/stages" add/remove PATCH path both still work against it).
	StageKeys []string `json:"stageKeys,omitempty"`
	Enabled   bool     `json:"enabled"`
}

APIKey represents an API Gateway API key.

type APIStageAssociation

type APIStageAssociation struct {
	Throttle  map[string]*ThrottleSettings `json:"throttle,omitempty"`
	RestAPIID string                       `json:"apiId,omitempty"`
	Stage     string                       `json:"stage,omitempty"`
}

APIStageAssociation associates a usage plan with a specific REST API stage. The real wire field is "apiId" (types.ApiStage in the SDK), not "restApiId" -- UsagePlan and Resource/Stage/Deployment/Model/Authorizer all key off the REST API differently, so this is not a shared convention to assume from them.

type AccessLogSettings

type AccessLogSettings struct {
	DestinationARN string `json:"destinationArn,omitempty"`
	Format         string `json:"format,omitempty"`
}

AccessLogSettings configures CloudWatch access logging for a stage.

type Account

type Account struct {
	ThrottleSettings  *ThrottleSettings `json:"throttleSettings,omitempty"`
	APIKeyVersion     string            `json:"apiKeyVersion,omitempty"`
	CloudwatchRoleARN string            `json:"cloudwatchRoleArn,omitempty"`
	Features          []string          `json:"features,omitempty"`
}

Account represents the API Gateway account settings.

type Authorizer

type Authorizer struct {
	ID                           string `json:"id"`
	Name                         string `json:"name"`
	Type                         string `json:"type"`
	AuthorizerURI                string `json:"authorizerUri,omitempty"`
	AuthorizerCredentials        string `json:"authorizerCredentials,omitempty"`
	IdentitySource               string `json:"identitySource,omitempty"`
	IdentityValidationExpression string `json:"identityValidationExpression,omitempty"`
	// AuthType is an optional, customer-defined field used only in OpenAPI
	// import/export, with no functional effect (types.Authorizer.AuthType /
	// CreateAuthorizerInput.AuthType in the SDK).
	AuthType string `json:"authType,omitempty"`
	// RestAPIID identifies the owning REST API. It is internal storage-layer
	// identity (composite key for the backend's flat store.Table[Authorizer]),
	// never part of the wire response, matching the same json:"-" convention
	// already used by Resource/Stage/Deployment/Model for the identical purpose.
	RestAPIID                    string   `json:"-"`
	ProviderARNs                 []string `json:"providerARNs,omitempty"`
	AuthorizerResultTTLInSeconds int      `json:"authorizerResultTtlInSeconds,omitempty"`
}

Authorizer represents an API Gateway authorizer.

type AuthorizerEvent

type AuthorizerEvent struct {
	Headers               map[string]string  `json:"headers,omitempty"`
	QueryStringParameters map[string]string  `json:"queryStringParameters,omitempty"`
	StageVariables        map[string]string  `json:"stageVariables,omitempty"`
	RequestContext        LambdaProxyContext `json:"requestContext"`
	Type                  string             `json:"type"`
	AuthorizationToken    string             `json:"authorizationToken,omitempty"`
	MethodArn             string             `json:"methodArn"`
	Resource              string             `json:"resource,omitempty"`
	Path                  string             `json:"path,omitempty"`
	HTTPMethod            string             `json:"httpMethod,omitempty"`
}

AuthorizerEvent is the event payload sent to a Lambda authorizer function.

type AuthorizerResponse

type AuthorizerResponse struct {
	Context        map[string]any  `json:"context,omitempty"`
	PolicyDocument *PolicyDocument `json:"policyDocument,omitempty"`
	PrincipalID    string          `json:"principalId"`
}

AuthorizerResponse is the response returned by a Lambda authorizer function.

type BasePathMapping

type BasePathMapping struct {
	DomainName string `json:"domainName,omitempty"`
	BasePath   string `json:"basePath"`
	RestAPIID  string `json:"restApiId"`
	Stage      string `json:"stage,omitempty"`
}

BasePathMapping maps a base path on a custom domain to an API stage.

type CanarySettings

type CanarySettings struct {
	StageVariableOverrides map[string]string `json:"stageVariableOverrides,omitempty"`
	DeploymentID           string            `json:"deploymentId,omitempty"`
	PercentTraffic         float64           `json:"percentTraffic,omitempty"`
	UseStageCache          bool              `json:"useStageCache,omitempty"`
}

CanarySettings holds canary deployment configuration for a stage.

type ClientCertificate

type ClientCertificate struct {
	Tags                  *tags.Tags    `json:"tags,omitempty"`
	CreatedDate           unixEpochTime `json:"createdDate"`
	ExpirationDate        unixEpochTime `json:"expirationDate"`
	PemEncodedCertificate string        `json:"pemEncodedCertificate"`
	Description           string        `json:"description"`
	ClientCertificateID   string        `json:"clientCertificateId"`
}

ClientCertificate represents an API Gateway client certificate.

type CorsConfiguration

type CorsConfiguration struct {
	AllowHeaders  []string `json:"allowHeaders,omitempty"`
	AllowMethods  []string `json:"allowMethods,omitempty"`
	AllowOrigins  []string `json:"allowOrigins,omitempty"`
	ExposeHeaders []string `json:"exposeHeaders,omitempty"`
	MaxAge        int      `json:"maxAge,omitempty"`
}

CorsConfiguration holds CORS settings for a resource.

type CreateAPIKeyInput

type CreateAPIKeyInput struct {
	Tags        *tags.Tags      `json:"tags,omitempty"`
	Name        string          `json:"name"`
	Description string          `json:"description,omitempty"`
	Value       string          `json:"value,omitempty"`
	CustomerID  string          `json:"customerId,omitempty"`
	StageKeys   []StageKeyInput `json:"stageKeys,omitempty"`
	Enabled     bool            `json:"enabled"`
}

CreateAPIKeyInput is the input for CreateAPIKey.

type CreateAuthorizerInput

type CreateAuthorizerInput struct {
	Name                         string   `json:"name"`
	Type                         string   `json:"type"`
	AuthorizerURI                string   `json:"authorizerUri,omitempty"`
	AuthorizerCredentials        string   `json:"authorizerCredentials,omitempty"`
	IdentitySource               string   `json:"identitySource,omitempty"`
	IdentityValidationExpression string   `json:"identityValidationExpression,omitempty"`
	AuthType                     string   `json:"authType,omitempty"`
	ProviderARNs                 []string `json:"providerARNs,omitempty"`
	AuthorizerResultTTLInSeconds int      `json:"authorizerResultTtlInSeconds,omitempty"`
}

CreateAuthorizerInput is the input for CreateAuthorizer.

type CreateBasePathMappingInput

type CreateBasePathMappingInput struct {
	DomainName string `json:"domainName"`
	BasePath   string `json:"basePath"`
	RestAPIID  string `json:"restApiId"`
	Stage      string `json:"stage,omitempty"`
}

CreateBasePathMappingInput is the input for CreateBasePathMapping.

type CreateDocumentationPartInput

type CreateDocumentationPartInput struct {
	Location   DocumentationLocation `json:"location"`
	RestAPIID  string                `json:"restApiId"`
	Properties string                `json:"properties"`
}

CreateDocumentationPartInput is the input for CreateDocumentationPart.

type CreateDocumentationVersionInput

type CreateDocumentationVersionInput struct {
	RestAPIID   string `json:"restApiId"`
	Version     string `json:"documentationVersion"`
	Description string `json:"description,omitempty"`
}

CreateDocumentationVersionInput is the input for CreateDocumentationVersion.

type CreateDomainNameAccessAssociationInput

type CreateDomainNameAccessAssociationInput struct {
	DomainNameARN               string `json:"domainNameArn"`
	AccessAssociationSource     string `json:"accessAssociationSource"`
	AccessAssociationSourceType string `json:"accessAssociationSourceType"`
}

CreateDomainNameAccessAssociationInput is the input for CreateDomainNameAccessAssociation.

type CreateDomainNameInput

type CreateDomainNameInput struct {
	Tags                   *tags.Tags             `json:"tags,omitempty"`
	EndpointConfiguration  *EndpointConfiguration `json:"endpointConfiguration,omitempty"`
	DomainName             string                 `json:"domainName"`
	CertificateARN         string                 `json:"certificateArn,omitempty"`
	RegionalCertificateARN string                 `json:"regionalCertificateArn,omitempty"`
	SecurityPolicy         string                 `json:"securityPolicy,omitempty"`
}

CreateDomainNameInput is the input for CreateDomainName.

type CreateModelInput

type CreateModelInput struct {
	RestAPIID   string `json:"restApiId"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	ContentType string `json:"contentType,omitempty"`
	Schema      string `json:"schema,omitempty"`
}

CreateModelInput is the input for CreateModel.

type CreateRequestValidatorInput

type CreateRequestValidatorInput struct {
	Name                      string `json:"name"`
	ValidateRequestBody       bool   `json:"validateRequestBody"`
	ValidateRequestParameters bool   `json:"validateRequestParameters"`
}

CreateRequestValidatorInput is the input for CreateRequestValidator.

type CreateRestAPIInput

type CreateRestAPIInput struct {
	EndpointConfiguration     *EndpointConfiguration `json:"endpointConfiguration,omitempty"`
	Tags                      *tags.Tags             `json:"tags,omitempty"`
	Name                      string                 `json:"name"`
	Description               string                 `json:"description,omitempty"`
	Policy                    string                 `json:"policy,omitempty"`
	APIKeySource              string                 `json:"apiKeySource,omitempty"`
	EndpointAccessMode        string                 `json:"endpointAccessMode,omitempty"`
	BinaryMediaTypes          []string               `json:"binaryMediaTypes,omitempty"`
	MinimumCompressionSize    int                    `json:"minimumCompressionSize,omitempty"`
	DisableExecuteAPIEndpoint bool                   `json:"disableExecuteApiEndpoint,omitempty"`
}

CreateRestAPIInput is the input for CreateRestApi.

type CreateStageInput

type CreateStageInput struct {
	Tags                 map[string]string        `json:"tags,omitempty"`
	CanarySettings       *CanarySettings          `json:"canarySettings,omitempty"`
	AccessLogSettings    *AccessLogSettings       `json:"accessLogSettings,omitempty"`
	MethodSettings       map[string]MethodSetting `json:"methodSettings,omitempty"`
	Variables            map[string]string        `json:"variables,omitempty"`
	RestAPIID            string                   `json:"restApiId"`
	StageName            string                   `json:"stageName"`
	DeploymentID         string                   `json:"deploymentId"`
	Description          string                   `json:"description,omitempty"`
	ClientCertificateID  string                   `json:"clientCertificateId,omitempty"`
	CacheClusterSize     string                   `json:"cacheClusterSize,omitempty"`
	DocumentationVersion string                   `json:"documentationVersion,omitempty"`
	TracingEnabled       bool                     `json:"tracingEnabled,omitempty"`
	CacheClusterEnabled  bool                     `json:"cacheClusterEnabled,omitempty"`
}

CreateStageInput is the input for the standalone CreateStage operation.

type CreateUsagePlanInput

type CreateUsagePlanInput struct {
	Tags        *tags.Tags            `json:"tags,omitempty"`
	Throttle    *ThrottleSettings     `json:"throttle,omitempty"`
	Quota       *QuotaSettings        `json:"quota,omitempty"`
	Name        string                `json:"name"`
	Description string                `json:"description,omitempty"`
	APIStages   []APIStageAssociation `json:"apiStages,omitempty"`
}

CreateUsagePlanInput is the input for CreateUsagePlan.

type CreateUsagePlanKeyInput

type CreateUsagePlanKeyInput struct {
	UsagePlanID string `json:"usagePlanId"`
	KeyID       string `json:"keyId"`
	KeyType     string `json:"keyType"`
}

CreateUsagePlanKeyInput is the input for CreateUsagePlanKey.

type CreateVpcLinkInput

type CreateVpcLinkInput struct {
	Tags        map[string]string `json:"tags,omitempty"`
	Name        string            `json:"name"`
	Description string            `json:"description,omitempty"`
	TargetARNs  []string          `json:"targetArns,omitempty"`
}

CreateVpcLinkInput is the input for CreateVpcLink.

type Deployment

type Deployment struct {
	// APISummary is a snapshot, taken at deployment time, of every resource
	// path's methods (types.Deployment.ApiSummary in the SDK), keyed
	// resourcePath -> httpMethod.
	APISummary  map[string]map[string]MethodSnapshot `json:"apiSummary,omitempty"`
	CreatedDate unixEpochTime                        `json:"createdDate"`
	ID          string                               `json:"id"`
	RestAPIID   string                               `json:"-"`
	Description string                               `json:"description,omitempty"`
}

Deployment represents a REST API deployment.

type DocumentationLocation

type DocumentationLocation struct {
	Type       string `json:"type"`
	Path       string `json:"path,omitempty"`
	Method     string `json:"method,omitempty"`
	StatusCode string `json:"statusCode,omitempty"`
	Name       string `json:"name,omitempty"`
}

DocumentationLocation specifies where a documentation part applies.

type DocumentationPart

type DocumentationPart struct {
	Location   DocumentationLocation `json:"location"`
	ID         string                `json:"id"`
	RestAPIID  string                `json:"-"`
	Properties string                `json:"properties"`
}

DocumentationPart represents a piece of API documentation.

type DocumentationVersion

type DocumentationVersion struct {
	CreatedDate unixEpochTime `json:"createdDate"`
	RestAPIID   string        `json:"-"`
	Version     string        `json:"version"`
	Description string        `json:"description,omitempty"`
}

DocumentationVersion represents a versioned snapshot of API documentation.

type DomainName

type DomainName struct {
	CreatedDate                         *unixEpochTime           `json:"createdDate,omitempty"`
	Tags                                *tags.Tags               `json:"tags,omitempty"`
	EndpointConfiguration               *EndpointConfiguration   `json:"endpointConfiguration,omitempty"`
	MutualTLSAuthentication             *MutualTLSAuthentication `json:"mutualTlsAuthentication,omitempty"`
	DomainNameValue                     string                   `json:"domainName"`
	CertificateARN                      string                   `json:"certificateArn,omitempty"`
	CertificateName                     string                   `json:"certificateName,omitempty"`
	RegionalCertificateARN              string                   `json:"regionalCertificateArn,omitempty"`
	RegionalCertificateName             string                   `json:"regionalCertificateName,omitempty"`
	OwnershipVerificationCertificateARN string                   `json:"ownershipVerificationCertificateArn,omitempty"`
	ManagementPolicy                    string                   `json:"managementPolicy,omitempty"`
	Policy                              string                   `json:"policy,omitempty"`
	RoutingMode                         string                   `json:"routingMode,omitempty"`
	EndpointAccessMode                  string                   `json:"endpointAccessMode,omitempty"`
	DistributionDomainName              string                   `json:"distributionDomainName,omitempty"`
	DistributionHostedZoneID            string                   `json:"distributionHostedZoneId,omitempty"`
	RegionalDomainName                  string                   `json:"regionalDomainName,omitempty"`
	RegionalHostedZoneID                string                   `json:"regionalHostedZoneId,omitempty"`
	SecurityPolicy                      string                   `json:"securityPolicy,omitempty"`
	DomainNameStatus                    string                   `json:"domainNameStatus,omitempty"`
}

DomainName represents a custom domain name for an API.

type DomainNameAccessAssociation

type DomainNameAccessAssociation struct {
	DomainNameAccessAssociationARN string `json:"domainNameAccessAssociationArn,omitempty"`
	DomainNameARN                  string `json:"domainNameArn"`
	AccessAssociationSource        string `json:"accessAssociationSource"`
	AccessAssociationSourceType    string `json:"accessAssociationSourceType"`
}

DomainNameAccessAssociation links a domain name to an access source such as a VPC endpoint.

type EndpointConfiguration

type EndpointConfiguration struct {
	IPAddressType  string   `json:"ipAddressType,omitempty"`
	VpcEndpointIDs []string `json:"vpcEndpointIds,omitempty"`
	Types          []string `json:"types,omitempty"`
}

EndpointConfiguration describes the endpoint types for a REST API.

type ErrorResponse

type ErrorResponse struct {
	Type    string `json:"__type"`
	Message string `json:"message"`
}

ErrorResponse is the JSON error format for API Gateway clients.

type GatewayResponse

type GatewayResponse struct {
	StatusCode         string            `json:"statusCode,omitempty"`
	ResponseParameters map[string]string `json:"responseParameters,omitempty"`
	ResponseTemplates  map[string]string `json:"responseTemplates,omitempty"`
	ResponseType       string            `json:"responseType"`
	RestAPIID          string            `json:"restApiId"`
	DefaultResponse    bool              `json:"defaultResponse,omitempty"`
}

GatewayResponse represents a gateway response configuration.

type GenerateClientCertificateInput

type GenerateClientCertificateInput struct {
	Tags        map[string]string `json:"tags,omitempty"`
	Description string            `json:"description,omitempty"`
}

GenerateClientCertificateInput is the input for GenerateClientCertificate.

type GetUsageInput

type GetUsageInput struct {
	UsagePlanID string `json:"usagePlanId"`
	StartDate   string `json:"startDate"`
	EndDate     string `json:"endDate"`
	Position    string `json:"position,omitempty"`
	Limit       int    `json:"limit,omitempty"`
}

GetUsageInput is the input for GetUsage.

type Handler

type Handler struct {
	Backend StorageBackend
	// contains filtered or unexported fields
}

Handler is the Echo HTTP service handler for API Gateway operations.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new API Gateway handler with a default HTTP client timeout.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this API Gateway instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the operation name from the X-Amz-Target header or REST path.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the resource identifier from the request body.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns all mocked API Gateway operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function for API Gateway requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority for the API Gateway handler.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all in-memory state from the backend. It is used by the POST /_gopherstack/reset endpoint for CI pipelines and rapid local development.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a matcher for API Gateway requests. Matches X-Amz-Target (JSON protocol) and REST paths (/restapis/..., /apikeys, /domainnames/..., /usageplans/...). The /tags/{arn} path is only matched when the ARN belongs to an API Gateway resource (contains ":apigateway:") so that other services (e.g. FIS) can own their own tag routes.

func (*Handler) SetHTTPClient

func (h *Handler) SetHTTPClient(c *http.Client)

SetHTTPClient configures the HTTP client used for HTTP/HTTP_PROXY integrations. If not set, a dedicated client with a 30-second timeout is used.

func (*Handler) SetJWKSProvider

func (h *Handler) SetJWKSProvider(p JWKSProvider)

SetJWKSProvider configures the JWKS provider used to verify Cognito JWT signatures.

func (*Handler) SetLambdaInvoker

func (h *Handler) SetLambdaInvoker(lambda LambdaInvoker)

SetLambdaInvoker configures the Lambda invoker for AWS_PROXY integrations.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

type ImportRestAPIInput

type ImportRestAPIInput struct {
	Body           []byte `json:"body,omitempty"`
	FailOnWarnings bool   `json:"failOnWarnings,omitempty"`
}

ImportRestAPIInput is the input for ImportRestApi.

type InMemoryBackend

type InMemoryBackend struct {
	// contains filtered or unexported fields
}

InMemoryBackend implements StorageBackend using in-memory maps, with every resource collection registered as a *store.Table on registry (see store_setup.go). Resource families that AWS scopes to a REST API (resources, deployments, stages, authorizers, requestValidators, documentationParts, documentationVersions, models) are flat tables keyed by a composite "<restAPIID>#<childID>" string (see resourceKey et al in store_setup.go), with a secondary "byAPI" store.Index answering "all children of REST API X" -- replacing the old map[string]*apiData nesting.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates a new InMemoryBackend.

func (*InMemoryBackend) CreateAPIKey

func (b *InMemoryBackend) CreateAPIKey(input CreateAPIKeyInput) (*APIKey, error)

CreateAPIKey creates a new API key with an optional auto-generated value.

func (*InMemoryBackend) CreateAuthorizer

func (b *InMemoryBackend) CreateAuthorizer(restAPIID string, input CreateAuthorizerInput) (*Authorizer, error)

CreateAuthorizer creates a new authorizer for a REST API.

func (*InMemoryBackend) CreateBasePathMapping

func (b *InMemoryBackend) CreateBasePathMapping(input CreateBasePathMappingInput) (*BasePathMapping, error)

CreateBasePathMapping creates a new base path mapping for a domain name.

func (*InMemoryBackend) CreateDeployment

func (b *InMemoryBackend) CreateDeployment(restAPIID, stageName, description string) (*Deployment, error)

CreateDeployment creates a deployment and associated stage.

func (*InMemoryBackend) CreateDocumentationPart

func (b *InMemoryBackend) CreateDocumentationPart(input CreateDocumentationPartInput) (*DocumentationPart, error)

CreateDocumentationPart creates a documentation part for a REST API.

func (*InMemoryBackend) CreateDocumentationVersion

func (b *InMemoryBackend) CreateDocumentationVersion(
	input CreateDocumentationVersionInput,
) (*DocumentationVersion, error)

CreateDocumentationVersion creates a documentation version snapshot for a REST API.

func (*InMemoryBackend) CreateDomainName

func (b *InMemoryBackend) CreateDomainName(input CreateDomainNameInput) (*DomainName, error)

CreateDomainName creates a new custom domain name.

func (*InMemoryBackend) CreateDomainNameAccessAssociation

func (b *InMemoryBackend) CreateDomainNameAccessAssociation(
	input CreateDomainNameAccessAssociationInput,
) (*DomainNameAccessAssociation, error)

CreateDomainNameAccessAssociation creates an access association for a domain name.

func (*InMemoryBackend) CreateModel

func (b *InMemoryBackend) CreateModel(input CreateModelInput) (*Model, error)

CreateModel creates a data model for a REST API.

func (*InMemoryBackend) CreateRequestValidator

func (b *InMemoryBackend) CreateRequestValidator(
	restAPIID string,
	input CreateRequestValidatorInput,
) (*RequestValidator, error)

CreateRequestValidator creates a new request validator for a REST API.

func (*InMemoryBackend) CreateResource

func (b *InMemoryBackend) CreateResource(restAPIID, parentID, pathPart string) (*Resource, error)

CreateResource creates a new resource under a parent.

func (*InMemoryBackend) CreateRestAPI

func (b *InMemoryBackend) CreateRestAPI(input CreateRestAPIInput) (*RestAPI, error)

CreateRestAPI creates a new REST API and its root resource.

func (*InMemoryBackend) CreateStage

func (b *InMemoryBackend) CreateStage(input CreateStageInput) (*Stage, error)

CreateStage creates a new deployment stage for a REST API without creating a deployment.

func (*InMemoryBackend) CreateUsagePlan

func (b *InMemoryBackend) CreateUsagePlan(input CreateUsagePlanInput) (*UsagePlan, error)

CreateUsagePlan creates a new usage plan.

func (*InMemoryBackend) CreateUsagePlanKey

func (b *InMemoryBackend) CreateUsagePlanKey(input CreateUsagePlanKeyInput) (*UsagePlanKey, error)

CreateUsagePlanKey associates an API key with a usage plan.

func (b *InMemoryBackend) CreateVpcLink(input CreateVpcLinkInput) (*VpcLink, error)

CreateVpcLink creates a new VPC link.

func (*InMemoryBackend) DeleteAPIKey

func (b *InMemoryBackend) DeleteAPIKey(id string) error

DeleteAPIKey removes an API key by ID.

func (*InMemoryBackend) DeleteAuthorizer

func (b *InMemoryBackend) DeleteAuthorizer(restAPIID, authorizerID string) error

DeleteAuthorizer removes an authorizer from a REST API.

func (*InMemoryBackend) DeleteBasePathMapping

func (b *InMemoryBackend) DeleteBasePathMapping(domainName, basePath string) error

DeleteBasePathMapping removes a base path mapping by domain + path.

func (*InMemoryBackend) DeleteClientCertificate

func (b *InMemoryBackend) DeleteClientCertificate(id string) error

DeleteClientCertificate removes a client certificate.

func (*InMemoryBackend) DeleteDeployment

func (b *InMemoryBackend) DeleteDeployment(restAPIID, deploymentID string) error

DeleteDeployment removes a deployment from a REST API.

func (*InMemoryBackend) DeleteDocumentationPart

func (b *InMemoryBackend) DeleteDocumentationPart(restAPIID, docPartID string) error

DeleteDocumentationPart removes a documentation part by ID.

func (*InMemoryBackend) DeleteDocumentationVersion

func (b *InMemoryBackend) DeleteDocumentationVersion(restAPIID, version string) error

DeleteDocumentationVersion removes a documentation version by version string.

func (*InMemoryBackend) DeleteDomainName

func (b *InMemoryBackend) DeleteDomainName(name string) error

DeleteDomainName removes a domain name by value.

func (*InMemoryBackend) DeleteDomainNameAccessAssociation

func (b *InMemoryBackend) DeleteDomainNameAccessAssociation(arn string) error

DeleteDomainNameAccessAssociation removes a domain name access association by ARN.

func (*InMemoryBackend) DeleteGatewayResponse

func (b *InMemoryBackend) DeleteGatewayResponse(restAPIID, responseType string) error

DeleteGatewayResponse removes a custom gateway response, reverting to default.

func (*InMemoryBackend) DeleteIntegration

func (b *InMemoryBackend) DeleteIntegration(restAPIID, resourceID, httpMethod string) error

DeleteIntegration removes the integration from a method.

func (*InMemoryBackend) DeleteIntegrationResponse

func (b *InMemoryBackend) DeleteIntegrationResponse(restAPIID, resourceID, httpMethod, statusCode string) error

DeleteIntegrationResponse removes an integration response from a method integration.

func (*InMemoryBackend) DeleteMethod

func (b *InMemoryBackend) DeleteMethod(restAPIID, resourceID, httpMethod string) error

DeleteMethod removes a method from a resource.

func (*InMemoryBackend) DeleteMethodResponse

func (b *InMemoryBackend) DeleteMethodResponse(restAPIID, resourceID, httpMethod, statusCode string) error

DeleteMethodResponse removes a method response from a method.

func (*InMemoryBackend) DeleteModel

func (b *InMemoryBackend) DeleteModel(restAPIID, modelName string) error

DeleteModel removes a model from a REST API by name.

func (*InMemoryBackend) DeleteRequestValidator

func (b *InMemoryBackend) DeleteRequestValidator(restAPIID, validatorID string) error

DeleteRequestValidator removes a request validator from a REST API.

func (*InMemoryBackend) DeleteResource

func (b *InMemoryBackend) DeleteResource(restAPIID, resourceID string) error

DeleteResource removes a resource.

func (*InMemoryBackend) DeleteRestAPI

func (b *InMemoryBackend) DeleteRestAPI(restAPIID string) error

DeleteRestAPI removes a REST API and all its resources.

func (*InMemoryBackend) DeleteStage

func (b *InMemoryBackend) DeleteStage(restAPIID, stageName string) error

DeleteStage removes a stage.

func (*InMemoryBackend) DeleteUsagePlan

func (b *InMemoryBackend) DeleteUsagePlan(id string) error

DeleteUsagePlan removes a usage plan by ID along with its key associations.

func (*InMemoryBackend) DeleteUsagePlanKey

func (b *InMemoryBackend) DeleteUsagePlanKey(usagePlanID, keyID string) error

DeleteUsagePlanKey removes a key from a usage plan.

func (b *InMemoryBackend) DeleteVpcLink(id string) error

DeleteVpcLink removes a VPC link.

func (*InMemoryBackend) EnforceUsagePlan

func (b *InMemoryBackend) EnforceUsagePlan(apiID, stageName, keyID string) error

EnforceUsagePlan applies usage-plan quota and throttle limits for an API key on the given API stage. It returns nil when the request is allowed or when the key is not associated with a usage plan for the stage (unmetered, matching a bare API key), ErrQuotaExceeded when the period quota is exhausted, or ErrThrottled when the rate/burst limit is exceeded.

func (*InMemoryBackend) GenerateClientCertificate

func (b *InMemoryBackend) GenerateClientCertificate(input GenerateClientCertificateInput) (*ClientCertificate, error)

GenerateClientCertificate creates a new client certificate for mutual TLS.

func (*InMemoryBackend) GetAPIKey

func (b *InMemoryBackend) GetAPIKey(id string) (*APIKey, error)

GetAPIKey retrieves an API key by ID.

func (*InMemoryBackend) GetAPIKeyByValue

func (b *InMemoryBackend) GetAPIKeyByValue(value string) (*APIKey, error)

GetAPIKeyByValue retrieves an API key by its value (the secret string sent in x-api-key). It resolves the key in O(1) via the value→ID index instead of a linear scan, because it runs on the hot data-plane path for every apiKey-required request.

func (*InMemoryBackend) GetAPIKeys

func (b *InMemoryBackend) GetAPIKeys() ([]APIKey, error)

GetAPIKeys returns all API keys sorted by ID.

func (*InMemoryBackend) GetAPIKeysPage

func (b *InMemoryBackend) GetAPIKeysPage(limit int, position string) ([]APIKey, string, error)

GetAPIKeysPage returns API keys with cursor-based pagination.

func (*InMemoryBackend) GetAccount

func (b *InMemoryBackend) GetAccount() (*Account, error)

GetAccount returns the mock API Gateway account settings.

func (*InMemoryBackend) GetAuthorizer

func (b *InMemoryBackend) GetAuthorizer(restAPIID, authorizerID string) (*Authorizer, error)

GetAuthorizer retrieves an authorizer by ID.

func (*InMemoryBackend) GetAuthorizers

func (b *InMemoryBackend) GetAuthorizers(restAPIID string) ([]Authorizer, error)

GetAuthorizers returns all authorizers for a REST API.

func (*InMemoryBackend) GetBasePathMapping

func (b *InMemoryBackend) GetBasePathMapping(domainName, basePath string) (*BasePathMapping, error)

GetBasePathMapping retrieves a base path mapping by domain + path.

func (*InMemoryBackend) GetBasePathMappings

func (b *InMemoryBackend) GetBasePathMappings(domainName string) ([]BasePathMapping, error)

GetBasePathMappings returns all base path mappings for a domain name.

func (*InMemoryBackend) GetClientCertificate

func (b *InMemoryBackend) GetClientCertificate(id string) (*ClientCertificate, error)

GetClientCertificate returns a client certificate by ID.

func (*InMemoryBackend) GetClientCertificates

func (b *InMemoryBackend) GetClientCertificates() ([]ClientCertificate, error)

GetClientCertificates returns all client certificates.

func (*InMemoryBackend) GetDeployment

func (b *InMemoryBackend) GetDeployment(restAPIID, deploymentID string) (*Deployment, error)

GetDeployment returns a single deployment by ID.

func (*InMemoryBackend) GetDeployments

func (b *InMemoryBackend) GetDeployments(restAPIID string) ([]Deployment, error)

GetDeployments returns all deployments for a REST API.

func (*InMemoryBackend) GetDocumentationPart

func (b *InMemoryBackend) GetDocumentationPart(restAPIID, docPartID string) (*DocumentationPart, error)

GetDocumentationPart retrieves a documentation part by ID.

func (*InMemoryBackend) GetDocumentationParts

func (b *InMemoryBackend) GetDocumentationParts(restAPIID string) ([]DocumentationPart, error)

GetDocumentationParts returns all documentation parts for a REST API sorted by ID.

func (*InMemoryBackend) GetDocumentationVersion

func (b *InMemoryBackend) GetDocumentationVersion(restAPIID, version string) (*DocumentationVersion, error)

GetDocumentationVersion retrieves a documentation version by version string.

func (*InMemoryBackend) GetDocumentationVersions

func (b *InMemoryBackend) GetDocumentationVersions(restAPIID string) ([]DocumentationVersion, error)

GetDocumentationVersions returns all documentation versions for a REST API sorted by version.

func (*InMemoryBackend) GetDomainName

func (b *InMemoryBackend) GetDomainName(name string) (*DomainName, error)

GetDomainName retrieves a domain name by value.

func (*InMemoryBackend) GetDomainNameAccessAssociations

func (b *InMemoryBackend) GetDomainNameAccessAssociations(resourceOwner string) ([]DomainNameAccessAssociation, error)

GetDomainNameAccessAssociations lists domain name access associations owned by this account. resourceOwner selects SELF (default) or OTHER_ACCOUNTS; since this backend only ever creates associations under the caller's own account, OTHER_ACCOUNTS always returns an empty list.

func (*InMemoryBackend) GetDomainNames

func (b *InMemoryBackend) GetDomainNames() ([]DomainName, error)

GetDomainNames returns all domain names sorted by name.

func (*InMemoryBackend) GetDomainNamesPage

func (b *InMemoryBackend) GetDomainNamesPage(limit int, position string) ([]DomainName, string, error)

GetDomainNamesPage returns domain names with cursor-based pagination.

func (*InMemoryBackend) GetExport

func (b *InMemoryBackend) GetExport(restAPIID, stageName, exportType string) (map[string]any, error)

GetExport generates an OpenAPI 2.0 (Swagger) or OAS 3.0 export of the REST API. exportType "oas30" produces OpenAPI 3.0.1; any other value produces Swagger 2.0.

func (*InMemoryBackend) GetGatewayResponse

func (b *InMemoryBackend) GetGatewayResponse(restAPIID, responseType string) (*GatewayResponse, error)

GetGatewayResponse retrieves a gateway response by type.

func (*InMemoryBackend) GetGatewayResponses

func (b *InMemoryBackend) GetGatewayResponses(restAPIID string) ([]GatewayResponse, error)

GetGatewayResponses retrieves all gateway responses for a REST API.

func (*InMemoryBackend) GetIntegration

func (b *InMemoryBackend) GetIntegration(restAPIID, resourceID, httpMethod string) (*Integration, error)

GetIntegration retrieves the integration for a method.

func (*InMemoryBackend) GetIntegrationResponse

func (b *InMemoryBackend) GetIntegrationResponse(
	restAPIID, resourceID, httpMethod, statusCode string,
) (*IntegrationResponse, error)

GetIntegrationResponse retrieves an integration response for a given status code.

func (*InMemoryBackend) GetMethod

func (b *InMemoryBackend) GetMethod(restAPIID, resourceID, httpMethod string) (*Method, error)

GetMethod retrieves a method on a resource.

func (*InMemoryBackend) GetMethodResponse

func (b *InMemoryBackend) GetMethodResponse(
	restAPIID, resourceID, httpMethod, statusCode string,
) (*MethodResponse, error)

GetMethodResponse retrieves a method response for a given status code.

func (*InMemoryBackend) GetModel

func (b *InMemoryBackend) GetModel(restAPIID, modelName string) (*Model, error)

GetModel retrieves a model by name within a REST API.

func (*InMemoryBackend) GetModelTemplate

func (b *InMemoryBackend) GetModelTemplate(restAPIID, modelName string) (string, error)

GetModelTemplate returns the default template for a model.

func (*InMemoryBackend) GetModels

func (b *InMemoryBackend) GetModels(restAPIID string) ([]Model, error)

GetModels returns all models for a REST API sorted by name.

func (*InMemoryBackend) GetRequestValidator

func (b *InMemoryBackend) GetRequestValidator(restAPIID, validatorID string) (*RequestValidator, error)

GetRequestValidator retrieves a request validator by ID.

func (*InMemoryBackend) GetRequestValidators

func (b *InMemoryBackend) GetRequestValidators(restAPIID string) ([]RequestValidator, error)

GetRequestValidators returns all request validators for a REST API.

func (*InMemoryBackend) GetResource

func (b *InMemoryBackend) GetResource(restAPIID, resourceID string) (*Resource, error)

GetResource returns a single resource.

func (*InMemoryBackend) GetResourceTags

func (b *InMemoryBackend) GetResourceTags(resourceARN string) (map[string]string, error)

GetResourceTags returns the tags for a resource identified by its ARN.

func (*InMemoryBackend) GetResources

func (b *InMemoryBackend) GetResources(restAPIID, position string, limit int) ([]Resource, string, error)

GetResources returns all resources for a REST API with pagination.

func (*InMemoryBackend) GetRestAPI

func (b *InMemoryBackend) GetRestAPI(restAPIID string) (*RestAPI, error)

GetRestAPI returns a single REST API.

func (*InMemoryBackend) GetRestAPIs

func (b *InMemoryBackend) GetRestAPIs(limit int, position string) ([]RestAPI, string, error)

GetRestAPIs returns all REST APIs with pagination.

func (*InMemoryBackend) GetSdk

func (b *InMemoryBackend) GetSdk(restAPIID, stageName, sdkType string) (*SdkExport, error)

GetSdk generates an SDK package for the given REST API/stage/language. A full per-language code generator is out of scope for an emulator, so the package is a real ZIP archive containing the API's actual OpenAPI export (reusing the same generator as GetExport) plus a README describing the requested SDK type — real API configuration, packaged in the correct wire/container format, rather than a fabricated empty blob.

func (*InMemoryBackend) GetSdkType

func (b *InMemoryBackend) GetSdkType(id string) (*SdkType, error)

GetSdkType looks up a single SDK type by ID from the fixed catalog.

func (*InMemoryBackend) GetSdkTypes

func (b *InMemoryBackend) GetSdkTypes() []SdkType

GetSdkTypes returns the fixed catalog of SDK types.

func (*InMemoryBackend) GetStage

func (b *InMemoryBackend) GetStage(restAPIID, stageName string) (*Stage, error)

GetStage returns a single stage.

func (*InMemoryBackend) GetStages

func (b *InMemoryBackend) GetStages(restAPIID string) ([]Stage, error)

GetStages returns all stages for a REST API.

func (*InMemoryBackend) GetUsage

func (b *InMemoryBackend) GetUsage(input GetUsageInput) (*UsageData, error)

GetUsage returns real per-key usage data for a usage plan. Each item is keyed by API key ID and contains a [used, remaining] pair reflecting the requests the data plane has actually metered against the plan's quota. If a key's remaining quota was explicitly overridden via UpdateUsage, that override takes precedence over the computed remaining value (mirroring AWS's "temporary extension to the remaining quota" semantics for UpdateUsage).

func (*InMemoryBackend) GetUsagePlan

func (b *InMemoryBackend) GetUsagePlan(id string) (*UsagePlan, error)

GetUsagePlan retrieves a usage plan by ID.

func (*InMemoryBackend) GetUsagePlanKey

func (b *InMemoryBackend) GetUsagePlanKey(usagePlanID, keyID string) (*UsagePlanKey, error)

GetUsagePlanKey retrieves a single key from a usage plan.

func (*InMemoryBackend) GetUsagePlanKeys

func (b *InMemoryBackend) GetUsagePlanKeys(usagePlanID string) ([]UsagePlanKey, error)

GetUsagePlanKeys returns all keys for a usage plan sorted by ID.

func (*InMemoryBackend) GetUsagePlans

func (b *InMemoryBackend) GetUsagePlans() ([]UsagePlan, error)

GetUsagePlans returns all usage plans sorted by ID.

func (*InMemoryBackend) GetUsagePlansPage

func (b *InMemoryBackend) GetUsagePlansPage(limit int, position string) ([]UsagePlan, string, error)

GetUsagePlansPage returns usage plans with cursor-based pagination.

func (b *InMemoryBackend) GetVpcLink(id string) (*VpcLink, error)

GetVpcLink retrieves a VPC link by ID.

func (b *InMemoryBackend) GetVpcLinks() ([]VpcLink, error)

GetVpcLinks retrieves all VPC links.

func (*InMemoryBackend) ImportAPIKeys

func (b *InMemoryBackend) ImportAPIKeys(body []byte, format string, failOnWarnings bool) ([]string, []string, error)

ImportAPIKeys parses a CSV payload of API keys in AWS's "API Key File Format": a header row naming columns (name, key, description, enabled), followed by one data row per key. Rows that fail to import are reported as warnings rather than aborting the whole batch; when failOnWarnings is true, any warning rolls the entire import back and returns an error instead.

func (*InMemoryBackend) ImportDocumentationParts

func (b *InMemoryBackend) ImportDocumentationParts(
	restAPIID string, body []byte, mode string, failOnWarnings bool,
) ([]string, []string, error)

ImportDocumentationParts parses a documentationParts JSON payload and creates a real DocumentationPart for each entry. mode "overwrite" clears all existing documentation parts for the API before importing; any other value merges the new parts into the existing set. Failures are reported as warnings; when failOnWarnings is true, any warning rolls the whole import back and returns an error instead.

func (*InMemoryBackend) ImportRestAPI

func (b *InMemoryBackend) ImportRestAPI(input ImportRestAPIInput) (*RestAPI, error)

ImportRestAPI creates a brand-new REST API from an OpenAPI/Swagger document, materialising resources, methods, integrations, responses and models.

func (*InMemoryBackend) PutGatewayResponse

func (b *InMemoryBackend) PutGatewayResponse(input PutGatewayResponseInput) (*GatewayResponse, error)

PutGatewayResponse creates or updates a gateway response.

func (*InMemoryBackend) PutIntegration

func (b *InMemoryBackend) PutIntegration(
	restAPIID, resourceID, httpMethod string,
	input PutIntegrationInput,
) (*Integration, error)

PutIntegration creates or replaces an integration on a method.

func (*InMemoryBackend) PutIntegrationResponse

func (b *InMemoryBackend) PutIntegrationResponse(
	restAPIID, resourceID, httpMethod, statusCode string,
	input PutIntegrationResponseInput,
) (*IntegrationResponse, error)

PutIntegrationResponse creates or replaces an integration response.

func (*InMemoryBackend) PutMethod

func (b *InMemoryBackend) PutMethod(input PutMethodInput) (*Method, error)

PutMethod creates or replaces a method on a resource.

func (*InMemoryBackend) PutMethodResponse

func (b *InMemoryBackend) PutMethodResponse(
	restAPIID, resourceID, httpMethod, statusCode string,
	input PutMethodResponseInput,
) (*MethodResponse, error)

PutMethodResponse creates or replaces a method response on a method.

func (*InMemoryBackend) PutRestAPI

func (b *InMemoryBackend) PutRestAPI(input PutRestAPIInput) (*RestAPI, error)

PutRestAPI imports an OpenAPI/Swagger document into an existing API. mode "overwrite" replaces the resource tree; "merge" (default) layers the imported paths on top of the existing tree.

func (*InMemoryBackend) RejectDomainNameAccessAssociation

func (b *InMemoryBackend) RejectDomainNameAccessAssociation(arn, domainNameARN string) error

RejectDomainNameAccessAssociation rejects (removes) a domain name access association, validating that it belongs to the given domain name ARN.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all in-memory state from the backend. It is used by the POST /_gopherstack/reset endpoint for CI pipelines and rapid local development.

func (*InMemoryBackend) ResourcesForRouting

func (b *InMemoryBackend) ResourcesForRouting(restAPIID string) ([]Resource, uint64, error)

ResourcesForRouting returns every resource for the API plus a version counter that changes on any resource-set mutation. Unlike GetResources it is not paginated: the data-plane proxy needs the complete set to build a routing trie, and it uses the version to cache that trie across requests instead of rebuilding it every time.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(resourceARN string, newTags map[string]string) error

TagResource adds or updates tags on a resource identified by its ARN.

func (*InMemoryBackend) TaggedResources added in v1.3.1

func (b *InMemoryBackend) TaggedResources() []TaggedEntry

TaggedResources returns every taggable API Gateway resource that carries at least one tag, across all seven kinds resolveTaggableARN accepts.

func (*InMemoryBackend) TestInvokeAuthorizer

TestInvokeAuthorizer performs a mock test invocation of an authorizer.

func (*InMemoryBackend) TestInvokeMethod

func (b *InMemoryBackend) TestInvokeMethod(input TestInvokeMethodInput) (*TestInvokeMethodOutput, error)

TestInvokeMethod performs a test invocation of a method, returning a mock 200 response.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error

UntagResource removes tags from a resource identified by its ARN.

func (*InMemoryBackend) UpdateAPIKey

func (b *InMemoryBackend) UpdateAPIKey(id string, input UpdateAPIKeyInput) (*APIKey, error)

UpdateAPIKey updates mutable fields on an existing API key.

func (*InMemoryBackend) UpdateAccount

func (b *InMemoryBackend) UpdateAccount(input UpdateAccountInput) (*Account, error)

UpdateAccount updates the account's throttle settings.

func (*InMemoryBackend) UpdateAuthorizer

func (b *InMemoryBackend) UpdateAuthorizer(
	restAPIID, authorizerID string,
	input UpdateAuthorizerInput,
) (*Authorizer, error)

UpdateAuthorizer updates fields on an existing authorizer.

func (*InMemoryBackend) UpdateBasePathMapping

func (b *InMemoryBackend) UpdateBasePathMapping(input UpdateBasePathMappingInput) (*BasePathMapping, error)

UpdateBasePathMapping updates an existing base path mapping.

func (*InMemoryBackend) UpdateClientCertificate

func (b *InMemoryBackend) UpdateClientCertificate(input UpdateClientCertificateInput) (*ClientCertificate, error)

UpdateClientCertificate updates the description of a client certificate.

func (*InMemoryBackend) UpdateDeployment

func (b *InMemoryBackend) UpdateDeployment(
	restAPIID, deploymentID string,
	input UpdateDeploymentInput,
) (*Deployment, error)

UpdateDeployment updates the description of a deployment.

func (*InMemoryBackend) UpdateDocumentationPart

func (b *InMemoryBackend) UpdateDocumentationPart(input UpdateDocumentationPartInput) (*DocumentationPart, error)

UpdateDocumentationPart updates the properties of a documentation part.

func (*InMemoryBackend) UpdateDocumentationVersion

func (b *InMemoryBackend) UpdateDocumentationVersion(
	input UpdateDocumentationVersionInput,
) (*DocumentationVersion, error)

UpdateDocumentationVersion updates a documentation version's description.

func (*InMemoryBackend) UpdateDomainName

func (b *InMemoryBackend) UpdateDomainName(input UpdateDomainNameInput) (*DomainName, error)

UpdateDomainName applies a partial update to a domain name's mutable fields.

func (*InMemoryBackend) UpdateGatewayResponse

func (b *InMemoryBackend) UpdateGatewayResponse(input PutGatewayResponseInput) (*GatewayResponse, error)

UpdateGatewayResponse applies a partial (PATCH) update to a gateway response, merging only the fields present in input with the existing response (or with AWS's implicit default response for responseType, if none has been customized yet). Unlike PutGatewayResponse — which is a full wholesale replace used by the real PUT operation — UpdateGatewayResponse must not clobber ResponseParameters/ResponseTemplates/StatusCode that weren't part of this PATCH document, matching AWS's PATCH-operation semantics for this resource.

func (*InMemoryBackend) UpdateIntegration

func (b *InMemoryBackend) UpdateIntegration(input UpdateIntegrationInput) (*Integration, error)

UpdateIntegration updates an integration's URI or type.

func (*InMemoryBackend) UpdateIntegrationResponse

func (b *InMemoryBackend) UpdateIntegrationResponse(
	input UpdateIntegrationResponseInput,
) (*IntegrationResponse, error)

UpdateIntegrationResponse updates an integration response's templates or selection pattern.

func (*InMemoryBackend) UpdateMethod

func (b *InMemoryBackend) UpdateMethod(input UpdateMethodInput) (*Method, error)

UpdateMethod updates method settings (authorization, API key requirement, etc.)

func (*InMemoryBackend) UpdateMethodResponse

func (b *InMemoryBackend) UpdateMethodResponse(input UpdateMethodResponseInput) (*MethodResponse, error)

UpdateMethodResponse updates a method response's models or parameters.

func (*InMemoryBackend) UpdateModel

func (b *InMemoryBackend) UpdateModel(restAPIID, modelName string, input UpdateModelInput) (*Model, error)

UpdateModel updates description and schema on a model.

func (*InMemoryBackend) UpdateRequestValidator

func (b *InMemoryBackend) UpdateRequestValidator(
	restAPIID, validatorID string,
	input UpdateRequestValidatorInput,
) (*RequestValidator, error)

UpdateRequestValidator updates fields on an existing request validator.

func (*InMemoryBackend) UpdateResource

func (b *InMemoryBackend) UpdateResource(restAPIID, resourceID string, input UpdateResourceInput) (*Resource, error)

UpdateResource updates the pathPart and/or parent of a resource (recomputing Path for it and its whole subtree if either changed), or sets CORS.

func (*InMemoryBackend) UpdateRestAPI

func (b *InMemoryBackend) UpdateRestAPI(restAPIID string, input UpdateRestAPIInput) (*RestAPI, error)

UpdateRestAPI updates the name and/or description of a REST API.

func (*InMemoryBackend) UpdateStage

func (b *InMemoryBackend) UpdateStage(restAPIID, stageName string, input UpdateStageInput) (*Stage, error)

UpdateStage updates mutable fields on a deployment stage.

func (*InMemoryBackend) UpdateUsage

func (b *InMemoryBackend) UpdateUsage(usagePlanID, keyID string, patchedFields map[string]string) (*UsageData, error)

UpdateUsage validates that the usage plan and API key association exist and records a remaining-quota override for that key, so a subsequent GetUsage call reflects the change. Real AWS's only supported UpdateUsage patch path is the single-segment scalar "/remaining" (see patch-operations.html's UpdateUsage table — there is no per-date path segment, unlike the superficially similar per-route paths on UpdateStage/UpdateUsagePlan), so handler.go's applyStructuredPatch flattens the request into a single "remaining" -> value entry via the generic top-level fallback and this method only ever needs the value, not the key; patchedFields is still a map (rather than a single value) purely to reuse that generic flattening path. non-integer values are ignored. Real API Gateway quota-consumption tracking (based on live request traffic) isn't modeled by this emulator — as with GetUsage's Items, which are always empty absent real traffic — but the override recorded here is genuinely read back by GetUsage.

func (*InMemoryBackend) UpdateUsagePlan

func (b *InMemoryBackend) UpdateUsagePlan(input UpdateUsagePlanInput) (*UsagePlan, error)

UpdateUsagePlan updates a usage plan's name, description, throttle, or quota.

func (b *InMemoryBackend) UpdateVpcLink(input UpdateVpcLinkInput) (*VpcLink, error)

UpdateVpcLink updates the name or description of a VPC link.

type Integration

type Integration struct {
	RequestTemplates     map[string]string               `json:"requestTemplates,omitempty"`
	RequestParameters    map[string]string               `json:"requestParameters,omitempty"`
	IntegrationResponses map[string]*IntegrationResponse `json:"integrationResponses,omitempty"`
	ConnectionID         string                          `json:"connectionId,omitempty"`
	Type                 string                          `json:"type"`
	HTTPMethod           string                          `json:"httpMethod,omitempty"`
	URI                  string                          `json:"uri,omitempty"`
	PassthroughBehavior  string                          `json:"passthroughBehavior,omitempty"`
	ConnectionType       string                          `json:"connectionType,omitempty"`
	ContentHandling      string                          `json:"contentHandling,omitempty"`
	Credentials          string                          `json:"credentials,omitempty"`
	CacheNamespace       string                          `json:"cacheNamespace,omitempty"`
	CacheKeyParameters   []string                        `json:"cacheKeyParameters,omitempty"`
	TimeoutInMillis      int                             `json:"timeoutInMillis,omitempty"`
}

Integration represents a method integration.

type IntegrationResponse

type IntegrationResponse struct {
	ResponseTemplates  map[string]string `json:"responseTemplates,omitempty"`
	ResponseParameters map[string]string `json:"responseParameters,omitempty"`
	StatusCode         string            `json:"statusCode"`
	SelectionPattern   string            `json:"selectionPattern,omitempty"`
	ContentHandling    string            `json:"contentHandling,omitempty"`
}

IntegrationResponse represents a response from an integration.

type JWKSProvider

type JWKSProvider interface {
	GetJWTPublicKey(issuerURL, kid string) (*rsa.PublicKey, error)
}

JWKSProvider resolves RSA public keys for JWT signature verification. Implementations return an error when the issuer or key is unknown.

type LambdaInvoker

type LambdaInvoker interface {
	InvokeFunction(ctx context.Context, name, invocationType string, payload []byte) ([]byte, int, error)
}

LambdaInvoker can invoke a Lambda function by name/ARN.

type LambdaProxyContext

type LambdaProxyContext struct {
	Authorizer   map[string]any `json:"authorizer,omitempty"`
	ResourcePath string         `json:"resourcePath"`
	HTTPMethod   string         `json:"httpMethod"`
	Stage        string         `json:"stage"`
	APIId        string         `json:"apiId"`
	RequestID    string         `json:"requestId,omitempty"`
}

LambdaProxyContext provides context for the Lambda proxy event.

type LambdaProxyEvent

type LambdaProxyEvent struct {
	QueryStringParameters map[string]string   `json:"queryStringParameters,omitempty"`
	Headers               map[string]string   `json:"headers,omitempty"`
	MultiValueHeaders     map[string][]string `json:"multiValueHeaders,omitempty"`
	PathParameters        map[string]string   `json:"pathParameters,omitempty"`
	MultiValueQueryString map[string][]string `json:"multiValueQueryStringParameters,omitempty"`
	StageVariables        map[string]string   `json:"stageVariables,omitempty"`
	RequestContext        LambdaProxyContext  `json:"requestContext"`
	Resource              string              `json:"resource"`
	Path                  string              `json:"path"`
	HTTPMethod            string              `json:"httpMethod"`
	Body                  string              `json:"body,omitempty"`
	IsBase64Encoded       bool                `json:"isBase64Encoded"`
}

LambdaProxyEvent is the API Gateway Lambda proxy event format. https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html

func BuildProxyEvent

func BuildProxyEvent(
	r *http.Request,
	apiID, stageName, resource, path string,
	pathParameters map[string]string,
) (*LambdaProxyEvent, error)

BuildProxyEvent converts an incoming HTTP request to a Lambda proxy event. pathParameters are the path variable values extracted by the routing engine (may be nil).

type LambdaProxyResponse

type LambdaProxyResponse struct {
	Headers         map[string]string `json:"headers,omitempty"`
	Body            string            `json:"body,omitempty"`
	StatusCode      int               `json:"statusCode"`
	IsBase64Encoded bool              `json:"isBase64Encoded,omitempty"`
}

LambdaProxyResponse is the response format from a Lambda proxy function.

type Method

type Method struct {
	RequestParameters  map[string]bool            `json:"requestParameters,omitempty"`
	RequestModels      map[string]string          `json:"requestModels,omitempty"`
	MethodIntegration  *Integration               `json:"methodIntegration,omitempty"`
	MethodResponses    map[string]*MethodResponse `json:"methodResponses,omitempty"`
	HTTPMethod         string                     `json:"httpMethod"`
	AuthorizationType  string                     `json:"authorizationType"`
	AuthorizerID       string                     `json:"authorizerId,omitempty"`
	RequestValidatorID string                     `json:"requestValidatorId,omitempty"`
	OperationName      string                     `json:"operationName,omitempty"`
	APIKeyRequired     bool                       `json:"apiKeyRequired"`
}

Method represents an API Gateway method on a resource.

type MethodResponse

type MethodResponse struct {
	ResponseModels     map[string]string `json:"responseModels,omitempty"`
	ResponseParameters map[string]bool   `json:"responseParameters,omitempty"`
	StatusCode         string            `json:"statusCode"`
}

MethodResponse represents a method response configuration.

type MethodSetting

type MethodSetting struct {
	LoggingLevel                           string  `json:"loggingLevel,omitempty"`
	UnauthorizedCacheControlHeaderStrategy string  `json:"unauthorizedCacheControlHeaderStrategy,omitempty"`
	ThrottlingRateLimit                    float64 `json:"throttlingRateLimit,omitempty"`
	ThrottlingBurstLimit                   int     `json:"throttlingBurstLimit,omitempty"`
	CacheTTLInSeconds                      int     `json:"cacheTtlInSeconds,omitempty"`
	DataTraceEnabled                       bool    `json:"dataTraceEnabled,omitempty"`
	MetricsEnabled                         bool    `json:"metricsEnabled,omitempty"`
	CachingEnabled                         bool    `json:"cachingEnabled,omitempty"`
	CacheDataEncrypted                     bool    `json:"cacheDataEncrypted,omitempty"`
	RequireAuthorizationForCacheControl    bool    `json:"requireAuthorizationForCacheControl,omitempty"`
}

MethodSetting holds per-method CloudWatch logging and throttling settings.

type MethodSnapshot added in v1.3.1

type MethodSnapshot struct {
	AuthorizationType string `json:"authorizationType,omitempty"`
	APIKeyRequired    bool   `json:"apiKeyRequired,omitempty"`
}

MethodSnapshot records one method's authorization settings as captured by a deployment's APISummary (aws-sdk-go-v2/service/apigateway/types.MethodSnapshot).

type Model

type Model struct {
	ID          string `json:"id"`
	RestAPIID   string `json:"-"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	ContentType string `json:"contentType,omitempty"`
	Schema      string `json:"schema,omitempty"`
}

Model represents a data model for a REST API.

type MutualTLSAuthentication added in v1.3.1

type MutualTLSAuthentication struct {
	TruststoreURI      string   `json:"truststoreUri,omitempty"`
	TruststoreVersion  string   `json:"truststoreVersion,omitempty"`
	TruststoreWarnings []string `json:"truststoreWarnings,omitempty"`
}

MutualTLSAuthentication configures mutual TLS authentication for a custom domain name (aws-sdk-go-v2/service/apigateway/types.MutualTlsAuthentication).

type PolicyDocument

type PolicyDocument struct {
	Version   string            `json:"Version,omitempty"`
	Statement []PolicyStatement `json:"Statement"`
}

PolicyDocument is an IAM policy document as returned by Lambda authorizers.

type PolicyStatement

type PolicyStatement struct {
	Action   any    `json:"Action"`
	Resource any    `json:"Resource"`
	Effect   string `json:"Effect"`
}

PolicyStatement is a single statement within an IAM policy document.

type Provider

type Provider struct{}

Provider implements service.Provider for the API Gateway service.

func (*Provider) Init

Init initializes the API Gateway service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the logical name of the provider.

type PutGatewayResponseInput

type PutGatewayResponseInput struct {
	StatusCode         string            `json:"statusCode,omitempty"`
	ResponseParameters map[string]string `json:"responseParameters,omitempty"`
	ResponseTemplates  map[string]string `json:"responseTemplates,omitempty"`
	RestAPIID          string            `json:"restApiId"`
	ResponseType       string            `json:"responseType"`
}

PutGatewayResponseInput is the input for PutGatewayResponse.

type PutIntegrationInput

type PutIntegrationInput struct {
	RequestTemplates    map[string]string `json:"requestTemplates,omitempty"`
	RequestParameters   map[string]string `json:"requestParameters,omitempty"`
	PassthroughBehavior string            `json:"passthroughBehavior,omitempty"`
	Type                string            `json:"type"`
	HTTPMethod          string            `json:"httpMethod,omitempty"`
	URI                 string            `json:"uri,omitempty"`
	ConnectionType      string            `json:"connectionType,omitempty"`
	ConnectionID        string            `json:"connectionId,omitempty"`
	ContentHandling     string            `json:"contentHandling,omitempty"`
	Credentials         string            `json:"credentials,omitempty"`
	CacheNamespace      string            `json:"cacheNamespace,omitempty"`
	CacheKeyParameters  []string          `json:"cacheKeyParameters,omitempty"`
	TimeoutInMillis     int               `json:"timeoutInMillis,omitempty"`
}

PutIntegrationInput is the input for PutIntegration.

type PutIntegrationResponseInput

type PutIntegrationResponseInput struct {
	ResponseTemplates  map[string]string `json:"responseTemplates,omitempty"`
	ResponseParameters map[string]string `json:"responseParameters,omitempty"`
	SelectionPattern   string            `json:"selectionPattern,omitempty"`
	ContentHandling    string            `json:"contentHandling,omitempty"`
}

PutIntegrationResponseInput is the input for PutIntegrationResponse.

type PutMethodInput

type PutMethodInput struct {
	RequestParameters  map[string]bool   `json:"requestParameters,omitempty"`
	RequestModels      map[string]string `json:"requestModels,omitempty"`
	RestAPIID          string            `json:"restApiId"`
	ResourceID         string            `json:"resourceId"`
	HTTPMethod         string            `json:"httpMethod"`
	AuthorizationType  string            `json:"authorizationType"`
	AuthorizerID       string            `json:"authorizerId,omitempty"`
	RequestValidatorID string            `json:"requestValidatorId,omitempty"`
	OperationName      string            `json:"operationName,omitempty"`
	APIKeyRequired     bool              `json:"apiKeyRequired"`
}

PutMethodInput is the input for PutMethod.

type PutMethodResponseInput

type PutMethodResponseInput struct {
	ResponseModels     map[string]string `json:"responseModels,omitempty"`
	ResponseParameters map[string]bool   `json:"responseParameters,omitempty"`
}

PutMethodResponseInput is the input for PutMethodResponse.

type PutRestAPIInput

type PutRestAPIInput struct {
	RestAPIID      string `json:"restApiId"`
	Mode           string `json:"mode,omitempty"`
	Body           []byte `json:"body,omitempty"`
	FailOnWarnings bool   `json:"failOnWarnings,omitempty"`
}

PutRestAPIInput is the input for the PutRestApi operation.

type QuotaSettings

type QuotaSettings struct {
	Period string `json:"period,omitempty"`
	Limit  int    `json:"limit,omitempty"`
	Offset int    `json:"offset,omitempty"`
}

QuotaSettings controls request quota limiting for a usage plan.

type RequestValidator

type RequestValidator struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// RestAPIID identifies the owning REST API. Internal storage-layer identity
	// only (composite key for the backend's flat store.Table[RequestValidator]);
	// never part of the wire response — see the identical Authorizer.RestAPIID doc.
	RestAPIID                 string `json:"-"`
	ValidateRequestBody       bool   `json:"validateRequestBody"`
	ValidateRequestParameters bool   `json:"validateRequestParameters"`
}

RequestValidator represents an API Gateway request validator.

type Resource

type Resource struct {
	ResourceMethods   map[string]*Method `json:"resourceMethods,omitempty"`
	CorsConfiguration *CorsConfiguration `json:"corsConfiguration,omitempty"`
	ID                string             `json:"id"`
	ParentID          string             `json:"parentId,omitempty"`
	PathPart          string             `json:"pathPart,omitempty"`
	Path              string             `json:"path"`
	RestAPIID         string             `json:"-"`
}

Resource represents an API Gateway resource.

type RestAPI

type RestAPI struct {
	CreatedDate               unixEpochTime          `json:"createdDate"`
	EndpointConfiguration     *EndpointConfiguration `json:"endpointConfiguration,omitempty"`
	Tags                      *tags.Tags             `json:"tags,omitempty"`
	RootResourceID            string                 `json:"rootResourceId,omitempty"`
	APIStatusMessage          string                 `json:"apiStatusMessage,omitempty"`
	Description               string                 `json:"description,omitempty"`
	ID                        string                 `json:"id"`
	APIKeySource              string                 `json:"apiKeySource,omitempty"`
	Policy                    string                 `json:"policy,omitempty"`
	APIStatus                 string                 `json:"apiStatus,omitempty"`
	Name                      string                 `json:"name"`
	EndpointAccessMode        string                 `json:"endpointAccessMode,omitempty"`
	SecurityPolicy            string                 `json:"securityPolicy,omitempty"`
	Version                   string                 `json:"version,omitempty"`
	BinaryMediaTypes          []string               `json:"binaryMediaTypes,omitempty"`
	Warnings                  []string               `json:"warnings,omitempty"`
	MinimumCompressionSize    int                    `json:"minimumCompressionSize,omitempty"`
	DisableExecuteAPIEndpoint bool                   `json:"disableExecuteApiEndpoint,omitempty"`
}

RestAPI represents an API Gateway REST API.

type SdkExport

type SdkExport struct {
	ContentType        string
	ContentDisposition string
	Body               []byte
}

SdkExport is the binary SDK package returned by GetSdk.

type SdkType

type SdkType struct {
	ID           string
	FriendlyName string
}

SdkType describes a code-generation target supported by GetSdk. AWS documents this fixed set directly on the GetSdk API ("Currently java, javascript, android, objectivec (for iOS), swift (for iOS), and ruby are supported.") — it is not a user-created resource, so the catalog is static.

type Stage

type Stage struct {
	Tags                *tags.Tags               `json:"tags,omitempty"`
	CanarySettings      *CanarySettings          `json:"canarySettings,omitempty"`
	AccessLogSettings   *AccessLogSettings       `json:"accessLogSettings,omitempty"`
	MethodSettings      map[string]MethodSetting `json:"methodSettings,omitempty"`
	Variables           map[string]string        `json:"variables,omitempty"`
	CreatedDate         unixEpochTime            `json:"createdDate"`
	LastUpdatedDate     unixEpochTime            `json:"lastUpdatedDate"`
	StageName           string                   `json:"stageName"`
	RestAPIID           string                   `json:"-"`
	DeploymentID        string                   `json:"deploymentId"`
	Description         string                   `json:"description,omitempty"`
	ClientCertificateID string                   `json:"clientCertificateId,omitempty"`
	// CacheClusterSize is the cache cluster's capacity in GB (e.g. "0.5"), only
	// meaningful when CacheClusterEnabled is true.
	CacheClusterSize string `json:"cacheClusterSize,omitempty"`
	// CacheClusterStatus mirrors AWS's CacheClusterStatus enum
	// (AVAILABLE/NOT_AVAILABLE/...), derived from CacheClusterEnabled.
	CacheClusterStatus string `json:"cacheClusterStatus,omitempty"`
	// InvokeURL is the invoke URL for this stage (non-AWS field used by gopherstack UI).
	InvokeURL string `json:"invokeUrl,omitempty"`
	// DocumentationVersion associates this stage with a snapshot of API
	// documentation (types.Stage.DocumentationVersion in the SDK).
	DocumentationVersion string `json:"documentationVersion,omitempty"`
	// WebACLARN is the ARN of the WAF WebACL associated with this stage
	// (types.Stage.WebAclArn in the SDK). Real AWS associates a WebACL via
	// WAFv2's AssociateWebACL against the stage's ARN, not through any
	// apigateway API -- this emulator has no WAFv2 cross-service wiring, so
	// the field is always empty (and thus omitted), matching an account with
	// no WAF association.
	WebACLARN           string `json:"webAclArn,omitempty"`
	TracingEnabled      bool   `json:"tracingEnabled,omitempty"`
	CacheClusterEnabled bool   `json:"cacheClusterEnabled,omitempty"`
}

Stage represents a deployment stage.

type StageKeyInput added in v1.2.0

type StageKeyInput struct {
	RestAPIID string `json:"restApiId,omitempty"`
	StageName string `json:"stageName,omitempty"`
}

StageKeyInput identifies a REST API stage to associate with an API key at creation time (types.StageKey in the SDK).

type StorageBackend

type StorageBackend interface {
	// REST APIs
	CreateRestAPI(input CreateRestAPIInput) (*RestAPI, error)
	DeleteRestAPI(restAPIID string) error
	GetRestAPI(restAPIID string) (*RestAPI, error)
	GetRestAPIs(limit int, position string) ([]RestAPI, string, error)
	UpdateRestAPI(restAPIID string, input UpdateRestAPIInput) (*RestAPI, error)

	// Resources
	GetResources(restAPIID, position string, limit int) ([]Resource, string, error)
	// ResourcesForRouting returns every resource for an API together with a version
	// counter that changes whenever the API's resource set is mutated. The data-plane
	// proxy uses it to build and cache a routing trie without re-copying the full
	// resource set (and paging past AWS's default page size) on every request.
	ResourcesForRouting(restAPIID string) ([]Resource, uint64, error)
	GetResource(restAPIID, resourceID string) (*Resource, error)
	CreateResource(restAPIID, parentID, pathPart string) (*Resource, error)
	DeleteResource(restAPIID, resourceID string) error
	UpdateResource(restAPIID, resourceID string, input UpdateResourceInput) (*Resource, error)

	// Methods
	PutMethod(input PutMethodInput) (*Method, error)
	GetMethod(restAPIID, resourceID, httpMethod string) (*Method, error)
	DeleteMethod(restAPIID, resourceID, httpMethod string) error

	// Method Responses
	PutMethodResponse(
		restAPIID, resourceID, httpMethod, statusCode string,
		input PutMethodResponseInput,
	) (*MethodResponse, error)
	GetMethodResponse(restAPIID, resourceID, httpMethod, statusCode string) (*MethodResponse, error)
	DeleteMethodResponse(restAPIID, resourceID, httpMethod, statusCode string) error

	// Integrations
	PutIntegration(
		restAPIID, resourceID, httpMethod string,
		input PutIntegrationInput,
	) (*Integration, error)
	GetIntegration(restAPIID, resourceID, httpMethod string) (*Integration, error)
	DeleteIntegration(restAPIID, resourceID, httpMethod string) error

	// Integration Responses
	PutIntegrationResponse(
		restAPIID, resourceID, httpMethod, statusCode string,
		input PutIntegrationResponseInput,
	) (*IntegrationResponse, error)
	GetIntegrationResponse(
		restAPIID, resourceID, httpMethod, statusCode string,
	) (*IntegrationResponse, error)
	DeleteIntegrationResponse(restAPIID, resourceID, httpMethod, statusCode string) error

	// Deployments
	CreateDeployment(restAPIID, stageName, description string) (*Deployment, error)
	GetDeployment(restAPIID, deploymentID string) (*Deployment, error)
	GetDeployments(restAPIID string) ([]Deployment, error)
	DeleteDeployment(restAPIID, deploymentID string) error
	UpdateDeployment(
		restAPIID, deploymentID string,
		input UpdateDeploymentInput,
	) (*Deployment, error)

	// Stages
	GetStages(restAPIID string) ([]Stage, error)
	GetStage(restAPIID, stageName string) (*Stage, error)
	DeleteStage(restAPIID, stageName string) error

	// Authorizers
	CreateAuthorizer(restAPIID string, input CreateAuthorizerInput) (*Authorizer, error)
	GetAuthorizer(restAPIID, authorizerID string) (*Authorizer, error)
	GetAuthorizers(restAPIID string) ([]Authorizer, error)
	UpdateAuthorizer(
		restAPIID, authorizerID string,
		input UpdateAuthorizerInput,
	) (*Authorizer, error)
	DeleteAuthorizer(restAPIID, authorizerID string) error

	// Request Validators
	CreateRequestValidator(
		restAPIID string,
		input CreateRequestValidatorInput,
	) (*RequestValidator, error)
	GetRequestValidator(restAPIID, validatorID string) (*RequestValidator, error)
	GetRequestValidators(restAPIID string) ([]RequestValidator, error)
	UpdateRequestValidator(
		restAPIID, validatorID string,
		input UpdateRequestValidatorInput,
	) (*RequestValidator, error)
	DeleteRequestValidator(restAPIID, validatorID string) error

	// API Keys
	CreateAPIKey(input CreateAPIKeyInput) (*APIKey, error)
	GetAPIKey(id string) (*APIKey, error)
	GetAPIKeyByValue(value string) (*APIKey, error)
	GetAPIKeys() ([]APIKey, error)
	GetAPIKeysPage(limit int, position string) ([]APIKey, string, error)
	DeleteAPIKey(id string) error
	UpdateAPIKey(id string, input UpdateAPIKeyInput) (*APIKey, error)

	// Base Path Mappings
	CreateBasePathMapping(input CreateBasePathMappingInput) (*BasePathMapping, error)
	GetBasePathMapping(domainName, basePath string) (*BasePathMapping, error)
	GetBasePathMappings(domainName string) ([]BasePathMapping, error)
	DeleteBasePathMapping(domainName, basePath string) error

	// Documentation Parts (per-API)
	CreateDocumentationPart(input CreateDocumentationPartInput) (*DocumentationPart, error)
	GetDocumentationPart(restAPIID, docPartID string) (*DocumentationPart, error)
	GetDocumentationParts(restAPIID string) ([]DocumentationPart, error)
	DeleteDocumentationPart(restAPIID, docPartID string) error

	// Documentation Versions (per-API)
	CreateDocumentationVersion(input CreateDocumentationVersionInput) (*DocumentationVersion, error)
	GetDocumentationVersion(restAPIID, version string) (*DocumentationVersion, error)
	GetDocumentationVersions(restAPIID string) ([]DocumentationVersion, error)
	DeleteDocumentationVersion(restAPIID, version string) error

	// Domain Names
	CreateDomainName(input CreateDomainNameInput) (*DomainName, error)
	GetDomainName(name string) (*DomainName, error)
	GetDomainNames() ([]DomainName, error)
	GetDomainNamesPage(limit int, position string) ([]DomainName, string, error)
	DeleteDomainName(name string) error

	// Domain Name Access Associations
	CreateDomainNameAccessAssociation(
		input CreateDomainNameAccessAssociationInput,
	) (*DomainNameAccessAssociation, error)
	GetDomainNameAccessAssociations(resourceOwner string) ([]DomainNameAccessAssociation, error)
	DeleteDomainNameAccessAssociation(arn string) error
	RejectDomainNameAccessAssociation(arn, domainNameARN string) error

	// Models (per-API)
	CreateModel(input CreateModelInput) (*Model, error)
	GetModel(restAPIID, modelName string) (*Model, error)
	GetModels(restAPIID string) ([]Model, error)
	DeleteModel(restAPIID, modelName string) error
	UpdateModel(restAPIID, modelName string, input UpdateModelInput) (*Model, error)

	// Standalone Stage creation
	CreateStage(input CreateStageInput) (*Stage, error)
	UpdateStage(restAPIID, stageName string, input UpdateStageInput) (*Stage, error)

	// Usage Plans
	CreateUsagePlan(input CreateUsagePlanInput) (*UsagePlan, error)
	GetUsagePlan(id string) (*UsagePlan, error)
	GetUsagePlans() ([]UsagePlan, error)
	GetUsagePlansPage(limit int, position string) ([]UsagePlan, string, error)
	DeleteUsagePlan(id string) error

	// Usage Plan Keys
	CreateUsagePlanKey(input CreateUsagePlanKeyInput) (*UsagePlanKey, error)
	GetUsagePlanKey(usagePlanID, keyID string) (*UsagePlanKey, error)
	GetUsagePlanKeys(usagePlanID string) ([]UsagePlanKey, error)
	DeleteUsagePlanKey(usagePlanID, keyID string) error

	// Account
	GetAccount() (*Account, error)

	// Tags
	GetResourceTags(resourceARN string) (map[string]string, error)
	TagResource(resourceARN string, tags map[string]string) error
	UntagResource(resourceARN string, tagKeys []string) error

	// Test Invocation
	TestInvokeMethod(input TestInvokeMethodInput) (*TestInvokeMethodOutput, error)

	// Update operations.
	UpdateUsagePlan(input UpdateUsagePlanInput) (*UsagePlan, error)
	UpdateDomainName(input UpdateDomainNameInput) (*DomainName, error)
	UpdateBasePathMapping(input UpdateBasePathMappingInput) (*BasePathMapping, error)
	UpdateDocumentationPart(input UpdateDocumentationPartInput) (*DocumentationPart, error)
	UpdateDocumentationVersion(input UpdateDocumentationVersionInput) (*DocumentationVersion, error)
	UpdateMethod(input UpdateMethodInput) (*Method, error)
	UpdateIntegration(input UpdateIntegrationInput) (*Integration, error)
	UpdateIntegrationResponse(input UpdateIntegrationResponseInput) (*IntegrationResponse, error)
	UpdateMethodResponse(input UpdateMethodResponseInput) (*MethodResponse, error)
	UpdateAccount(input UpdateAccountInput) (*Account, error)
	TestInvokeAuthorizer(input TestInvokeAuthorizerInput) (*TestInvokeAuthorizerOutput, error)
	GetModelTemplate(restAPIID, modelName string) (string, error)

	// Gateway response operations.
	GetGatewayResponse(restAPIID, responseType string) (*GatewayResponse, error)
	GetGatewayResponses(restAPIID string) ([]GatewayResponse, error)
	PutGatewayResponse(input PutGatewayResponseInput) (*GatewayResponse, error)
	UpdateGatewayResponse(input PutGatewayResponseInput) (*GatewayResponse, error)
	DeleteGatewayResponse(restAPIID, responseType string) error

	// Client certificate operations.
	GenerateClientCertificate(input GenerateClientCertificateInput) (*ClientCertificate, error)
	GetClientCertificate(id string) (*ClientCertificate, error)
	GetClientCertificates() ([]ClientCertificate, error)
	DeleteClientCertificate(id string) error

	// Usage operations.
	GetUsage(input GetUsageInput) (*UsageData, error)
	// EnforceUsagePlan applies usage-plan quota and throttle/burst limits for an API
	// key on the given API stage. It returns nil when the request is allowed (or when
	// the key is not associated with a usage plan for the stage), ErrQuotaExceeded when
	// the period quota is exhausted, or ErrThrottled when the rate/burst limit is hit.
	EnforceUsagePlan(apiID, stageName, keyID string) error

	// VPC Link operations.
	CreateVpcLink(input CreateVpcLinkInput) (*VpcLink, error)
	GetVpcLink(id string) (*VpcLink, error)
	GetVpcLinks() ([]VpcLink, error)
	DeleteVpcLink(id string) error
	UpdateVpcLink(input UpdateVpcLinkInput) (*VpcLink, error)

	// Client certificate update.
	UpdateClientCertificate(input UpdateClientCertificateInput) (*ClientCertificate, error)

	// OpenAPI export.
	GetExport(restAPIID, stageName, exportType string) (map[string]any, error)

	// SDK generation.
	GetSdkTypes() []SdkType
	GetSdkType(id string) (*SdkType, error)
	GetSdk(restAPIID, stageName, sdkType string) (*SdkExport, error)

	// API key / documentation part bulk import.
	ImportAPIKeys(body []byte, format string, failOnWarnings bool) ([]string, []string, error)
	ImportDocumentationParts(
		restAPIID string,
		body []byte,
		mode string,
		failOnWarnings bool,
	) ([]string, []string, error)

	// Usage update.
	UpdateUsage(usagePlanID, keyID string, dateValues map[string]string) (*UsageData, error)

	// OpenAPI import.
	ImportRestAPI(input ImportRestAPIInput) (*RestAPI, error)
	PutRestAPI(input PutRestAPIInput) (*RestAPI, error)
}

StorageBackend is the interface for the API Gateway in-memory store.

type TaggedEntry added in v1.3.1

type TaggedEntry struct {
	Tags map[string]string
	ARN  string
}

TaggedEntry pairs a taggable API Gateway resource ARN with its tag set, for cross-service tagging discovery (see cli.go's wireTaggingAPIGateway).

type TestInvokeAuthorizerInput

type TestInvokeAuthorizerInput struct {
	Headers        map[string]string `json:"headers,omitempty"`
	StageVariables map[string]string `json:"stageVariables,omitempty"`
	Body           string            `json:"body,omitempty"`
	RestAPIID      string            `json:"restApiId"`
	AuthorizerID   string            `json:"authorizerId"`
	Identity       string            `json:"identity,omitempty"`
}

TestInvokeAuthorizerInput is the input for TestInvokeAuthorizer.

type TestInvokeAuthorizerOutput

type TestInvokeAuthorizerOutput struct {
	Claims         map[string]string   `json:"claims,omitempty"`
	Authorization  map[string][]string `json:"authorization,omitempty"`
	Log            string              `json:"log,omitempty"`
	PrincipalID    string              `json:"principalId"`
	PolicyDocument string              `json:"policy,omitempty"`
	ClientStatus   int                 `json:"clientStatus"`
	Latency        int64               `json:"latency"`
}

TestInvokeAuthorizerOutput is the output from TestInvokeAuthorizer. Authorization is a map[string][]string on the real wire (types.TestInvokeAuthorizerOutput.Authorization in the SDK) -- it carries the authorization response's headers, not a status code. There is no "context" member on the real wire at all.

type TestInvokeMethodInput

type TestInvokeMethodInput struct {
	Headers             map[string]string   `json:"headers,omitempty"`
	MultiValueHeaders   map[string][]string `json:"multiValueHeaders,omitempty"`
	StageVariables      map[string]string   `json:"stageVariables,omitempty"`
	PathWithQueryString string              `json:"pathWithQueryString,omitempty"`
	Body                string              `json:"body,omitempty"`
	RestAPIID           string              `json:"restApiId"`
	ResourceID          string              `json:"resourceId"`
	HTTPMethod          string              `json:"httpMethod"`
}

TestInvokeMethodInput is the input for TestInvokeMethod.

type TestInvokeMethodOutput

type TestInvokeMethodOutput struct {
	Headers           map[string]string   `json:"headers,omitempty"`
	MultiValueHeaders map[string][]string `json:"multiValueHeaders,omitempty"`
	Log               string              `json:"log,omitempty"`
	Body              string              `json:"body,omitempty"`
	Status            int                 `json:"status"`
	Latency           int64               `json:"latency"`
}

TestInvokeMethodOutput is the output from TestInvokeMethod. MultiValueHeaders is a real, separate wire member (types.TestInvokeMethodOutput.MultiValueHeaders in the SDK), not derivable by a real client from Headers alone.

type ThrottleSettings

type ThrottleSettings struct {
	BurstLimit int     `json:"burstLimit,omitempty"`
	RateLimit  float64 `json:"rateLimit,omitempty"`
}

ThrottleSettings controls request rate limiting for a usage plan.

type UpdateAPIKeyInput

type UpdateAPIKeyInput struct {
	Enabled     *bool  `json:"enabled,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	CustomerID  string `json:"customerId,omitempty"`
	// StageKeys is the flattened result of PATCH "/stages" add/remove ops
	// (see patch.go's applyAPIKeyPatchOp), each formatted "{restApiId}/{stageName}".
	StageKeys []string `json:"stageKeys,omitempty"`
}

UpdateAPIKeyInput is the input for UpdateAPIKey.

type UpdateAccountInput

type UpdateAccountInput struct {
	ThrottleSettings  *ThrottleSettings `json:"throttleSettings,omitempty"`
	CloudwatchRoleARN string            `json:"cloudwatchRoleArn,omitempty"`
	Features          []string          `json:"features,omitempty"`
}

UpdateAccountInput is the input for UpdateAccount. The real AWS wire shape carries only "patchOperations" (see aws-sdk-go-v2 apigateway UpdateAccountInput); handler.go flattens the patch document into these named fields (CloudwatchRoleARN via top-level "/cloudwatchRoleArn", ThrottleSettings via nested "/throttle/{rateLimit,burstLimit}", Features via "/features" add/remove — see patch.go). Features is nil-checked rather than len-checked so patching the last entry away actually clears it (see applyAccountFeaturesPatch).

type UpdateAuthorizerInput

type UpdateAuthorizerInput struct {
	IdentitySource               *string  `json:"identitySource,omitempty"`
	Name                         string   `json:"name,omitempty"`
	Type                         string   `json:"type,omitempty"`
	AuthorizerURI                string   `json:"authorizerUri,omitempty"`
	AuthorizerCredentials        string   `json:"authorizerCredentials,omitempty"`
	IdentityValidationExpression string   `json:"identityValidationExpression,omitempty"`
	AuthType                     string   `json:"authType,omitempty"`
	ProviderARNs                 []string `json:"providerARNs,omitempty"`
	AuthorizerResultTTLInSeconds int      `json:"authorizerResultTtlInSeconds,omitempty"`
}

UpdateAuthorizerInput is the input for UpdateAuthorizer. IdentitySource is a *string (see updateAuthorizerInput's doc comment in handler_authorizers.go) so an explicit PATCH "remove" of "/identitySource" (AWS-documented as supported) can be told apart from the field being absent from the PATCH.

type UpdateBasePathMappingInput

type UpdateBasePathMappingInput struct {
	NewBasePath *string `json:"newBasePath,omitempty"`
	DomainName  string  `json:"domainName"`
	BasePath    string  `json:"basePath"`
	RestAPIID   string  `json:"restApiId,omitempty"`
	Stage       string  `json:"stage,omitempty"`
}

UpdateBasePathMappingInput is the input for UpdateBasePathMapping. NewBasePath has no equivalent on the real AWS wire (a real client only ever renames via a "/basepath" or "/basePath" patchOperations entry) — BasePath itself must stay the REQUIRED identity used to find the mapping, since it's populated from the URL by injectJSONFieldAPIGW after patch resolution runs (see applyBasePathMappingPatchOp).

type UpdateClientCertificateInput

type UpdateClientCertificateInput struct {
	ClientCertificateID string `json:"clientCertificateId"`
	Description         string `json:"description,omitempty"`
}

UpdateClientCertificateInput is the input for UpdateClientCertificate.

type UpdateDeploymentInput

type UpdateDeploymentInput struct {
	Description string `json:"description,omitempty"`
}

UpdateDeploymentInput is the input for UpdateDeployment.

type UpdateDocumentationPartInput

type UpdateDocumentationPartInput struct {
	RestAPIID  string `json:"restApiId"`
	DocPartID  string `json:"docPartId"`
	Properties string `json:"properties,omitempty"`
}

UpdateDocumentationPartInput is the input for UpdateDocumentationPart.

type UpdateDocumentationVersionInput

type UpdateDocumentationVersionInput struct {
	RestAPIID            string `json:"restApiId"`
	DocumentationVersion string `json:"documentationVersion"`
	Description          string `json:"description,omitempty"`
}

UpdateDocumentationVersionInput is the input for UpdateDocumentationVersion.

type UpdateDomainNameInput

type UpdateDomainNameInput struct {
	EndpointConfiguration               *EndpointConfiguration   `json:"endpointConfiguration,omitempty"`
	MutualTLSAuthentication             *MutualTLSAuthentication `json:"mutualTlsAuthentication,omitempty"`
	CertificateARN                      *string                  `json:"certificateArn,omitempty"`
	CertificateName                     *string                  `json:"certificateName,omitempty"`
	RegionalCertificateARN              *string                  `json:"regionalCertificateArn,omitempty"`
	RegionalCertificateName             *string                  `json:"regionalCertificateName,omitempty"`
	OwnershipVerificationCertificateARN *string                  `json:"ownershipVerificationCertificateArn,omitempty"`
	SecurityPolicy                      string                   `json:"securityPolicy,omitempty"`
	ManagementPolicy                    string                   `json:"managementPolicy,omitempty"`
	Policy                              string                   `json:"policy,omitempty"`
	RoutingMode                         string                   `json:"routingMode,omitempty"`
	EndpointAccessMode                  string                   `json:"endpointAccessMode,omitempty"`
	DomainName                          string                   `json:"domainName"`
}

UpdateDomainNameInput is the input for UpdateDomainName. CertificateARN, CertificateName, RegionalCertificateARN, RegionalCertificateName, and OwnershipVerificationCertificateARN are *string (rather than plain string) because UpdateDomainName's PATCH documents "remove" as supported for "/certificateArn", "/certificateName", "/regionalCertificateArn", "/regionalCertificateName", and "/ownershipVerificationCertificateArn" (patch-operations.html) — a plain string can't distinguish "explicitly cleared" from "not provided in this PATCH at all". ManagementPolicy, Policy, RoutingMode, and EndpointAccessMode only document "replace" (patch-operations.html), so a bare string is enough, matching RestApi's Policy/EndpointAccessMode fields.

type UpdateIntegrationInput

type UpdateIntegrationInput struct {
	RequestTemplates      map[string]string `json:"requestTemplates,omitempty"`
	RequestParameters     map[string]string `json:"requestParameters,omitempty"`
	IntegrationHTTPMethod string            `json:"integrationHttpMethod,omitempty"`
	PassthroughBehavior   string            `json:"passthroughBehavior,omitempty"`
	ResourceID            string            `json:"resourceId"`
	HTTPMethod            string            `json:"httpMethod"`
	URI                   string            `json:"uri,omitempty"`
	IntegrationType       string            `json:"type,omitempty"`
	CacheNamespace        string            `json:"cacheNamespace,omitempty"`
	RestAPIID             string            `json:"restApiId"`
	ConnectionType        string            `json:"connectionType,omitempty"`
	ConnectionID          string            `json:"connectionId,omitempty"`
	ContentHandling       string            `json:"contentHandling,omitempty"`
	Credentials           string            `json:"credentials,omitempty"`
	CacheKeyParameters    []string          `json:"cacheKeyParameters,omitempty"`
	TimeoutInMillis       int               `json:"timeoutInMillis,omitempty"`
}

UpdateIntegrationInput is the input for UpdateIntegration.

type UpdateIntegrationResponseInput

type UpdateIntegrationResponseInput struct {
	ResponseTemplates  map[string]string `json:"responseTemplates,omitempty"`
	ResponseParameters map[string]string `json:"responseParameters,omitempty"`
	RestAPIID          string            `json:"restApiId"`
	ResourceID         string            `json:"resourceId"`
	HTTPMethod         string            `json:"httpMethod"`
	StatusCode         string            `json:"statusCode"`
	SelectionPattern   string            `json:"selectionPattern,omitempty"`
	ContentHandling    string            `json:"contentHandling,omitempty"`
}

UpdateIntegrationResponseInput is the input for UpdateIntegrationResponse.

type UpdateMethodInput

type UpdateMethodInput struct {
	RequestModels      map[string]string `json:"requestModels,omitempty"`
	RequestParameters  map[string]bool   `json:"requestParameters,omitempty"`
	APIKeyRequired     *bool             `json:"apiKeyRequired,omitempty"`
	RestAPIID          string            `json:"restApiId"`
	ResourceID         string            `json:"resourceId"`
	HTTPMethod         string            `json:"httpMethod"`
	AuthorizationType  string            `json:"authorizationType,omitempty"`
	AuthorizerID       string            `json:"authorizerId,omitempty"`
	OperationName      string            `json:"operationName,omitempty"`
	RequestValidatorID string            `json:"requestValidatorId,omitempty"`
}

UpdateMethodInput is the input for UpdateMethod. RequestParameters and RequestModels are the flattened, pre-merged result of PATCH "/requestParameters/{name}" and "/requestModels/{content-type}" (see patch.go's applyMethodRequestParameterPatch/applyMethodRequestModelPatch); InMemoryBackend.UpdateMethod applies them via a "!= nil" (not "len > 0") check so a merge that removes the last entry still takes effect.

type UpdateMethodResponseInput

type UpdateMethodResponseInput struct {
	ResponseModels     map[string]string `json:"responseModels,omitempty"`
	ResponseParameters map[string]bool   `json:"responseParameters,omitempty"`
	RestAPIID          string            `json:"restApiId"`
	ResourceID         string            `json:"resourceId"`
	HTTPMethod         string            `json:"httpMethod"`
	StatusCode         string            `json:"statusCode"`
}

UpdateMethodResponseInput is the input for UpdateMethodResponse.

type UpdateModelInput

type UpdateModelInput struct {
	Description string `json:"description,omitempty"`
	Schema      string `json:"schema,omitempty"`
}

UpdateModelInput is the input for UpdateModel.

type UpdateRequestValidatorInput

type UpdateRequestValidatorInput struct {
	ValidateRequestBody       *bool  `json:"validateRequestBody,omitempty"`
	ValidateRequestParameters *bool  `json:"validateRequestParameters,omitempty"`
	Name                      string `json:"name,omitempty"`
}

UpdateRequestValidatorInput is the input for UpdateRequestValidator.

type UpdateResourceInput

type UpdateResourceInput struct {
	CorsConfiguration *CorsConfiguration `json:"corsConfiguration,omitempty"`
	PathPart          string             `json:"pathPart,omitempty"`
	ParentID          string             `json:"parentId,omitempty"`
}

UpdateResourceInput is the input for UpdateResource (rename pathPart, move to a new parent, or set CORS). ParentID is the flattened result of PATCH "/parentId" (see patch.go's applyResourceEntityPatchOp); InMemoryBackend. UpdateResource validates the new parent and recomputes Path for the resource and its whole subtree.

type UpdateRestAPIInput

type UpdateRestAPIInput struct {
	EndpointConfiguration     *EndpointConfiguration `json:"endpointConfiguration,omitempty"`
	MinimumCompressionSize    *int                   `json:"minimumCompressionSize,omitempty"`
	Description               *string                `json:"description,omitempty"`
	DisableExecuteAPIEndpoint *bool                  `json:"disableExecuteApiEndpoint,omitempty"`
	Name                      string                 `json:"name,omitempty"`
	Policy                    string                 `json:"policy,omitempty"`
	APIKeySource              string                 `json:"apiKeySource,omitempty"`
	EndpointAccessMode        string                 `json:"endpointAccessMode,omitempty"`
	// SecurityPolicy is documented by patch-operations.html's UpdateRestApi
	// table ("/securityPolicy") but, before this fix, had no matching field
	// on UpdateRestAPIInput at all -- json.Unmarshal silently dropped the
	// PATCH-flattened "securityPolicy" key, so the PATCH returned 200 with
	// the unmodified RestApi (see PARITY.md's 2026-08-11 gopherstack-6q5h note).
	SecurityPolicy   string   `json:"securityPolicy,omitempty"`
	BinaryMediaTypes []string `json:"binaryMediaTypes,omitempty"`
}

UpdateRestAPIInput is the input for UpdateRestApi. Description is a *string (rather than the plain string every other UpdateRestAPIInput field uses) because UpdateRestApi's PATCH is the only Update* op in this service where a bare top-level scalar's "remove" op is both AWS-documented as supported (patch-operations.html: UpdateRestApi "/description" row) and implemented here (see patch.go's removableTopLevelScalar) — a plain string can't distinguish "explicitly cleared to empty" from "not provided in this PATCH at all", which a zero-value merge check would otherwise silently drop.

type UpdateStageInput

type UpdateStageInput struct {
	CanarySettings       *CanarySettings          `json:"canarySettings,omitempty"`
	AccessLogSettings    *AccessLogSettings       `json:"accessLogSettings,omitempty"`
	TracingEnabled       *bool                    `json:"tracingEnabled,omitempty"`
	CacheClusterEnabled  *bool                    `json:"cacheClusterEnabled,omitempty"`
	MethodSettings       map[string]MethodSetting `json:"methodSettings,omitempty"`
	Variables            map[string]string        `json:"variables,omitempty"`
	DeploymentID         string                   `json:"deploymentId,omitempty"`
	Description          string                   `json:"description,omitempty"`
	ClientCertificateID  string                   `json:"clientCertificateId,omitempty"`
	CacheClusterSize     string                   `json:"cacheClusterSize,omitempty"`
	DocumentationVersion string                   `json:"documentationVersion,omitempty"`
}

UpdateStageInput is the input for UpdateStage.

type UpdateUsagePlanInput

type UpdateUsagePlanInput struct {
	Throttle    *ThrottleSettings     `json:"throttle,omitempty"`
	Quota       *QuotaSettings        `json:"quota,omitempty"`
	ProductCode *string               `json:"productCode,omitempty"`
	Name        string                `json:"name,omitempty"`
	Description string                `json:"description,omitempty"`
	UsagePlanID string                `json:"usagePlanId"`
	APIStages   []APIStageAssociation `json:"apiStages,omitempty"`
}

UpdateUsagePlanInput is the input for UpdateUsagePlan. ProductCode is a *string (rather than plain string) because UpdateUsagePlan's PATCH documents "remove" as supported for "/productCode" (patch-operations.html) — a plain string can't distinguish "explicitly cleared" from "not provided in this PATCH at all".

type UpdateVpcLinkInput

type UpdateVpcLinkInput struct {
	VpcLinkID   string `json:"vpcLinkId"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

UpdateVpcLinkInput is the input for UpdateVpcLink.

type UsageData

type UsageData struct {
	Items       map[string][]any `json:"values"`
	StartDate   string           `json:"startDate"`
	EndDate     string           `json:"endDate"`
	UsagePlanID string           `json:"usagePlanId"`
	Position    string           `json:"position,omitempty"`
}

UsageData represents the usage data response. The real wire key for Items is "values", not "items" (types.Usage.Items in the SDK, awsRestjson1_deserializeOpDocumentGetUsageOutput/UpdateUsageOutput both read key "values" into it) -- a real client's Items was always empty.

type UsagePlan

type UsagePlan struct {
	Tags        *tags.Tags            `json:"tags,omitempty"`
	Throttle    *ThrottleSettings     `json:"throttle,omitempty"`
	Quota       *QuotaSettings        `json:"quota,omitempty"`
	ID          string                `json:"id"`
	Name        string                `json:"name"`
	Description string                `json:"description,omitempty"`
	ProductCode string                `json:"productCode,omitempty"`
	APIStages   []APIStageAssociation `json:"apiStages,omitempty"`
}

UsagePlan represents an API Gateway usage plan.

type UsagePlanKey

type UsagePlanKey struct {
	ID    string `json:"id"`
	Type  string `json:"type"`
	Value string `json:"value,omitempty"`
	Name  string `json:"name,omitempty"`
	// UsagePlanID identifies the owning usage plan. Internal storage-layer
	// identity only (composite key for the backend's flat
	// store.Table[UsagePlanKey]); never part of the wire response — see the
	// identical Authorizer.RestAPIID doc.
	UsagePlanID string `json:"-"`
}

UsagePlanKey represents an API key associated with a usage plan.

type VTLContext

type VTLContext struct {
	// StageVariables is exposed as $stageVariables.X.
	StageVariables map[string]string
	// Body is the raw request body passed as $input.body.
	Body string
	// RequestID is exposed as $context.requestId.
	RequestID string
	// HTTPMethod is exposed as $context.httpMethod.
	HTTPMethod string
	// ResourcePath is exposed as $context.resourcePath (the route template, e.g. /users/{id}).
	ResourcePath string
	// Path is exposed as $context.path (the actual request path).
	Path string
	// Stage is exposed as $context.stage.
	Stage string
	// APIID is exposed as $context.apiId.
	APIID string
	// SourceIP is exposed as $context.identity.sourceIp.
	SourceIP string
	// UserAgent is exposed as $context.identity.userAgent.
	UserAgent string
}

VTLContext holds the context variables available during VTL template rendering.

type VpcLink struct {
	Tags          *tags.Tags `json:"tags,omitempty"`
	ID            string     `json:"id"`
	Name          string     `json:"name"`
	Description   string     `json:"description,omitempty"`
	Status        string     `json:"status"`
	StatusMessage string     `json:"statusMessage,omitempty"`
	TargetARNs    []string   `json:"targetArns,omitempty"`
}

VpcLink represents a VPC Link for private integrations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL