public class MethodResponse
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Represents a method response. Amazon API Gateway sends back the status code to the caller as the HTTP status code. Parameters and models can be used to transform the response from the method's integration.
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.String> |
responseModels
Specifies the Model resources used for the response's
content-type.
|
private java.util.Map<java.lang.String,java.lang.Boolean> |
responseParameters
Represents response parameters that can be sent back to the caller by
Amazon API Gateway.
|
private java.lang.String |
statusCode
The method response's status code.
|
Constructor and Description |
---|
MethodResponse() |
Modifier and Type | Method and Description |
---|---|
MethodResponse |
addResponseModelsEntry(java.lang.String key,
java.lang.String value) |
MethodResponse |
addResponseParametersEntry(java.lang.String key,
java.lang.Boolean value) |
MethodResponse |
clearResponseModelsEntries()
Removes all the entries added into ResponseModels.
|
MethodResponse |
clearResponseParametersEntries()
Removes all the entries added into ResponseParameters.
|
MethodResponse |
clone() |
boolean |
equals(java.lang.Object obj) |
java.util.Map<java.lang.String,java.lang.String> |
getResponseModels()
Specifies the Model resources used for the response's
content-type.
|
java.util.Map<java.lang.String,java.lang.Boolean> |
getResponseParameters()
Represents response parameters that can be sent back to the caller by
Amazon API Gateway.
|
java.lang.String |
getStatusCode()
The method response's status code.
|
int |
hashCode() |
void |
setResponseModels(java.util.Map<java.lang.String,java.lang.String> responseModels)
Specifies the Model resources used for the response's
content-type.
|
void |
setResponseParameters(java.util.Map<java.lang.String,java.lang.Boolean> responseParameters)
Represents response parameters that can be sent back to the caller by
Amazon API Gateway.
|
void |
setStatusCode(java.lang.String statusCode)
The method response's status code.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
MethodResponse |
withResponseModels(java.util.Map<java.lang.String,java.lang.String> responseModels)
Specifies the Model resources used for the response's
content-type.
|
MethodResponse |
withResponseParameters(java.util.Map<java.lang.String,java.lang.Boolean> responseParameters)
Represents response parameters that can be sent back to the caller by
Amazon API Gateway.
|
MethodResponse |
withStatusCode(java.lang.String statusCode)
The method response's status code.
|
private java.lang.String statusCode
The method response's status code.
private java.util.Map<java.lang.String,java.lang.Boolean> responseParameters
Represents response parameters that can be sent back to the caller by
Amazon API Gateway. Response parameters are represented as a key/value
map, with a destination as the key and a boolean flag as the value, which
is used to specify whether the parameter is required. A destination must
match the pattern method.response.header.{name}
, where
name
is a valid, unique header name. Destinations specified
here are available to the integration for mapping from integration
response parameters.
private java.util.Map<java.lang.String,java.lang.String> responseModels
public void setStatusCode(java.lang.String statusCode)
The method response's status code.
statusCode
- The method response's status code.public java.lang.String getStatusCode()
The method response's status code.
public MethodResponse withStatusCode(java.lang.String statusCode)
The method response's status code.
statusCode
- The method response's status code.public java.util.Map<java.lang.String,java.lang.Boolean> getResponseParameters()
Represents response parameters that can be sent back to the caller by
Amazon API Gateway. Response parameters are represented as a key/value
map, with a destination as the key and a boolean flag as the value, which
is used to specify whether the parameter is required. A destination must
match the pattern method.response.header.{name}
, where
name
is a valid, unique header name. Destinations specified
here are available to the integration for mapping from integration
response parameters.
method.response.header.{name}
, where
name
is a valid, unique header name. Destinations
specified here are available to the integration for mapping from
integration response parameters.public void setResponseParameters(java.util.Map<java.lang.String,java.lang.Boolean> responseParameters)
Represents response parameters that can be sent back to the caller by
Amazon API Gateway. Response parameters are represented as a key/value
map, with a destination as the key and a boolean flag as the value, which
is used to specify whether the parameter is required. A destination must
match the pattern method.response.header.{name}
, where
name
is a valid, unique header name. Destinations specified
here are available to the integration for mapping from integration
response parameters.
responseParameters
- Represents response parameters that can be sent back to the caller
by Amazon API Gateway. Response parameters are represented as a
key/value map, with a destination as the key and a boolean flag as
the value, which is used to specify whether the parameter is
required. A destination must match the pattern
method.response.header.{name}
, where
name
is a valid, unique header name. Destinations
specified here are available to the integration for mapping from
integration response parameters.public MethodResponse withResponseParameters(java.util.Map<java.lang.String,java.lang.Boolean> responseParameters)
Represents response parameters that can be sent back to the caller by
Amazon API Gateway. Response parameters are represented as a key/value
map, with a destination as the key and a boolean flag as the value, which
is used to specify whether the parameter is required. A destination must
match the pattern method.response.header.{name}
, where
name
is a valid, unique header name. Destinations specified
here are available to the integration for mapping from integration
response parameters.
responseParameters
- Represents response parameters that can be sent back to the caller
by Amazon API Gateway. Response parameters are represented as a
key/value map, with a destination as the key and a boolean flag as
the value, which is used to specify whether the parameter is
required. A destination must match the pattern
method.response.header.{name}
, where
name
is a valid, unique header name. Destinations
specified here are available to the integration for mapping from
integration response parameters.public MethodResponse addResponseParametersEntry(java.lang.String key, java.lang.Boolean value)
public MethodResponse clearResponseParametersEntries()
public java.util.Map<java.lang.String,java.lang.String> getResponseModels()
public void setResponseModels(java.util.Map<java.lang.String,java.lang.String> responseModels)
public MethodResponse withResponseModels(java.util.Map<java.lang.String,java.lang.String> responseModels)
Specifies the Model resources used for the response's content-type. Response models are represented as a key/value map, with a content-type as the key and a Model name as the value.
responseModels
- Specifies the Model resources used for the response's
content-type. Response models are represented as a key/value map,
with a content-type as the key and a Model name as the
value.public MethodResponse addResponseModelsEntry(java.lang.String key, java.lang.String value)
public MethodResponse clearResponseModelsEntries()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public MethodResponse clone()
clone
in class java.lang.Object