/******************************************************************************** * Copyright (c) 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. * * This program and the accompanying materials are made available under the * terms of the Apache License Version 2.0 which is available at * https://www.apache.org/licenses/LICENSE-2.0 * * SPDX-License-Identifier: Apache-2.0 * * CloudEvent Protobuf Format * * - Required context attributes are explicity represented. * - Optional and Extension context attributes are carried in a map structure. * - Data may be represented as binary, text, or protobuf messages. * * This file is a verbatim copy of * https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/cloudevents.proto */ syntax = "proto3"; package io.cloudevents.v1; import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "CloudNative.CloudEvents.V1"; option go_package = "cloudevents.io/genproto/v1"; option java_package = "io.cloudevents.v1.proto"; option java_multiple_files = true; option php_namespace = "Io\\CloudEvents\\V1\\Proto"; option ruby_package = "Io::CloudEvents::V1::Proto"; message CloudEvent { // -- CloudEvent Context Attributes // Required Attributes string id = 1; string source = 2; // URI-reference string spec_version = 3; string type = 4; // Optional & Extension Attributes map attributes = 5; // -- CloudEvent Data (Bytes, Text, or Proto) oneof data { bytes binary_data = 6; string text_data = 7; google.protobuf.Any proto_data = 8; } /** * The CloudEvent specification defines * seven attribute value types... */ message CloudEventAttributeValue { oneof attr { bool ce_boolean = 1; int32 ce_integer = 2; string ce_string = 3; bytes ce_bytes = 4; string ce_uri = 5; string ce_uri_ref = 6; google.protobuf.Timestamp ce_timestamp = 7; } } } /** * CloudEvent Protobuf Batch Format * */ message CloudEventBatch { repeated CloudEvent events = 1; }