Class GatewayResponse.Builder
java.lang.Object
software.amazon.smithy.aws.apigateway.traits.GatewayResponse.Builder
- All Implemented Interfaces:
SmithyBuilder<GatewayResponse>
- Enclosing class:
- GatewayResponse
public static final class GatewayResponse.Builder
extends Object
implements SmithyBuilder<GatewayResponse>
Builder used to create a
GatewayResponse.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates an immutable object that is created from the properties that have been set on the builder.putResponseParameter(String key, String value) Adds a response parameter.putResponseTemplate(String mediaType, String template) Adds a response template.responseParameters(Map<String, String> responseParameters) Replaces all response parameters with the given map.responseTemplates(Map<String, String> responseTemplates) Replaces all response templates with the given map.statusCode(String statusCode) Sets the HTTP status code for the gateway response.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Description copied from interface:SmithyBuilderCreates an immutable object that is created from the properties that have been set on the builder.- Specified by:
buildin interfaceSmithyBuilder<GatewayResponse>- Returns:
- an instance of T
-
statusCode
Sets the HTTP status code for the gateway response.- Parameters:
statusCode- Status code to set.- Returns:
- Returns the builder.
-
putResponseParameter
Adds a response parameter.- Parameters:
key- Parameter key (e.g.,gatewayresponse.header.Access-Control-Allow-Origin).value- Parameter value.- Returns:
- Returns the builder.
-
putResponseTemplate
Adds a response template.- Parameters:
mediaType- Media type key (e.g.,application/json).template- Template value.- Returns:
- Returns the builder.
-
responseParameters
Replaces all response parameters with the given map.- Parameters:
responseParameters- Map of response parameters.- Returns:
- Returns the builder.
-
responseTemplates
Replaces all response templates with the given map.- Parameters:
responseTemplates- Map of response templates.- Returns:
- Returns the builder.
-