Class MethodOptions.Builder

java.lang.Object
software.amazon.awscdk.services.apigateway.MethodOptions.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<MethodOptions>
Enclosing interface:
MethodOptions

@Stability(Stable) public static final class MethodOptions.Builder extends Object implements software.amazon.jsii.Builder<MethodOptions>
A builder for MethodOptions
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • apiKeyRequired

      @Stability(Stable) public MethodOptions.Builder apiKeyRequired(Boolean apiKeyRequired)
      Parameters:
      apiKeyRequired - Indicates whether the method requires clients to submit a valid API key.
      Returns:
      this
    • authorizationScopes

      @Stability(Stable) public MethodOptions.Builder authorizationScopes(List<String> authorizationScopes)
      Parameters:
      authorizationScopes - A list of authorization scopes configured on the method. The scopes are used with a COGNITO_USER_POOLS authorizer to authorize the method invocation.
      Returns:
      this
    • authorizationType

      @Stability(Stable) public MethodOptions.Builder authorizationType(AuthorizationType authorizationType)
      Parameters:
      authorizationType - Method authorization. If the value is set of Custom, an authorizer must also be specified. If you're using one of the authorizers that are available via the Authorizer class, such as
      invalid @link
      Authorizer#token()
      , it is recommended that this option not be specified. The authorizer will take care of setting the correct authorization type. However, specifying an authorization type using this property that conflicts with what is expected by the Authorizer will result in an error.
      Returns:
      this
    • authorizer

      @Stability(Stable) public MethodOptions.Builder authorizer(IAuthorizer authorizer)
      Parameters:
      authorizer - If authorizationType is Custom, this specifies the ID of the method authorizer resource. If specified, the value of authorizationType must be set to Custom
      Returns:
      this
    • methodResponses

      @Stability(Stable) public MethodOptions.Builder methodResponses(List<? extends MethodResponse> methodResponses)
      Parameters:
      methodResponses - The responses that can be sent to the client who calls the method.
      Returns:
      this
    • operationName

      @Stability(Stable) public MethodOptions.Builder operationName(String operationName)
      Parameters:
      operationName - A friendly operation name for the method. For example, you can assign the OperationName of ListPets for the GET /pets method.
      Returns:
      this
    • requestModels

      @Stability(Stable) public MethodOptions.Builder requestModels(Map<String,? extends IModel> requestModels)
      Parameters:
      requestModels - The models which describe data structure of request payload. When combined with requestValidator or requestValidatorOptions, the service will validate the API request payload before it reaches the API's Integration (including proxies). Specify requestModels as key-value pairs, with a content type (e.g. 'application/json') as the key and an API Gateway Model as the value.
      Returns:
      this
    • requestParameters

      @Stability(Stable) public MethodOptions.Builder requestParameters(Map<String,? extends Boolean> requestParameters)
      Parameters:
      requestParameters - The request parameters that API Gateway accepts. Specify request parameters as key-value pairs (string-to-Boolean mapping), with a source as the key and a Boolean as the value. The Boolean specifies whether a parameter is required. A source must match the format method.request.location.name, where the location is querystring, path, or header, and name is a valid, unique parameter name.
      Returns:
      this
    • requestValidator

      @Stability(Stable) public MethodOptions.Builder requestValidator(IRequestValidator requestValidator)
      Parameters:
      requestValidator - The ID of the associated request validator. Only one of requestValidator or requestValidatorOptions must be specified. Works together with requestModels or requestParameters to validate the request before it reaches integration like Lambda Proxy Integration.
      Returns:
      this
    • requestValidatorOptions

      @Stability(Stable) public MethodOptions.Builder requestValidatorOptions(RequestValidatorOptions requestValidatorOptions)
      Parameters:
      requestValidatorOptions - Request validator options to create new validator Only one of requestValidator or requestValidatorOptions must be specified. Works together with requestModels or requestParameters to validate the request before it reaches integration like Lambda Proxy Integration.
      Returns:
      this
    • build

      @Stability(Stable) public MethodOptions build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<MethodOptions>
      Returns:
      a new instance of MethodOptions
      Throws:
      NullPointerException - if any required attribute was not provided