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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.contentHandling
(ContentHandling contentHandling) Sets the value ofIntegrationResponse.getContentHandling()
responseParameters
(Map<String, String> responseParameters) Sets the value ofIntegrationResponse.getResponseParameters()
responseTemplates
(Map<String, String> responseTemplates) Sets the value ofIntegrationResponse.getResponseTemplates()
selectionPattern
(String selectionPattern) Sets the value ofIntegrationResponse.getSelectionPattern()
statusCode
(String statusCode) Sets the value ofIntegrationResponse.getStatusCode()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
statusCode
Sets the value ofIntegrationResponse.getStatusCode()
- 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) Sets the value ofIntegrationResponse.getContentHandling()
- Parameters:
contentHandling
- Specifies how to handle request payload content type conversions.- Returns:
this
-
responseParameters
@Stability(Stable) public IntegrationResponse.Builder responseParameters(Map<String, String> responseParameters) Sets the value ofIntegrationResponse.getResponseParameters()
- 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) Sets the value ofIntegrationResponse.getResponseTemplates()
- 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
Sets the value ofIntegrationResponse.getSelectionPattern()
- 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
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<IntegrationResponse>
- Returns:
- a new instance of
IntegrationResponse
- Throws:
NullPointerException
- if any required attribute was not provided
-