in lib/functions_framework/legacy_event_converter.rb [116:131]
def construct_cloud_event context, data
source, subject = convert_source context[:service], context[:resource], context[:domain]
type = LEGACY_TYPE_TO_CE_TYPE[context[:type]]
return nil unless type && source
ce_data, data_subject = convert_data context, data
content_type = "application/json"
::CloudEvents::Event.new id: context[:id],
source: source,
type: type,
spec_version: "1.0",
data_content_type: content_type,
data: ce_data,
subject: subject || data_subject,
time: context[:timestamp]
end