interface MethodProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.APIGateway.MethodProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#MethodProps |
Java | software.amazon.awscdk.services.apigateway.MethodProps |
Python | aws_cdk.aws_apigateway.MethodProps |
TypeScript (source) | aws-cdk-lib » aws_apigateway » MethodProps |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigateway as apigateway } from 'aws-cdk-lib';
declare const authorizer: apigateway.Authorizer;
declare const integration: apigateway.Integration;
declare const model: apigateway.Model;
declare const requestValidator: apigateway.RequestValidator;
declare const resource: apigateway.Resource;
const methodProps: apigateway.MethodProps = {
httpMethod: 'httpMethod',
resource: resource,
// the properties below are optional
integration: integration,
options: {
apiKeyRequired: false,
authorizationScopes: ['authorizationScopes'],
authorizationType: apigateway.AuthorizationType.NONE,
authorizer: authorizer,
methodResponses: [{
statusCode: 'statusCode',
// the properties below are optional
responseModels: {
responseModelsKey: model,
},
responseParameters: {
responseParametersKey: false,
},
}],
operationName: 'operationName',
requestModels: {
requestModelsKey: model,
},
requestParameters: {
requestParametersKey: false,
},
requestValidator: requestValidator,
requestValidatorOptions: {
requestValidatorName: 'requestValidatorName',
validateRequestBody: false,
validateRequestParameters: false,
},
},
};
Properties
Name | Type | Description |
---|---|---|
http | string | The HTTP method ("GET", "POST", "PUT", ...) that clients use to call this method. |
resource | IResource | The resource this method is associated with. |
integration? | Integration | The backend system that the method calls when it receives a request. |
options? | Method | Method options. |
httpMethod
Type:
string
The HTTP method ("GET", "POST", "PUT", ...) that clients use to call this method.
resource
Type:
IResource
The resource this method is associated with.
For root resource methods,
specify the RestApi
object.
integration?
Type:
Integration
(optional, default: a new MockIntegration
.)
The backend system that the method calls when it receives a request.
options?
Type:
Method
(optional, default: No options.)
Method options.