-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaces.proto
112 lines (88 loc) · 2.18 KB
/
places.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
syntax = "proto3";
import "./utils.proto";
enum PersonalPlaceLabel {
HOME = 1;
WORK = 2;
SCHOOL = 3;
}
// why?
message PersonalPlaceLabelValue {
PersonalPlaceLabel label = 1;
}
message PersonalPlace {
uint32 id = 1;
PersonalPlaceLabel label = 2;
bool isMain = 3;
double radius = 4;
double latitude = 5;
double longitude = 6;
Timestamp leftAt = 7;
uint32 daysSpent = 8;
uint32 nightsSpent = 9;
Timestamp enteredAt = 10;
// todo enum context_Visibility
uint32 visibility = 11;
}
message UnlabeledPlace {
message LabelsProbability {
uint32 home = 1;
uint32 work = 2;
uint32 school = 3;
}
uint32 id = 1;
Location location = 2;
uint32 daysSpent = 3;
uint32 nightsSpent = 4;
Timestamp lastVisitedAt = 5;
LabelsProbability inferredLabels = 6;
}
message PersonalPlaceRateLimitError {
// todo enum
uint32 code = 1;
uint32 remaining = 2;
}
message PersonalPlacesResponse {
repeated PersonalPlace places = 1;
}
message PersonalPlaceCreateRequest {
message FromNight {
Location location = 1;
PersonalPlaceLabel label = 2;
}
message FromUnlabeledPlace {
uint32 id = 1;
PersonalPlaceLabel label = 2;
}
FromNight fromNight = 1;
FromUnlabeledPlace fromUnlabeledPlace = 2;
}
message PersonalPlaceCreateError {
Error error = 1;
PersonalPlaceRateLimitError rateLimitError = 2;
}
message PersonalPlaceUpdateError {
Error error = 1;
PersonalPlaceRateLimitError rateLimitError = 2;
}
message PersonalPlaceCreateResponse {
PersonalPlaceCreateError error = 1;
}
message PersonalPlaceUpdateRequest {
// not sure about keys here
uint32 id = 1;
PersonalPlaceLabelValue label = 2;
// todo enum context_Visibility
EnumWrap visibility = 3;
Location location = 4;
BoolValue isMain = 5;
}
message PersonalPlaceUpdateResponse {
PersonalPlaceUpdateError error = 1;
}
message PersonalPlaceResetRateLimitRequest {
// todo enum place_PersonalPlaceResetRateLimitRequest_Operation
uint32 operation = 1;
}
message UnlabeledPlacesResponse {
repeated UnlabeledPlace places = 1;
}