@altostra/core
Version:
Core library for shared types and logic
64 lines (63 loc) • 2.53 kB
TypeScript
import type { AwsResourceCommon } from "../common";
import type { CloudFormationString, CloudFormationValue } from "../IntrinsicFunctions";
export declare type MethodType = 'AWS::ApiGateway::Method';
export interface Method extends AwsResourceCommon {
Type: MethodType;
Properties: MethodProperties;
}
export interface MethodProperties {
ApiKeyRequired?: boolean;
AuthorizationScopes?: string[];
AuthorizationType?: AuthorizationType;
AuthorizerId?: CloudFormationValue;
HttpMethod: HttpMethod;
Integration?: AwsApiGatewayMethodIntegration;
MethodResponses?: AwsApiGatewayMethodResponse[];
OperationName?: string;
RequestModels?: Record<string, string>;
RequestParameters?: Record<string, boolean>;
RequestValidatorId?: string;
ResourceId: CloudFormationString;
RestApiId: CloudFormationString;
}
export declare type AuthorizationType = 'COGNITO_USER_POOLS' | 'CUSTOM' | 'NONE';
export interface AwsApiGatewayMethodIntegration {
Type: AwsApiGatewayMethodIntegrationType;
CacheKeyParameters?: string[];
CacheNamespace?: string;
ConnectionId?: string;
ConnectionType?: string;
ContentHandling?: string;
Credentials?: CloudFormationString;
IntegrationHttpMethod?: string;
IntegrationResponses?: AwsApiGatewayIntegrationResponse[];
PassthroughBehavior?: string;
RequestParameters?: Record<string, string>;
RequestTemplates?: Record<string, CloudFormationString>;
TimeoutInMillis?: number;
Uri?: CloudFormationString;
}
export interface AwsApiGatewayIntegrationResponse {
ContentHandling?: string;
ResponseParameters?: Record<string, string>;
ResponseTemplates?: Record<string, string>;
SelectionPattern?: string;
StatusCode: string;
}
export interface AwsApiGatewayMethodResponse {
ResponseModels?: Record<string, string>;
ResponseParameters?: Record<string, boolean>;
StatusCode: string;
}
export declare type AwsApiGatewayMethodIntegrationType = 'AWS_PROXY' | 'AWS' | 'HTTP_PROXY' | 'HTTP' | 'MOCK';
/**
* HTTP methods with AWS method ANY.
* An endpoint that is using the `ANY` method is invoked for every HTTP request
* to its path, no matter what the actual method is.
*/
export declare type HttpMethod = 'ANY' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT';
export declare const httpMethods: readonly HttpMethod[];
/**
* Type validation for `HttpMethod`.
*/
export declare const isHttpMethod: import("@altostra/type-validations").TypeValidation<HttpMethod>;