in src/Google.Cloud.Functions.Framework/GcfEvents/GcfConverters.cs [240:256]
protected override void PopulateAttributes(Request request, CloudEvent evt)
{
var resource = request.Context.Resource.Name!;
if (StorageResourcePattern.Match(resource) is { Success: true } match)
{
// The source includes the resource name up to the bucket
evt.Source = FormatSource(request.Context.Resource.Service!, match.Groups["resource"].Value);
// Resource name from "objects" onwards, but without the generation
evt.Subject = match.Groups["subject"].Value;
evt[s_bucketAttribute] = match.Groups["bucket"].Value;
}
else
{
// If the resource name didn't match for whatever reason, just use the default behaviour.
base.PopulateAttributes(request, evt);
}
}