2
2
* CloudEvent Protobuf Format
3
3
*
4
4
* - Required context attributes are explicitly represented.
5
- * - Optional and Extension context attributes are carried in a map structure.
5
+ * - Optional context attributes are explicitly represented.
6
+ * - Extension context attributes are carried in a map structure.
6
7
* - Data may be represented as binary, text, or protobuf messages.
7
8
*/
8
9
@@ -21,49 +22,44 @@ option php_namespace = "Io\\CloudEvents\\V1\\Proto";
21
22
option ruby_package = "Io::CloudEvents::V1::Proto" ;
22
23
23
24
message CloudEvent {
24
-
25
- // -- CloudEvent Context Attributes
26
-
27
- // Required Attributes
28
25
string id = 1 ;
29
- string source = 2 ; // URI-reference
26
+ string source = 2 ;
30
27
string spec_version = 3 ;
31
28
string type = 4 ;
32
29
33
- // Optional & Extension Attributes
34
- map <string , CloudEventAttributeValue > attributes = 5 ;
30
+ optional string datacontenttype = 5 ;
31
+ optional string dataschema = 6 ;
32
+ optional string subject = 7 ;
33
+ optional google.protobuf.Timestamp time = 8 ;
35
34
36
- // -- CloudEvent Data (Bytes, Text, or Proto)
37
- oneof data {
38
- bytes binary_data = 6 ;
39
- string text_data = 7 ;
40
- google.protobuf.Any proto_data = 8 ;
35
+ map <string , CloudEventAttributeValue > extensions = 9 ;
36
+
37
+ oneof data {
38
+ bytes binary_data = 10 ;
39
+ string text_data = 11 ;
40
+ google.protobuf.Any proto_data = 12 ;
41
41
}
42
42
43
43
/**
44
44
* The CloudEvent specification defines
45
45
* seven attribute value types...
46
46
*/
47
-
48
47
message CloudEventAttributeValue {
49
-
50
48
oneof attr {
51
- bool ce_boolean = 1 ;
52
- int32 ce_integer = 2 ;
53
- string ce_string = 3 ;
54
- bytes ce_bytes = 4 ;
55
- string ce_uri = 5 ;
56
- string ce_uri_ref = 6 ;
57
- google.protobuf.Timestamp ce_timestamp = 7 ;
49
+ bool bool_value = 1 ;
50
+ int32 integer_value = 2 ;
51
+ string string_value = 3 ;
52
+ bytes bytes_value = 4 ;
53
+ string uri_value = 5 ;
54
+ string uri_ref_value = 6 ;
55
+ google.protobuf.Timestamp timestamp_value = 7 ;
58
56
}
59
57
}
60
58
}
61
59
62
60
/**
63
61
* CloudEvent Protobuf Batch Format
64
- *
65
62
*/
66
-
67
63
message CloudEventBatch {
68
64
repeated CloudEvent events = 1 ;
69
65
}
0 commit comments