Table of Contents

Interface IIntegrationResponse

Namespace
Amazon.CDK.AWS.APIGateway
Assembly
Amazon.CDK.AWS.APIGateway.dll
public interface IIntegrationResponse

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

Properties

ContentHandling

Specifies how to handle request payload content type conversions.

ContentHandling? ContentHandling { get; }

Property Value

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.

IDictionary<string, string>? ResponseParameters { get; }

Property Value

IDictionary<string, 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.

    IDictionary<string, string>? ResponseTemplates { get; }

    Property Value

    IDictionary<string, string>

    Remarks

    Specify templates as key-value pairs, with a content type as the key and a template as the value.

    See: http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html

    SelectionPattern

    Specifies the regular expression (regex) pattern used to choose an integration response based on the response from the back end.

    string? SelectionPattern { get; }

    Property Value

    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.

    See: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-integration-settings-integration-response.html

    StatusCode

    The status code that API Gateway uses to map the integration response to a MethodResponse status code.

    string StatusCode { get; }

    Property Value

    string