Class CfnMethod.Builder

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

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

    • create

      @Stability(Stable) public static CfnMethod.Builder create(Construct scope, String id)
      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      Returns:
      a new instance of CfnMethod.Builder.
    • httpMethod

      @Stability(Stable) public CfnMethod.Builder httpMethod(String httpMethod)
      The method's HTTP verb.

      Parameters:
      httpMethod - The method's HTTP verb. This parameter is required.
      Returns:
      this
    • resourceId

      @Stability(Stable) public CfnMethod.Builder resourceId(String resourceId)
      The Resource identifier for the MethodResponse resource.

      Parameters:
      resourceId - The Resource identifier for the MethodResponse resource. This parameter is required.
      Returns:
      this
    • restApiId

      @Stability(Stable) public CfnMethod.Builder restApiId(String restApiId)
      The string identifier of the associated RestApi.

      Parameters:
      restApiId - The string identifier of the associated RestApi. This parameter is required.
      Returns:
      this
    • apiKeyRequired

      @Stability(Stable) public CfnMethod.Builder apiKeyRequired(Boolean apiKeyRequired)
      A boolean flag specifying whether a valid ApiKey is required to invoke this method.

      Parameters:
      apiKeyRequired - A boolean flag specifying whether a valid ApiKey is required to invoke this method. This parameter is required.
      Returns:
      this
    • apiKeyRequired

      @Stability(Stable) public CfnMethod.Builder apiKeyRequired(IResolvable apiKeyRequired)
      A boolean flag specifying whether a valid ApiKey is required to invoke this method.

      Parameters:
      apiKeyRequired - A boolean flag specifying whether a valid ApiKey is required to invoke this method. This parameter is required.
      Returns:
      this
    • authorizationScopes

      @Stability(Stable) public CfnMethod.Builder authorizationScopes(List<String> 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. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.

      Parameters:
      authorizationScopes - A list of authorization scopes configured on the method. This parameter is required.
      Returns:
      this
    • authorizationType

      @Stability(Stable) public CfnMethod.Builder authorizationType(String authorizationType)
      The method's authorization type.

      This parameter is required. For valid values, see Method in the API Gateway API Reference .

      If you specify the AuthorizerId property, specify CUSTOM or COGNITO_USER_POOLS for this property.

      Parameters:
      authorizationType - The method's authorization type. This parameter is required.
      Returns:
      this
    • authorizerId

      @Stability(Stable) public CfnMethod.Builder authorizerId(String authorizerId)
      The identifier of an authorizer to use on this method.

      The method's authorization type must be CUSTOM or COGNITO_USER_POOLS .

      Parameters:
      authorizerId - The identifier of an authorizer to use on this method. This parameter is required.
      Returns:
      this
    • integration

      @Stability(Stable) public CfnMethod.Builder integration(IResolvable integration)
      Represents an HTTP , HTTP_PROXY , AWS , AWS_PROXY , or Mock integration.

      Parameters:
      integration - Represents an HTTP , HTTP_PROXY , AWS , AWS_PROXY , or Mock integration. This parameter is required.
      Returns:
      this
    • integration

      @Stability(Stable) public CfnMethod.Builder integration(CfnMethod.IntegrationProperty integration)
      Represents an HTTP , HTTP_PROXY , AWS , AWS_PROXY , or Mock integration.

      Parameters:
      integration - Represents an HTTP , HTTP_PROXY , AWS , AWS_PROXY , or Mock integration. This parameter is required.
      Returns:
      this
    • methodResponses

      @Stability(Stable) public CfnMethod.Builder methodResponses(IResolvable methodResponses)
      Gets a method response associated with a given HTTP status code.

      Parameters:
      methodResponses - Gets a method response associated with a given HTTP status code. This parameter is required.
      Returns:
      this
    • methodResponses

      @Stability(Stable) public CfnMethod.Builder methodResponses(List<? extends Object> methodResponses)
      Gets a method response associated with a given HTTP status code.

      Parameters:
      methodResponses - Gets a method response associated with a given HTTP status code. This parameter is required.
      Returns:
      this
    • operationName

      @Stability(Stable) public CfnMethod.Builder operationName(String operationName)
      A human-friendly operation identifier for the method.

      For example, you can assign the operationName of ListPets for the GET /pets method in the PetStore example.

      Parameters:
      operationName - A human-friendly operation identifier for the method. This parameter is required.
      Returns:
      this
    • requestModels

      @Stability(Stable) public CfnMethod.Builder requestModels(IResolvable requestModels)
      A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).

      Parameters:
      requestModels - A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key). This parameter is required.
      Returns:
      this
    • requestModels

      @Stability(Stable) public CfnMethod.Builder requestModels(Map<String,String> requestModels)
      A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).

      Parameters:
      requestModels - A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key). This parameter is required.
      Returns:
      this
    • requestParameters

      @Stability(Stable) public CfnMethod.Builder requestParameters(IResolvable requestParameters)
      A key-value map defining required or optional method request parameters that can be accepted by API Gateway.

      A key is a method request parameter name matching the pattern of method.request.{location}.{name} , where location is querystring , path , or header and name is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required ( true ) or optional ( false ). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.

      Parameters:
      requestParameters - A key-value map defining required or optional method request parameters that can be accepted by API Gateway. This parameter is required.
      Returns:
      this
    • requestParameters

      @Stability(Stable) public CfnMethod.Builder requestParameters(Map<String,? extends Object> requestParameters)
      A key-value map defining required or optional method request parameters that can be accepted by API Gateway.

      A key is a method request parameter name matching the pattern of method.request.{location}.{name} , where location is querystring , path , or header and name is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required ( true ) or optional ( false ). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.

      Parameters:
      requestParameters - A key-value map defining required or optional method request parameters that can be accepted by API Gateway. This parameter is required.
      Returns:
      this
    • requestValidatorId

      @Stability(Stable) public CfnMethod.Builder requestValidatorId(String requestValidatorId)
      The identifier of a RequestValidator for request validation.

      Parameters:
      requestValidatorId - The identifier of a RequestValidator for request validation. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public CfnMethod build()
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnMethod>
      Returns:
      a newly built instance of CfnMethod.