- [Resource: Gateway](https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways#Gateway)
  - [JSON representation](https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways#Gateway.SCHEMA_REPRESENTATION)
- [State](https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways#State)
- [StreamingMode](https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways#StreamingMode)
- [EffectiveStreamingMode](https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways#EffectiveStreamingMode)
- [Methods](https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways#METHODS_SUMMARY)

## Resource: Gateway

A Gateway is an API-aware HTTP proxy. It performs API-Method and/or API-Consumer specific actions based on an API Config such as authentication, policy enforcement, and backend selection.

| JSON representation |
|---|
| ``` { "name": string, "createTime": string, "updateTime": string, "labels": { string: string, ... }, "displayName": string, "apiConfig": string, "state": enum (`https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways#State`), "defaultHostname": string, "streamingMode": enum (`https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways#StreamingMode`), "effectiveStreamingMode": enum (`https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways#EffectiveStreamingMode`) } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. Resource name of the Gateway. Format: projects/{project}/locations/{location}/gateways/{gateway} |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Created time. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Updated time. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `labels` | `map (key: string, value: string)` Optional. Resource labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. <https://cloud.google.com/compute/docs/labeling-resources> An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `displayName` | `string` Optional. Display name. |
| `apiConfig` | `string` Required. Resource name of the API Config for this Gateway. Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig} |
| `state` | ``enum (`https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways#State`)`` Output only. The current state of the Gateway. |
| `defaultHostname` | `string` Output only. The default hostname that serves traffic for this Gateway. |
| `streamingMode` | ``enum (`https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways#StreamingMode`)`` Optional. Immutable. Requests streaming for a new gateway. An attempt to change it on update is rejected. If unset, the service selects the mode. This field records only what was requested and is never modified by the service; read `effectiveStreamingMode` for the mode the gateway is served with. |
| `effectiveStreamingMode` | ``enum (`https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways#EffectiveStreamingMode`)`` Output only. The streaming mode this gateway is actually served with, which the service resolves at creation from `streamingMode`, the referenced API Config, and the platform default at the time. Read this rather than `streamingMode` to determine whether a gateway supports streaming. |

## State

All the possible Gateway states.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Gateway does not have a state yet. |
| `CREATING` | Gateway is being created. |
| `ACTIVE` | Gateway is running and ready for requests. |
| `FAILED` | Gateway creation failed. |
| `DELETING` | Gateway is being deleted. |
| `UPDATING` | Gateway is being updated. |

## StreamingMode

Streaming mode for a Gateway. This enum is frozen. No values are expected to be added in the future.

| Enums ||
|---|---|
| `STREAMING_MODE_UNSPECIFIED` | Lets the service select the streaming mode. |
| `STREAMING_MODE_ENABLED` | Enables streaming. The gateway supports Server-Sent Events (SSE), HTTP/2 streaming, HTTP chunked transfer, WebSockets, and gRPC bidirectional streaming. The API config's backend `deadline` field governs how long a request (unary or streaming) may run. Enabling streaming on a gateway does not change how the `deadline` field behaves on an SSE or chunked-transfer path. The deadline remains a wall-clock bound on the complete response, so a stream is cut once the deadline elapses regardless of how much data it is sending. The default is 15 seconds and the maximum is 3,600 seconds. On gRPC streaming and WebSockets, `deadline` bounds the gap between messages instead: default 300 seconds; set `deadline` to change it, up to 3,600 seconds. On WebSockets, a `deadline` of less than 300 seconds is ignored and a 300-second minimum applies. The maximum total request duration is always 3,600 seconds, not configurable. |

## EffectiveStreamingMode

The streaming mode a Gateway is served with. This enum is frozen. No values are expected to be added in the future.

| Enums ||
|---|---|
| `EFFECTIVE_STREAMING_MODE_UNSPECIFIED` | Indicates that the service has not resolved a mode. Every gateway returned by `gateways.get` and `gateways.list` carries a resolved mode, so this value should not be returned under normal circumstances. |
| `EFFECTIVE_STREAMING_MODE_DISABLED` | Indicates that the gateway does not support streaming. |
| `EFFECTIVE_STREAMING_MODE_ENABLED` | Indicates that the gateway supports streaming. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways/create` | Creates a new Gateway in a given project and location. |
| ### `https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways/delete` | Deletes a single Gateway. |
| ### `https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways/get` | Gets details of a single Gateway. |
| ### `https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways/getIamPolicy` | Gets the access control policy for a resource. |
| ### `https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways/list` | Lists Gateways in a given project and location. |
| ### `https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways/patch` | Updates the parameters of a single Gateway. |
| ### `https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways/setIamPolicy` | Sets the access control policy on the specified resource. |
| ### `https://docs.cloud.google.com/api-gateway/docs/reference/rest/v1/projects.locations.gateways/testIamPermissions` | Returns permissions that a caller has on the specified resource. |