Show / Hide Table of Contents

Interface IIntegrationResponse

Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IIntegrationResponse
Syntax (vb)
Public Interface 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

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.

Properties

ContentHandling

Specifies how to handle request payload content type conversions.

virtual Nullable<ContentHandling> ContentHandling { get; }
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.

virtual IDictionary<string, string> ResponseParameters { get; }
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.

    virtual IDictionary<string, string> ResponseTemplates { get; }
    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.

    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.

    virtual string SelectionPattern { get; }
    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.

    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

    System.String

    Back to top Generated by DocFX