This repository was archived by the owner on Apr 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.proto
112 lines (97 loc) · 2.3 KB
/
dashboard.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";
package otsimo;
import "datasetmodels.proto";
import weak "gogoproto/gogo.proto";
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.goproto_unrecognized_all) = false;
option (gogoproto.goproto_enum_prefix_all) = false;
option go_package = "otsimopb";
option java_package = "com.otsimo.grpc";
option java_multiple_files = true;
// DashboardService
service DashboardService {
rpc Get(DashboardGetRequest) returns (DashboardItems);
rpc GetStream(DashboardGetRequest) returns (stream Card);
}
message DashboardItems {
// ProfileId
string profile_id = 1;
// ChildId
string child_id = 2;
// Created At
int64 created_at = 3;
repeated Card items = 8;
}
message DashboardGetRequest {
string profile_id = 1;
string child_id = 2;
string app_version = 3;
string language = 4;
string country_code = 5;
int64 last_time_data_fetched = 6;
}
message CardDecoration {
enum Size {
// Small is 1x1 block on iphone
SMALL = 0;
// Medium is 2x1 block on iphone
MEDIUM = 1;
// Large is 2x2 block on iphone
LARGE = 2;
}
enum BackgroundStyle {
EMPTY = 0;
IMAGE = 1;
CHART_SILHOUETTE = 2;
}
Size size = 1;
BackgroundStyle background_style = 2;
string image_url = 3;
string left_icon = 4;
string right_icon = 5;
}
message CardEmpty {}
message CardWebpage { string url = 1; }
message CardApplink { string applink = 1; }
message CardAnalysis {
apipb.DataSet data = 1;
ChartType chart_type = 2;
}
message Card {
string id = 1;
string text = 2;
int64 expires_at = 3;
int64 created_at = 4;
CardDecoration decoration = 5;
// Score is between 0-500
int32 provider_score = 6;
// ProviderWeight is between 0-2
float provider_weight = 7;
string provider_name = 8;
string language = 9;
oneof data {
CardEmpty empty = 10;
CardWebpage webpage = 11;
CardApplink applink = 12;
CardAnalysis analysis = 13;
}
// Title for newer systems
string title = 14;
// Subtitle for newer systems
string subtitle = 15;
// Labels of the card
map<string, string> labels = 16;
}
enum ChartType {
LINE = 0;
BAR = 1;
PIE = 2;
SCATTER = 3;
BUBLE = 4;
RADAR = 5;
GEO = 6;
TIMELINE = 7;
}