Oneof Type.
message AnExampleMessage { oneof some_oneof_field { int32 some_integer = 1; string some_string = 2; } }
Assigning one field clears others
Enum Type.
enum AnEnum { INITIAL = 0; RED = 1; BLUE = 2; GREEN = 3; WHATEVER = 8; }
Must include zero
Any Type.
import "google/protobuf/any.proto"; message AnExampleMessage { repeated google.protobuf.Any whatever = 8; }
Internally a type identifier and a value
Type identifier is URI string
Value is byte buffer
Map Type.
message AnExampleMessage { map<int32, string> keywords = 8; }