Reference documentation and code samples for the Cloud Functions V2 API class Google::Cloud::Functions::V2::EventTrigger.
Describes EventTrigger, used to request events to be sent from another
service.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#channel
defchannel()->::String
Returns
(::String) — 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.
#channel=
defchannel=(value)->::String
Parameter
value (::String) — 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.
Returns
(::String) — 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.
(::String) — Required. The type of event to observe. For example:
google.cloud.audit.log.v1.written or
google.cloud.pubsub.topic.v1.messagePublished.
#event_type=
defevent_type=(value)->::String
Parameter
value (::String) — Required. The type of event to observe. For example:
google.cloud.audit.log.v1.written or
google.cloud.pubsub.topic.v1.messagePublished.
Returns
(::String) — Required. The type of event to observe. For example:
google.cloud.audit.log.v1.written or
google.cloud.pubsub.topic.v1.messagePublished.
#pubsub_topic
defpubsub_topic()->::String
Returns
(::String) — 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.
#pubsub_topic=
defpubsub_topic=(value)->::String
Parameter
value (::String) — 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.
Returns
(::String) — 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.
(::String) — 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.
#service=
defservice=(value)->::String
Parameter
value (::String) — 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.
Returns
(::String) — 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.
#service_account_email
defservice_account_email()->::String
Returns
(::String) — 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.
#service_account_email=
defservice_account_email=(value)->::String
Parameter
value (::String) — 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.
Returns
(::String) — 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.
#trigger
deftrigger()->::String
Returns
(::String) — Output only. The resource name of the Eventarc trigger. The format of this
field is projects/{project}/locations/{region}/triggers/{trigger}.
#trigger_region
deftrigger_region()->::String
Returns
(::String) — 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.
#trigger_region=
deftrigger_region=(value)->::String
Parameter
value (::String) — 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.
Returns
(::String) — 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."],[],[],null,["# Cloud Functions V2 API - Class Google::Cloud::Functions::V2::EventTrigger (v1.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.1.0 (latest)](/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-EventTrigger)\n- [1.0.2](/ruby/docs/reference/google-cloud-functions-v2/1.0.2/Google-Cloud-Functions-V2-EventTrigger)\n- [0.10.0](/ruby/docs/reference/google-cloud-functions-v2/0.10.0/Google-Cloud-Functions-V2-EventTrigger)\n- [0.9.0](/ruby/docs/reference/google-cloud-functions-v2/0.9.0/Google-Cloud-Functions-V2-EventTrigger)\n- [0.8.1](/ruby/docs/reference/google-cloud-functions-v2/0.8.1/Google-Cloud-Functions-V2-EventTrigger)\n- [0.7.0](/ruby/docs/reference/google-cloud-functions-v2/0.7.0/Google-Cloud-Functions-V2-EventTrigger)\n- [0.6.2](/ruby/docs/reference/google-cloud-functions-v2/0.6.2/Google-Cloud-Functions-V2-EventTrigger)\n- [0.5.0](/ruby/docs/reference/google-cloud-functions-v2/0.5.0/Google-Cloud-Functions-V2-EventTrigger)\n- [0.4.1](/ruby/docs/reference/google-cloud-functions-v2/0.4.1/Google-Cloud-Functions-V2-EventTrigger)\n- [0.3.0](/ruby/docs/reference/google-cloud-functions-v2/0.3.0/Google-Cloud-Functions-V2-EventTrigger)\n- [0.2.0](/ruby/docs/reference/google-cloud-functions-v2/0.2.0/Google-Cloud-Functions-V2-EventTrigger)\n- [0.1.0](/ruby/docs/reference/google-cloud-functions-v2/0.1.0/Google-Cloud-Functions-V2-EventTrigger) \nReference documentation and code samples for the Cloud Functions V2 API class Google::Cloud::Functions::V2::EventTrigger.\n\nDescribes EventTrigger, used to request events to be sent from another\nservice. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #channel\n\n def channel() -\u003e ::String\n\n**Returns**\n\n- (::String) --- 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.\n\n### #channel=\n\n def channel=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- 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. \n**Returns**\n\n- (::String) --- 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.\n\n### #event_filters\n\n def event_filters() -\u003e ::Array\u003c::Google::Cloud::Functions::V2::EventFilter\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::Functions::V2::EventFilter](./Google-Cloud-Functions-V2-EventFilter)\\\u003e) --- Criteria used to filter events.\n\n### #event_filters=\n\n def event_filters=(value) -\u003e ::Array\u003c::Google::Cloud::Functions::V2::EventFilter\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Cloud::Functions::V2::EventFilter](./Google-Cloud-Functions-V2-EventFilter)\\\u003e) --- Criteria used to filter events. \n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::Functions::V2::EventFilter](./Google-Cloud-Functions-V2-EventFilter)\\\u003e) --- Criteria used to filter events.\n\n### #event_type\n\n def event_type() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. The type of event to observe. For example: `google.cloud.audit.log.v1.written` or `google.cloud.pubsub.topic.v1.messagePublished`.\n\n### #event_type=\n\n def event_type=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. The type of event to observe. For example: `google.cloud.audit.log.v1.written` or `google.cloud.pubsub.topic.v1.messagePublished`. \n**Returns**\n\n- (::String) --- Required. The type of event to observe. For example: `google.cloud.audit.log.v1.written` or `google.cloud.pubsub.topic.v1.messagePublished`.\n\n### #pubsub_topic\n\n def pubsub_topic() -\u003e ::String\n\n**Returns**\n\n- (::String) --- 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}`.\n\n\n This is only valid for events of type\n `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here\n will not be deleted at function deletion.\n\n### #pubsub_topic=\n\n def pubsub_topic=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- 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}`.\n\n\n This 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**Returns**\n\n- (::String) --- 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}`.\n\n\n This is only valid for events of type\n `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here\n will not be deleted at function deletion.\n\n### #retry_policy\n\n def retry_policy() -\u003e ::Google::Cloud::Functions::V2::EventTrigger::RetryPolicy\n\n**Returns**\n\n- ([::Google::Cloud::Functions::V2::EventTrigger::RetryPolicy](./Google-Cloud-Functions-V2-EventTrigger-RetryPolicy)) --- Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).\n\n### #retry_policy=\n\n def retry_policy=(value) -\u003e ::Google::Cloud::Functions::V2::EventTrigger::RetryPolicy\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Functions::V2::EventTrigger::RetryPolicy](./Google-Cloud-Functions-V2-EventTrigger-RetryPolicy)) --- Optional. If unset, then defaults to ignoring failures (i.e. not retrying them). \n**Returns**\n\n- ([::Google::Cloud::Functions::V2::EventTrigger::RetryPolicy](./Google-Cloud-Functions-V2-EventTrigger-RetryPolicy)) --- Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).\n\n### #service\n\n def service() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. The hostname of the service that 1st Gen function should be observed.\n\n If no string is provided, the default service implementing the API will\n be used. For example, `storage.googleapis.com` is the default for all\n event types in the `google.storage` namespace.\n\n The field is only applicable to 1st Gen functions.\n\n### #service=\n\n def service=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. The hostname of the service that 1st Gen function should be observed.\n\n\n If no string is provided, the default service implementing the API will\n be used. For example, `storage.googleapis.com` is the default for all\n event types in the `google.storage` namespace.\n\nThe field is only applicable to 1st Gen functions. \n**Returns**\n\n- (::String) --- Optional. The hostname of the service that 1st Gen function should be observed.\n\n If no string is provided, the default service implementing the API will\n be used. For example, `storage.googleapis.com` is the default for all\n event types in the `google.storage` namespace.\n\n The field is only applicable to 1st Gen functions.\n\n### #service_account_email\n\n def service_account_email() -\u003e ::String\n\n**Returns**\n\n- (::String) --- 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`.\n\n### #service_account_email=\n\n def service_account_email=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- 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`. \n**Returns**\n\n- (::String) --- 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`.\n\n### #trigger\n\n def trigger() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Output only. The resource name of the Eventarc trigger. The format of this field is `projects/{project}/locations/{region}/triggers/{trigger}`.\n\n### #trigger_region\n\n def trigger_region() -\u003e ::String\n\n**Returns**\n\n- (::String) --- 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.\n\n### #trigger_region=\n\n def trigger_region=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- 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. \n**Returns**\n\n- (::String) --- 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."]]