Interface MethodProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
MethodProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:11.896Z") @Stability(Stable) public interface MethodProps extends software.amazon.jsii.JsiiSerializable
Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.apigateway.*;
 Authorizer authorizer;
 Integration integration;
 Model model;
 RequestValidator requestValidator;
 Resource resource;
 MethodProps methodProps = MethodProps.builder()
         .httpMethod("httpMethod")
         .resource(resource)
         // the properties below are optional
         .integration(integration)
         .options(MethodOptions.builder()
                 .apiKeyRequired(false)
                 .authorizationScopes(List.of("authorizationScopes"))
                 .authorizationType(AuthorizationType.NONE)
                 .authorizer(authorizer)
                 .methodResponses(List.of(MethodResponse.builder()
                         .statusCode("statusCode")
                         // the properties below are optional
                         .responseModels(Map.of(
                                 "responseModelsKey", model))
                         .responseParameters(Map.of(
                                 "responseParametersKey", false))
                         .build()))
                 .operationName("operationName")
                 .requestModels(Map.of(
                         "requestModelsKey", model))
                 .requestParameters(Map.of(
                         "requestParametersKey", false))
                 .requestValidator(requestValidator)
                 .requestValidatorOptions(RequestValidatorOptions.builder()
                         .requestValidatorName("requestValidatorName")
                         .validateRequestBody(false)
                         .validateRequestParameters(false)
                         .build())
                 .build())
         .build();
 
  • Method Details

    • getHttpMethod

      @Stability(Stable) @NotNull String getHttpMethod()
      The HTTP method ("GET", "POST", "PUT", ...) that clients use to call this method.
    • getResource

      @Stability(Stable) @NotNull IResource getResource()
      The resource this method is associated with.

      For root resource methods, specify the RestApi object.

    • getIntegration

      @Stability(Stable) @Nullable default Integration getIntegration()
      The backend system that the method calls when it receives a request.

      Default: - a new `MockIntegration`.

    • getOptions

      @Stability(Stable) @Nullable default MethodOptions getOptions()
      Method options.

      Default: - No options.

    • builder

      @Stability(Stable) static MethodProps.Builder builder()
      Returns:
      a MethodProps.Builder of MethodProps