Channel class
Stay organized with collections
Save and categorize content based on your preferences.
Eventarc Channel.
Signature:
export declare class Channel
Properties
Property |
Modifiers |
Type |
Description |
allowedEventTypes |
|
string[] |
List of event types allowed by this channel for publishing. Other event types are ignored. |
eventarc |
|
Eventarc |
The Eventarc service instance associated with the current Channel . |
name |
|
string |
The channel name as provided during channel creation. If it was not specifed, the default channel name is returned ('locations/us-central1/channels/firebase'). |
Methods
Method |
Modifiers |
Description |
publish(events) |
|
Publishes provided events to this channel. If channel was created with allowedEventTypes and event type is not on that list, the event is ignored. |
Channel.allowedEventTypes
List of event types allowed by this channel for publishing. Other event types are ignored.
Signature:
readonly allowedEventTypes?: string[];
Channel.eventarc
The Eventarc service instance associated with the current Channel
.
Signature:
get eventarc(): Eventarc;
Example
var app = channel.eventarc;
Channel.name
The channel name as provided during channel creation. If it was not specifed, the default channel name is returned ('locations/us-central1/channels/firebase').
Signature:
get name(): string;
Channel.publish()
Publishes provided events to this channel. If channel was created with allowedEventTypes
and event type is not on that list, the event is ignored.
Signature:
publish(events: CloudEvent | CloudEvent[]): Promise<void>;
Parameters
Returns:
Promise<void>
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-07-29 UTC.
[null,null,["Last updated 2022-07-29 UTC."],[],[],null,["# Channel class\n\nEventarc Channel.\n\n**Signature:** \n\n export declare class Channel \n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|------------------------------------------------------------------------------------|-----------|------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [allowedEventTypes](./firebase-admin.eventarc.channel.md#channelallowedeventtypes) | | string\\[\\] | List of event types allowed by this channel for publishing. Other event types are ignored. |\n| [eventarc](./firebase-admin.eventarc.channel.md#channeleventarc) | | [Eventarc](./firebase-admin.eventarc.eventarc.md#eventarc_class) | The [Eventarc](./firebase-admin.eventarc.eventarc.md#eventarc_class) service instance associated with the current `Channel`. |\n| [name](./firebase-admin.eventarc.channel.md#channelname) | | string | The channel name as provided during channel creation. If it was not specifed, the default channel name is returned ('locations/us-central1/channels/firebase'). |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|------------------------------------------------------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [publish(events)](./firebase-admin.eventarc.channel.md#channelpublish) | | Publishes provided events to this channel. If channel was created with `allowedEventTypes` and event type is not on that list, the event is ignored. |\n\nChannel.allowedEventTypes\n-------------------------\n\nList of event types allowed by this channel for publishing. Other event types are ignored.\n\n**Signature:** \n\n readonly allowedEventTypes?: string[];\n\nChannel.eventarc\n----------------\n\nThe [Eventarc](./firebase-admin.eventarc.eventarc.md#eventarc_class) service instance associated with the current `Channel`.\n\n**Signature:** \n\n get eventarc(): Eventarc;\n\n### Example\n\n var app = channel.eventarc;\n\nChannel.name\n------------\n\nThe channel name as provided during channel creation. If it was not specifed, the default channel name is returned ('locations/us-central1/channels/firebase').\n\n**Signature:** \n\n get name(): string;\n\nChannel.publish()\n-----------------\n\nPublishes provided events to this channel. If channel was created with `allowedEventTypes` and event type is not on that list, the event is ignored.\n\n**Signature:** \n\n publish(events: CloudEvent | CloudEvent[]): Promise\u003cvoid\u003e;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------|\n| events | [CloudEvent](./firebase-admin.eventarc.cloudevent.md#cloudevent_interface) \\| [CloudEvent](./firebase-admin.eventarc.cloudevent.md#cloudevent_interface)\\[\\] | CloudEvent to publish to the channel. |\n\n**Returns:**\n\nPromise\\\u003cvoid\\\u003e"]]