import * as core from "@terrascript/core"; export interface MethodArgs extends core.ResourceArgs { /** * (Optional) Specify if the method requires an API key */ apiKeyRequired?: boolean | core.BooleanOut; /** * (Required) The type of authorization used for the method (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER * _POOLS`) */ authorization: string | core.StringOut; /** * (Optional) The authorization scopes used when the authorization is `COGNITO_USER_POOLS` */ authorizationScopes?: core.Array | core.ArrayOut; /** * (Optional) The authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS` */ authorizerId?: string | core.StringOut; /** * (Required) The HTTP Method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`) */ httpMethod: string | core.StringOut; /** * (Optional) The function name that will be given to the method when generating an SDK through API Gat * eway. If omitted, API Gateway will generate a function name based on the resource path and HTTP verb * . */ operationName?: string | core.StringOut; /** * (Optional) A map of the API models used for the request's content type */ requestModels?: core.Map | core.MapOut; /** * (Optional) A map of request parameters (from the path, query string and headers) that should be pass * ed to the integration. The boolean value indicates whether the parameter is required (`true`) or opt * ional (`false`). */ requestParameters?: core.Map | core.MapOut; /** * (Optional) The ID of a `aws_api_gateway_request_validator` */ requestValidatorId?: string | core.StringOut; /** * (Required) The API resource ID */ resourceId: string | core.StringOut; /** * (Required) The ID of the associated REST API */ restApiId: string | core.StringOut; } export class Method extends core.Resource { /** * (Optional) Specify if the method requires an API key */ @core.attr(Boolean) public apiKeyRequired?: boolean | core.BooleanOut; /** * (Required) The type of authorization used for the method (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER * _POOLS`) */ @core.attr(String) public authorization!: string | core.StringOut; /** * (Optional) The authorization scopes used when the authorization is `COGNITO_USER_POOLS` */ @core.attr(String, { kind: "array" }) public authorizationScopes?: | core.Array | core.ArrayOut; /** * (Optional) The authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS` */ @core.attr(String) public authorizerId?: string | core.StringOut; /** * (Required) The HTTP Method (`GET`, `POST`, `PUT`, `DELETE`, `HEAD`, `OPTIONS`, `ANY`) */ @core.attr(String) public httpMethod!: string | core.StringOut; @core.attr(String, { computed: true }) public id!: string | core.StringOut; /** * (Optional) The function name that will be given to the method when generating an SDK through API Gat * eway. If omitted, API Gateway will generate a function name based on the resource path and HTTP verb * . */ @core.attr(String) public operationName?: string | core.StringOut; /** * (Optional) A map of the API models used for the request's content type */ @core.attr(String, { kind: "map" }) public requestModels?: core.Map | core.MapOut; /** * (Optional) A map of request parameters (from the path, query string and headers) that should be pass * ed to the integration. The boolean value indicates whether the parameter is required (`true`) or opt * ional (`false`). */ @core.attr(Boolean, { kind: "map" }) public requestParameters?: | core.Map | core.MapOut; /** * (Optional) The ID of a `aws_api_gateway_request_validator` */ @core.attr(String) public requestValidatorId?: string | core.StringOut; /** * (Required) The API resource ID */ @core.attr(String) public resourceId!: string | core.StringOut; /** * (Required) The ID of the associated REST API */ @core.attr(String) public restApiId!: string | core.StringOut; constructor(name: string, args?: MethodArgs) { super(name, "aws_api_gateway_method", args); } public override getNamespace(): string { return "aws_api_gateway"; } }