# REST Resource: projects.locations.channels

- [Resource: Channel](https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels#Channel)
  - [JSON representation](https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels#Channel.SCHEMA_REPRESENTATION)
- [State](https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels#State)
- [Methods](https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels#METHODS_SUMMARY)

## Resource: Channel

Represents a subscriber's intent to receive events from an event provider. Published events are delivered using the transport associated with the Channel resource. A channel is associated with exactly one event provider.

| JSON representation |
|---|
| ``` { "name": string, "uid": string, "createTime": string, "updateTime": string, "provider": string, "state": enum (`https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels#State`), "activationToken": string, "cryptoKeyName": string, "satisfiesPzs": boolean, "labels": { string: string, ... }, // Union field `transport` can be only one of the following: "pubsubTopic": string // End of list of possible types for union field `transport`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. The resource name of the channel. Must be unique within the location on the project and must be in `projects/{project}/locations/{location}/channels/{channelId}` format. |
| `uid` | `string` Output only. Server assigned unique identifier for the channel. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The creation 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. The last-modified 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"`. |
| `provider` | `string` The name of the event provider (e.g. Eventarc SaaS partner) associated with the channel. This provider will be granted permissions to publish events to the channel. Format: `projects/{project}/locations/{location}/providers/{providerId}`. |
| `state` | ``enum (`https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels#State`)`` Output only. The state of a Channel. |
| `activationToken` | `string` Output only. The activation token for the channel. The token must be used by the provider to register the channel for publishing. |
| `cryptoKeyName` | `string` Optional. Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt their event data. It must match the pattern `projects/*/locations/*/keyRings/*/cryptoKeys/*`. |
| `satisfiesPzs` | `boolean` Output only. Whether or not this Channel satisfies the requirements of physical zone separation |
| `labels` | `map (key: string, value: string)` Optional. Resource labels. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| Union field `transport`. `transport` can be only one of the following: ||
| `pubsubTopic` | `string` Output only. The name of the Pub/Sub topic created and managed by Eventarc system as a transport for the event delivery. Format: `projects/{project}/topics/{topic_id}`. |

## State

State lists all the possible states of a Channel

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Default value. This value is unused. |
| `PENDING` | The PENDING state indicates that a Channel has been created successfully and there is a new activation token available for the subscriber to use to convey the Channel to the provider in order to create a Connection. |
| `ACTIVE` | The ACTIVE state indicates that a Channel has been successfully connected with the event provider. An ACTIVE Channel is ready to receive and route events from the event provider. |
| `INACTIVE` | The INACTIVE state indicates that the Channel cannot receive events permanently. There are two possible cases this state can happen: 1. The SaaS provider disconnected from this Channel. 2. The Channel activation token has expired but the SaaS provider wasn't connected. To re-establish a Connection with a provider, the subscriber should create a new Channel and give it to the provider. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels/create` | Create a new channel in a particular project and location. |
| ### `https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels/delete` | Delete a single channel. |
| ### `https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels/get` | Get a single Channel. |
| ### `https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels/getIamPolicy` | Gets the access control policy for a resource. |
| ### `https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels/list` | List channels. |
| ### `https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels/patch` | Update a single channel. |
| ### `https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels/setIamPolicy` | Sets the access control policy on the specified resource. |
| ### `https://docs.cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.channels/testIamPermissions` | Returns permissions that a caller has on the specified resource. |