Class IntegrationResponse.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • statusCode

      @Stability(Stable) public IntegrationResponse.Builder statusCode(String statusCode)
      Parameters:
      statusCode - The status code that API Gateway uses to map the integration response to a MethodResponse status code. This parameter is required.
      Returns:
      this
    • contentHandling

      @Stability(Stable) public IntegrationResponse.Builder contentHandling(ContentHandling contentHandling)
      Parameters:
      contentHandling - Specifies how to handle request payload content type conversions.
      Returns:
      this
    • responseParameters

      @Stability(Stable) public IntegrationResponse.Builder responseParameters(Map<String,String> responseParameters)
      Parameters:
      responseParameters - The response parameters from the backend response that API Gateway sends to the method response. Use the destination as the key and the source as the value:

      • The destination must be an existing response parameter in the MethodResponse property.
      • The source must be an existing method request parameter or a static value. You must enclose static values in single quotation marks and pre-encode these values based on the destination specified in the request.
      Returns:
      this
    • responseTemplates

      @Stability(Stable) public IntegrationResponse.Builder responseTemplates(Map<String,String> responseTemplates)
      Parameters:
      responseTemplates - The templates that are used to transform the integration response body. Specify templates as key-value pairs, with a content type as the key and a template as the value.
      Returns:
      this
    • selectionPattern

      @Stability(Stable) public IntegrationResponse.Builder selectionPattern(String selectionPattern)
      Parameters:
      selectionPattern - Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. For example, if the success response returns nothing and the error response returns some string, you could use the .+ regex to match error response. However, make sure that the error response does not contain any newline (\n) character in such cases. If the back end is an AWS Lambda function, the AWS Lambda function error header is matched. For all other HTTP and AWS back ends, the HTTP status code is matched.
      Returns:
      this
    • build

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