# REST Resource: projects.locations.connections.eventSubscriptions

- [Resource: EventSubscription](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EventSubscription)
  - [JSON representation](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EventSubscription.SCHEMA_REPRESENTATION)
- [EventSubscriptionStatus](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EventSubscriptionStatus)
  - [JSON representation](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EventSubscriptionStatus.SCHEMA_REPRESENTATION)
- [State](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#State)
- [EventSubscriptionDestination](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EventSubscriptionDestination)
  - [JSON representation](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EventSubscriptionDestination.SCHEMA_REPRESENTATION)
- [Type](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#Type)
- [EndPoint](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EndPoint)
  - [JSON representation](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EndPoint.SCHEMA_REPRESENTATION)
- [Header](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#Header)
  - [JSON representation](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#Header.SCHEMA_REPRESENTATION)
- [PubSub](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#PubSub)
  - [JSON representation](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#PubSub.SCHEMA_REPRESENTATION)
- [JMS](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#JMS)
  - [JSON representation](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#JMS.SCHEMA_REPRESENTATION)
- [Type](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#Type_1)
- [Methods](https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#METHODS_SUMMARY)

## Resource: EventSubscription

represents the Connector's EventSubscription resource

| JSON representation |
|---|
| ``` { "name": string, "createTime": string, "updateTime": string, "eventTypeId": string, "subscriber": string, "subscriberLink": string, "status": { object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EventSubscriptionStatus`) }, "destinations": { object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EventSubscriptionDestination`) }, "triggerConfigVariables": [ { object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/ConfigVariable`) } ], // Union field `source` can be only one of the following: "jms": { object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#JMS`) } // End of list of possible types for union field `source`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. Resource name of the EventSubscription. Format: projects/{project}/locations/{location}/connections/{connection}/eventSubscriptions/{eventSubscription} |
| `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 uses 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 uses 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"`. |
| `eventTypeId` | `string` Optional. Event type id of the event of current EventSubscription. |
| `subscriber` | `string` Optional. name of the Subscriber for the current EventSubscription. |
| `subscriberLink` | `string` Optional. Link for Subscriber of the current EventSubscription. |
| `status` | ``object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EventSubscriptionStatus`)`` Optional. Status indicates the status of the event subscription resource |
| `destinations` | ``object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EventSubscriptionDestination`)`` Optional. The destination to hit when we receive an event |
| `triggerConfigVariables[]` | ``object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/ConfigVariable`)`` Optional. Configuration for configuring the trigger |
| Union field `source`. The source of the event `source` can be only one of the following: ||
| `jms` | ``object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#JMS`)`` Optional. JMS is the source for the event listener. |

## EventSubscriptionStatus

EventSubscription Status denotes the status of the EventSubscription resource.

| JSON representation |
|---|
| ``` { "state": enum (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#State`), "description": string } ``` |

| Fields ||
|---|---|
| `state` | ``enum (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#State`)`` Output only. State of Event Subscription resource. |
| `description` | `string` Output only. Description of the state. |

## State

All the possible EventSubscription statuses.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Default state. |
| `CREATING` | EventSubscription creation is in progress. |
| `UPDATING` | EventSubscription is in Updating status. |
| `ACTIVE` | EventSubscription is in Active state and is ready to receive events. |
| `SUSPENDED` | EventSubscription is currently suspended. |
| `ERROR` | EventSubscription is in Error state. |

## EventSubscriptionDestination

Message for EventSubscription Destination to act on receiving an event

| JSON representation |
|---|
| ``` { "type": enum (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#Type`), "serviceAccount": string, // Union field `destination` can be only one of the following: "endpoint": { object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EndPoint`) }, "pubsub": { object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#PubSub`) } // End of list of possible types for union field `destination`. } ``` |

| Fields ||
|---|---|
| `type` | ``enum (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#Type`)`` type of the destination |
| `serviceAccount` | `string` Service account needed for runtime plane to trigger IP workflow. |
| Union field `destination`. `destination` can be only one of the following: ||
| `endpoint` | ``object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#EndPoint`)`` OPTION 1: Hit an endpoint when we receive an event. |
| `pubsub` | ``object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#PubSub`)`` OPTION 3: Write the event to Pub/Sub topic. |

## Type

Types of the Destination in EventSubscription

| Enums ||
|---|---|
| `TYPE_UNSPECIFIED` | Default state. |
| `ENDPOINT` | Endpoint - Hit the value of endpoint when event is received |
| `GCS` | Cloud Storage - Write the event to Cloud Storage bucket |
| `PUBSUB` | Pub/Sub - Write the event to Pub/Sub topic |

## EndPoint

Endpoint message includes details of the Destination endpoint.

| JSON representation |
|---|
| ``` { "endpointUri": string, "headers": [ { object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#Header`) } ] } ``` |

| Fields ||
|---|---|
| `endpointUri` | `string` The URI of the Endpoint. |
| `headers[]` | ``object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#Header`)`` List of Header to be added to the Endpoint. |

## Header

Header details for a given header to be added to Endpoint.

| JSON representation |
|---|
| ``` { "key": string, "value": string } ``` |

| Fields ||
|---|---|
| `key` | `string` Key of Header. |
| `value` | `string` Value of Header. |

## PubSub

Pub/Sub message includes details of the Destination Pub/Sub topic.

| JSON representation |
|---|
| ``` { "projectId": string, "topicId": string, "configVariables": [ { object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/ConfigVariable`) } ], "attributes": { string: string, ... } } ``` |

| Fields ||
|---|---|
| `projectId` | `string` Required. The project id which has the Pub/Sub topic. |
| `topicId` | `string` Required. The topic id of the Pub/Sub topic. |
| `configVariables[]` | ``object (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/ConfigVariable`)`` Optional. Configuration for configuring the trigger |
| `attributes` | `map (key: string, value: string)` Optional. Pub/Sub message attributes to be added to the Pub/Sub message. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |

## JMS

JMS message denotes the source of the event

| JSON representation |
|---|
| ``` { "type": enum (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#Type_1`), "name": string } ``` |

| Fields ||
|---|---|
| `type` | ``enum (`https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions#Type_1`)`` Optional. Type of the JMS Source. i.e. Queue or Topic |
| `name` | `string` Optional. Name of the JMS source. i.e. queueName or topicName |

## Type

Type of the JMS Source. i.e. Queue or Topic

| Enums ||
|---|---|
| `TYPE_UNSPECIFIED` | Default state. |
| `QUEUE` | JMS Queue. |
| `TOPIC` | JMS Topic. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions/create` | Creates a new EventSubscription in a given project,location and connection. |
| ### `https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions/delete` | Deletes a single EventSubscription. |
| ### `https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions/get` | Gets details of a single EventSubscription. |
| ### `https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions/list` | List EventSubscriptions in a given project,location and connection. |
| ### `https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions/patch` | Updates the parameters of a single EventSubscription. |
| ### `https://docs.cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections.eventSubscriptions/retry` | RetryEventSubscription retries the registration of Subscription. |