-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontract.proto
80 lines (60 loc) · 1.55 KB
/
contract.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
syntax = "proto3";
package google.protobuf;
import "google/protobuf/timestamp.proto";
option csharp_namespace = "Nephrolog.Protobuf";
service Api {
// https://cloud.google.com/apis/design/design_patterns#list_pagination
rpc ListDailyIntakes(DailyIntakesRequest) returns (ListDailyIntakesResponse);
rpc ProductsLookup(ProductsLookupRequest) returns (ListProductsLookupResponse);
}
message DailyIntakesRequest {
string parent = 1;
int32 page_size = 2;
string page_token = 3;
}
message Product {
int64 id = 1;
string name = 2;
enum Kind {
UNKNOWN = 0;
FOOD = 1;
DRINK = 2;
}
Kind kind = 3;
}
message Intake {
int64 id = 1;
google.protobuf.Timestamp date = 2;
Product product = 3;
int32 amount_g = 4;
float consumed_potassium_mg = 5;
float consumed_protein_g = 6;
float consumed_sodium_mg = 7;
float consumed_phosphorus_mg = 8;
float consumed_energy_kcal = 9;
float consumed_water_ml = 10;
}
message DailyIntakes {
google.protobuf.Timestamp date = 1;
float total_potassium_mg = 2;
float total_protein_g = 3;
float total_sodium_mg = 4;
float total_phosphorus_mg = 5;
float total_energy_kcal = 6;
float total_water_ml = 7;
repeated Intake intakes = 8;
}
message ListDailyIntakesResponse {
repeated DailyIntakes daily_intakes = 1;
string next_page_token = 2;
}
message ProductsLookupRequest {
string parent = 1;
int32 page_size = 2;
string page_token = 3;
string query = 4;
}
message ListProductsLookupResponse {
repeated Product products = 1;
string next_page_token = 2;
}