Class IntegrationResponse
- Namespace
- Amazon.CDK.AWS.APIGateway
- Assembly
- Amazon.CDK.AWS.APIGateway.dll
public class IntegrationResponse : IIntegrationResponse
- Inheritance
-
IntegrationResponse
- Implements
- Inherited Members
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APIGateway;
var integrationResponse = new IntegrationResponse {
StatusCode = "statusCode",
// the properties below are optional
ContentHandling = ContentHandling.CONVERT_TO_BINARY,
ResponseParameters = new Dictionary<string, string> {
{ "responseParametersKey", "responseParameters" }
},
ResponseTemplates = new Dictionary<string, string> {
{ "responseTemplatesKey", "responseTemplates" }
},
SelectionPattern = "selectionPattern"
};
Remarks
ExampleMetadata: fixture=_generated
Constructors
IntegrationResponse()
public IntegrationResponse()
Properties
ContentHandling
Specifies how to handle request payload content type conversions.
public ContentHandling? ContentHandling { get; set; }
Property Value
Remarks
Default: none the request payload is passed through from the method request to the integration request without modification.
ResponseParameters
The response parameters from the backend response that API Gateway sends to the method response.
public IDictionary<string, string>? ResponseParameters { get; set; }
Property Value
Remarks
Use the destination as the key and the source as the value:
See: http://docs.aws.amazon.com/apigateway/latest/developerguide/request-response-data-mappings.html
ResponseTemplates
The templates that are used to transform the integration response body.
public IDictionary<string, string>? ResponseTemplates { get; set; }
Property Value
Remarks
Specify templates as key-value pairs, with a content type as the key and a template as the value.
SelectionPattern
Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end.
public string? SelectionPattern { get; set; }
Property Value
Remarks
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.
StatusCode
The status code that API Gateway uses to map the integration response to a MethodResponse status code.
public string StatusCode { get; set; }