Optional. The name of the channel associated with the trigger in
projects/{project}/locations/{location}/channels/{channel} format.
You must provide a channel to receive events from Eventarc SaaS partners.
Optional. The name of a Pub/Sub topic in the same project that will be used
as the transport topic for the event delivery. Format:
projects/{project}/topics/{topic}.
This is only valid for events of type
google.cloud.pubsub.topic.v1.messagePublished. The topic provided here
will not be deleted at function deletion.
Optional. The hostname of the service that 1st Gen function should be
observed.
If no string is provided, the default service implementing the API will
be used. For example, storage.googleapis.com is the default for all
event types in the google.storage namespace.
The field is only applicable to 1st Gen functions.
Optional. The email of the trigger's service account. The service account
must have permission to invoke Cloud Run services, the permission is
run.routes.invoke.
If empty, defaults to the Compute Engine default service account:
{project_number}-compute@developer.gserviceaccount.com.
The region that the trigger will be in. The trigger will only receive
events originating in this region. It can be the same
region as the function, a different region or multi-region, or the global
region. If not provided, defaults to the same region as the function.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eEventTrigger\u003c/code\u003e class is 1.7.0, with versions back to 1.0.0 available for reference in the documentation.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eEventTrigger\u003c/code\u003e is used to configure events to be sent from another service, implemented via the \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e interfaces.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eEventTrigger\u003c/code\u003e class allows you to define the channel, event type, and filtering criteria for events, including the optional specification of a Pub/Sub topic and a retry policy.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eEventTrigger\u003c/code\u003e class has properties to specify the service, service account email, and trigger region for the events.\u003c/p\u003e\n"],["\u003cp\u003eThe EventTrigger class contains constructors for initialization, as well as channel name, topic name, trigger name, and type properties.\u003c/p\u003e\n"]]],[],null,["# Cloud Functions v2 API - Class EventTrigger (1.7.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.7.0 (latest)](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.EventTrigger)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.6.0/Google.Cloud.Functions.V2.EventTrigger)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.5.0/Google.Cloud.Functions.V2.EventTrigger)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.4.0/Google.Cloud.Functions.V2.EventTrigger)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.3.0/Google.Cloud.Functions.V2.EventTrigger)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.2.0/Google.Cloud.Functions.V2.EventTrigger)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.1.0/Google.Cloud.Functions.V2.EventTrigger)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.0.0/Google.Cloud.Functions.V2.EventTrigger) \n\n public sealed class EventTrigger : IMessage\u003cEventTrigger\u003e, IEquatable\u003cEventTrigger\u003e, IDeepCloneable\u003cEventTrigger\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Functions v2 API class EventTrigger.\n\nDescribes EventTrigger, used to request events to be sent from another\nservice. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e EventTrigger \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[EventTrigger](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.EventTrigger), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[EventTrigger](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.EventTrigger), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[EventTrigger](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.EventTrigger), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Functions.V2](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2)\n\nAssembly\n--------\n\nGoogle.Cloud.Functions.V2.dll\n\nConstructors\n------------\n\n### EventTrigger()\n\n public EventTrigger()\n\n### EventTrigger(EventTrigger)\n\n public EventTrigger(EventTrigger other)\n\nProperties\n----------\n\n### Channel\n\n public string Channel { get; set; }\n\nOptional. The name of the channel associated with the trigger in\n`projects/{project}/locations/{location}/channels/{channel}` format.\nYou must provide a channel to receive events from Eventarc SaaS partners.\n\n### ChannelAsChannelName\n\n public ChannelName ChannelAsChannelName { get; set; }\n\n[ChannelName](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.ChannelName)-typed view over the [Channel](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.EventTrigger#Google_Cloud_Functions_V2_EventTrigger_Channel) resource name property.\n\n### EventFilters\n\n public RepeatedField\u003cEventFilter\u003e EventFilters { get; }\n\nCriteria used to filter events.\n\n### EventType\n\n public string EventType { get; set; }\n\nRequired. The type of event to observe. For example:\n`google.cloud.audit.log.v1.written` or\n`google.cloud.pubsub.topic.v1.messagePublished`.\n\n### PubsubTopic\n\n public string PubsubTopic { get; set; }\n\nOptional. The name of a Pub/Sub topic in the same project that will be used\nas the transport topic for the event delivery. Format:\n`projects/{project}/topics/{topic}`.\n\nThis is only valid for events of type\n`google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here\nwill not be deleted at function deletion.\n\n### PubsubTopicAsTopicName\n\n public TopicName PubsubTopicAsTopicName { get; set; }\n\n[TopicName](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.TopicName)-typed view over the [PubsubTopic](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.EventTrigger#Google_Cloud_Functions_V2_EventTrigger_PubsubTopic) resource name property.\n\n### RetryPolicy\n\n public EventTrigger.Types.RetryPolicy RetryPolicy { get; set; }\n\nOptional. If unset, then defaults to ignoring failures (i.e. not retrying\nthem).\n\n### Service\n\n public string Service { get; set; }\n\nOptional. The hostname of the service that 1st Gen function should be\nobserved.\n\nIf no string is provided, the default service implementing the API will\nbe used. For example, `storage.googleapis.com` is the default for all\nevent types in the `google.storage` namespace.\n\nThe field is only applicable to 1st Gen functions.\n\n### ServiceAccountEmail\n\n public string ServiceAccountEmail { get; set; }\n\nOptional. The email of the trigger's service account. The service account\nmust have permission to invoke Cloud Run services, the permission is\n`run.routes.invoke`.\nIf empty, defaults to the Compute Engine default service account:\n`{project_number}-compute@developer.gserviceaccount.com`.\n\n### Trigger\n\n public string Trigger { get; set; }\n\nOutput only. The resource name of the Eventarc trigger. The format of this\nfield is `projects/{project}/locations/{region}/triggers/{trigger}`.\n\n### TriggerAsTriggerName\n\n public TriggerName TriggerAsTriggerName { get; set; }\n\n[TriggerName](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.TriggerName)-typed view over the [Trigger](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.EventTrigger#Google_Cloud_Functions_V2_EventTrigger_Trigger) resource name property.\n\n### TriggerRegion\n\n public string TriggerRegion { get; set; }\n\nThe region that the trigger will be in. The trigger will only receive\nevents originating in this region. It can be the same\nregion as the function, a different region or multi-region, or the global\nregion. If not provided, defaults to the same region as the function."]]