Interface MethodProps

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

@Generated(value="jsii-pacmak/1.99.0 (build 8f757e4)", date="2024-06-13T18:49:13.747Z") @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