# GatewayResponseProps

Properties for a new gateway response.

Extends: [GatewayResponseOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.GatewayResponseOptions.html)
Used as props by: [GatewayResponse](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.GatewayResponse.html)

- Source: [`aws-apigateway/lib/gateway-response.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-apigateway/lib/gateway-response.ts#L25)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigateway as apigateway } from 'aws-cdk-lib';

declare const responseType: apigateway.ResponseType;
declare const restApi: apigateway.RestApi;
const gatewayResponseProps: apigateway.GatewayResponseProps = {
  restApi: restApi,
  type: responseType,

  // the properties below are optional
  responseHeaders: {
    responseHeadersKey: 'responseHeaders',
  },
  statusCode: 'statusCode',
  templates: {
    templatesKey: 'templates',
  },
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_apigateway as apigateway

# response_type: apigateway.ResponseType
# rest_api: apigateway.RestApi

gateway_response_props = apigateway.GatewayResponseProps(
    rest_api=rest_api,
    type=response_type,

    # the properties below are optional
    response_headers={
        "response_headers_key": "responseHeaders"
    },
    status_code="statusCode",
    templates={
        "templates_key": "templates"
    }
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.apigateway.*;

ResponseType responseType;
RestApi restApi;

GatewayResponseProps gatewayResponseProps = GatewayResponseProps.builder()
        .restApi(restApi)
        .type(responseType)

        // the properties below are optional
        .responseHeaders(Map.of(
                "responseHeadersKey", "responseHeaders"))
        .statusCode("statusCode")
        .templates(Map.of(
                "templatesKey", "templates"))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APIGateway;

ResponseType responseType;
RestApi restApi;

var gatewayResponseProps = new GatewayResponseProps {
    RestApi = restApi,
    Type = responseType,

    // the properties below are optional
    ResponseHeaders = new Dictionary<string, string> {
        { "responseHeadersKey", "responseHeaders" }
    },
    StatusCode = "statusCode",
    Templates = new Dictionary<string, string> {
        { "templatesKey", "templates" }
    }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var responseType ResponseType
var restApi RestApi

gatewayResponseProps := &GatewayResponseProps{
	RestApi: restApi,
	Type: responseType,

	// the properties below are optional
	ResponseHeaders: map[string]*string{
		"responseHeadersKey": jsii.String("responseHeaders"),
	},
	StatusCode: jsii.String("statusCode"),
	Templates: map[string]*string{
		"templatesKey": jsii.String("templates"),
	},
}
```

## Properties

- `responseHeaders`: { [key: string]: string } — Custom headers parameters for response.

  **Default:** no headers

- `restApi`: [IRestApi](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IRestApi.html) (required) — Rest api resource to target.

- `statusCode`: string — Http status code for response.

  **Default:** standard http status code for the response type.

- `templates`: { [key: string]: string } — Custom templates to get mapped as response.

  **Default:** Response from api will be returned without applying any transformation.

- `type`: [ResponseType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (required) — Response type to associate with gateway response.
