Class IntegrationResponse
Inheritance
Implements
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class IntegrationResponse : Object, IIntegrationResponse
Syntax (vb)
Public Class IntegrationResponse
Inherits Object
Implements IIntegrationResponse
Remarks
ExampleMetadata: fixture=_generated
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"
};
Synopsis
Constructors
IntegrationResponse() |
Properties
ContentHandling | Specifies how to handle request payload content type conversions. |
ResponseParameters | The response parameters from the backend response that API Gateway sends to the method response. |
ResponseTemplates | The templates that are used to transform the integration response body. |
SelectionPattern | Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end. |
StatusCode | The status code that API Gateway uses to map the integration response to a MethodResponse status code. |
Constructors
IntegrationResponse()
public IntegrationResponse()
Properties
ContentHandling
Specifies how to handle request payload content type conversions.
public Nullable<ContentHandling> ContentHandling { get; set; }
Property Value
System.Nullable<ContentHandling>
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
System.Collections.Generic.IDictionary<System.String, System.String>
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
System.Collections.Generic.IDictionary<System.String, System.String>
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
System.String
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; }
Property Value
System.String