Class MethodResponse.Builder
java.lang.Object
software.amazon.awscdk.services.apigateway.MethodResponse.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<MethodResponse>
- Enclosing interface:
- MethodResponse
@Stability(Stable)
public static final class MethodResponse.Builder
extends Object
implements software.amazon.jsii.Builder<MethodResponse>
A builder for
MethodResponse
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.responseModels
(Map<String, ? extends IModel> responseModels) Sets the value ofMethodResponse.getResponseModels()
responseParameters
(Map<String, ? extends Boolean> responseParameters) Sets the value ofMethodResponse.getResponseParameters()
statusCode
(String statusCode) Sets the value ofMethodResponse.getStatusCode()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
statusCode
Sets the value ofMethodResponse.getStatusCode()
- Parameters:
statusCode
- The method response's status code, which you map to an IntegrationResponse. This parameter is required. Required.- Returns:
this
-
responseModels
@Stability(Stable) public MethodResponse.Builder responseModels(Map<String, ? extends IModel> responseModels) Sets the value ofMethodResponse.getResponseModels()
- Parameters:
responseModels
- The resources used for the response's content type. Specify response models as key-value pairs (string-to-string maps), with a content type as the key and a Model resource name as the value.- Returns:
this
-
responseParameters
@Stability(Stable) public MethodResponse.Builder responseParameters(Map<String, ? extends Boolean> responseParameters) Sets the value ofMethodResponse.getResponseParameters()
- Parameters:
responseParameters
- Response parameters that API Gateway sends to the client that called a method. Specify response parameters as key-value pairs (string-to-Boolean maps), with a destination as the key and a Boolean as the value. Specify the destination using the following pattern: method.response.header.name, where the name is a valid, unique header name. The Boolean specifies whether a parameter is required.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<MethodResponse>
- Returns:
- a new instance of
MethodResponse
- Throws:
NullPointerException
- if any required attribute was not provided
-