@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class PutGatewayResponseResult extends AmazonWebServiceResult<ResponseMetadata> implements Serializable, Cloneable
A gateway response of a given response type and status code, with optional response parameters and mapping templates.
This example shows how to get a gateway response of the MISSING_AUTHNETICATION_TOKEN
type.
GET /restapis/o81lxisefl/gatewayresponses/MISSING_AUTHENTICATION_TOKEN HTTP/1.1 Host: beta-apigateway.us-east-1.amazonaws.com Content-Type: application/json X-Amz-Date: 20170503T202516Z Authorization: AWS4-HMAC-SHA256 Credential={access-key-id}/20170503/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=1b52460e3159c1a26cff29093855d50ea141c1c5b937528fecaf60f51129697a Cache-Control: no-cache Postman-Token: 3b2a1ce9-c848-2e26-2e2f-9c2caefbed45
The response type is specified as a URL path.
The successful operation returns the 200 OK
status code and a payload similar to the following:
{ "_links": { "curies": { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/restapi-gatewayresponse-{rel}.html", "name": "gatewayresponse", "templated": true }, "self": { "href": "/restapis/o81lxisefl/gatewayresponses/MISSING_AUTHENTICATION_TOKEN" }, "gatewayresponse:delete": { "href": "/restapis/o81lxisefl/gatewayresponses/MISSING_AUTHENTICATION_TOKEN" }, "gatewayresponse:put": { "href": "/restapis/o81lxisefl/gatewayresponses/{response_type}", "templated": true }, "gatewayresponse:update": { "href": "/restapis/o81lxisefl/gatewayresponses/MISSING_AUTHENTICATION_TOKEN" } }, "defaultResponse": false, "responseParameters": { "gatewayresponse.header.x-request-path": "method.request.path.petId", "gatewayresponse.header.Access-Control-Allow-Origin": "'a.b.c'", "gatewayresponse.header.x-request-query": "method.request.querystring.q", "gatewayresponse.header.x-request-header": "method.request.header.Accept" }, "responseTemplates": { "application/json": "{\n \"message\": $context.error.messageString,\n \"type\": \"$context.error.responseType\",\n \"stage\": \"$context.stage\",\n \"resourcePath\": \"$context.resourcePath\",\n \"stageVariables.a\": \"$stageVariables.a\",\n \"statusCode\": \"'404'\"\n}" }, "responseType": "MISSING_AUTHENTICATION_TOKEN", "statusCode": "404" }
Constructor and Description |
---|
PutGatewayResponseResult() |
Modifier and Type | Method and Description |
---|---|
PutGatewayResponseResult |
addResponseParametersEntry(String key,
String value) |
PutGatewayResponseResult |
addResponseTemplatesEntry(String key,
String value) |
PutGatewayResponseResult |
clearResponseParametersEntries()
Removes all the entries added into ResponseParameters.
|
PutGatewayResponseResult |
clearResponseTemplatesEntries()
Removes all the entries added into ResponseTemplates.
|
PutGatewayResponseResult |
clone() |
boolean |
equals(Object obj) |
Boolean |
getDefaultResponse()
A Boolean flag to indicate whether this GatewayResponse is the default gateway response (
true
) or not (false ). |
Map<String,String> |
getResponseParameters()
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of
key-value pairs.
|
Map<String,String> |
getResponseTemplates()
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
|
String |
getResponseType()
The response type of the associated GatewayResponse.
|
String |
getStatusCode()
The HTTP status code for this GatewayResponse.
|
int |
hashCode() |
Boolean |
isDefaultResponse()
A Boolean flag to indicate whether this GatewayResponse is the default gateway response (
true
) or not (false ). |
void |
setDefaultResponse(Boolean defaultResponse)
A Boolean flag to indicate whether this GatewayResponse is the default gateway response (
true
) or not (false ). |
void |
setResponseParameters(Map<String,String> responseParameters)
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of
key-value pairs.
|
void |
setResponseTemplates(Map<String,String> responseTemplates)
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
|
void |
setResponseType(GatewayResponseType responseType)
The response type of the associated GatewayResponse.
|
void |
setResponseType(String responseType)
The response type of the associated GatewayResponse.
|
void |
setStatusCode(String statusCode)
The HTTP status code for this GatewayResponse.
|
String |
toString()
Returns a string representation of this object; useful for testing and debugging.
|
PutGatewayResponseResult |
withDefaultResponse(Boolean defaultResponse)
A Boolean flag to indicate whether this GatewayResponse is the default gateway response (
true
) or not (false ). |
PutGatewayResponseResult |
withResponseParameters(Map<String,String> responseParameters)
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of
key-value pairs.
|
PutGatewayResponseResult |
withResponseTemplates(Map<String,String> responseTemplates)
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
|
PutGatewayResponseResult |
withResponseType(GatewayResponseType responseType)
The response type of the associated GatewayResponse.
|
PutGatewayResponseResult |
withResponseType(String responseType)
The response type of the associated GatewayResponse.
|
PutGatewayResponseResult |
withStatusCode(String statusCode)
The HTTP status code for this GatewayResponse.
|
getSdkHttpMetadata, getSdkResponseMetadata, setSdkHttpMetadata, setSdkResponseMetadata
public void setResponseType(String responseType)
The response type of the associated GatewayResponse. Valid values are
responseType
- The response type of the associated GatewayResponse. Valid values are
GatewayResponseType
public String getResponseType()
The response type of the associated GatewayResponse. Valid values are
GatewayResponseType
public PutGatewayResponseResult withResponseType(String responseType)
The response type of the associated GatewayResponse. Valid values are
responseType
- The response type of the associated GatewayResponse. Valid values are
GatewayResponseType
public void setResponseType(GatewayResponseType responseType)
The response type of the associated GatewayResponse. Valid values are
responseType
- The response type of the associated GatewayResponse. Valid values are
GatewayResponseType
public PutGatewayResponseResult withResponseType(GatewayResponseType responseType)
The response type of the associated GatewayResponse. Valid values are
responseType
- The response type of the associated GatewayResponse. Valid values are
GatewayResponseType
public void setStatusCode(String statusCode)
The HTTP status code for this GatewayResponse.
statusCode
- The HTTP status code for this GatewayResponse.public String getStatusCode()
The HTTP status code for this GatewayResponse.
public PutGatewayResponseResult withStatusCode(String statusCode)
The HTTP status code for this GatewayResponse.
statusCode
- The HTTP status code for this GatewayResponse.public Map<String,String> getResponseParameters()
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
public void setResponseParameters(Map<String,String> responseParameters)
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
responseParameters
- Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string
map of key-value pairs.public PutGatewayResponseResult withResponseParameters(Map<String,String> responseParameters)
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
responseParameters
- Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string
map of key-value pairs.public PutGatewayResponseResult addResponseParametersEntry(String key, String value)
public PutGatewayResponseResult clearResponseParametersEntries()
public Map<String,String> getResponseTemplates()
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
public void setResponseTemplates(Map<String,String> responseTemplates)
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
responseTemplates
- Response templates of the GatewayResponse as a string-to-string map of key-value pairs.public PutGatewayResponseResult withResponseTemplates(Map<String,String> responseTemplates)
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
responseTemplates
- Response templates of the GatewayResponse as a string-to-string map of key-value pairs.public PutGatewayResponseResult addResponseTemplatesEntry(String key, String value)
public PutGatewayResponseResult clearResponseTemplatesEntries()
public void setDefaultResponse(Boolean defaultResponse)
A Boolean flag to indicate whether this GatewayResponse is the default gateway response (true
) or not (false
). A default gateway response is one generated by Amazon API Gateway without any
customization by an API developer.
defaultResponse
- A Boolean flag to indicate whether this GatewayResponse is the default gateway response (
true
) or not (false
). A default gateway response is one generated by Amazon API
Gateway without any customization by an API developer.public Boolean getDefaultResponse()
A Boolean flag to indicate whether this GatewayResponse is the default gateway response (true
) or not (false
). A default gateway response is one generated by Amazon API Gateway without any
customization by an API developer.
true
) or not (false
). A default gateway response is one generated by Amazon API
Gateway without any customization by an API developer.public PutGatewayResponseResult withDefaultResponse(Boolean defaultResponse)
A Boolean flag to indicate whether this GatewayResponse is the default gateway response (true
) or not (false
). A default gateway response is one generated by Amazon API Gateway without any
customization by an API developer.
defaultResponse
- A Boolean flag to indicate whether this GatewayResponse is the default gateway response (
true
) or not (false
). A default gateway response is one generated by Amazon API
Gateway without any customization by an API developer.public Boolean isDefaultResponse()
A Boolean flag to indicate whether this GatewayResponse is the default gateway response (true
) or not (false
). A default gateway response is one generated by Amazon API Gateway without any
customization by an API developer.
true
) or not (false
). A default gateway response is one generated by Amazon API
Gateway without any customization by an API developer.public String toString()
toString
in class Object
Object.toString()
public PutGatewayResponseResult clone()
Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.