Event Filter on "id" attribute of google.cloud.storage.object.v1.finalized event

Hi!

I am looking to add an event filter to a cloud event trigger that filters on the id attribute of the google.cloud.storage.object.v1.finalized event.

Looking at the schema of the event the id attribute is present - https://github.com/googleapis/google-cloudevents/blob/main/jsonschema/google/events/cloud/storage/v1...

But when I try and create the function with this event filter I get the following error:

 

 The request was invalid: invalid argument: event type google.cloud.storage.object.v1.finalized not supported: attribute id not found within event type

 

 

How do I determine what attributes are available for event filters if not from the schema?

TIA 🍻

0 1 373
1 REPLY 1

It seems there might be a misunderstanding in how the event filter is being applied. The error suggests that the attribute id is not found within the specified event type, even though it appears in the schema you linked.

The issue might be related to the way the filter is configured or the specific syntax used for the event filter. Typically, event filters are set based on certain criteria within the event payload or attributes. Here's an example of how you might filter by the id attribute for the google.cloud.storage.object.v1.finalized event:
```
{
"eventType": "google.cloud.storage.object.v1.finalized",
"filter": {
"attribute": "id",
"value": "your-desired-id"
}
}
```
Ensure that the filter syntax aligns with the requirements of the platform or service you're using for event filtering. Also, make sure that the id attribute is indeed present in the payload or metadata of the event type you're filtering.

If the issue persists, it might be beneficial to check the specific documentation or support resources for the platform you're working on.