-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patheverything.proto
64 lines (52 loc) · 1.27 KB
/
everything.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
syntax = "proto3";
// Import Google's Well-Known Types
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/any.proto";
package example;
// Enum example
enum Status {
UNKNOWN = 0;
ACTIVE = 1;
INACTIVE = 2;
}
// Nested message example
message Address {
string street = 1;
string city = 2;
string state = 3;
string zip_code = 4;
}
// Main message example
message Person {
// Scalar types
string name = 1;
int32 age = 2;
bool is_verified = 3;
// Repeated field (array)
repeated string phone_numbers = 4;
// Map example
map<string, string> attributes = 5;
// Enum field
Status status = 6;
// Nested message
Address address = 7;
// Oneof example
oneof contact_method {
string email = 8;
string phone = 9;
}
// Google Well-Known Types
google.protobuf.Timestamp last_updated = 10;
google.protobuf.Duration session_duration = 11;
google.protobuf.Empty metadata = 12;
google.protobuf.Struct extra_data = 13;
google.protobuf.Any any_data = 14;
}
// Service example
service PersonService {
rpc GetPerson(google.protobuf.Empty) returns (Person);
rpc UpdatePerson(Person) returns (google.protobuf.Empty);
}