blob: 1df3234f4120a7b8d2322eabe5e0a7cfbfcdf0fa [file] [log] [blame]
Don Newton276cd1f2019-02-06 17:14:03 -05001syntax = "proto3";
2
3package xos;
4
5import "google/protobuf/empty.proto";
6import "annotations.proto";
7
8// This API is used by the UI to validate fields.
9
10message FieldValidator {
11 string name = 1;
12 oneof val_value {
13 bool bool_value = 2;
14 int64 int_value = 3;
15 string str_value = 4;
16 };
17};
18
19message FieldOption {
20 string id = 1;
21 string label = 2;
22}
23
24message FieldRelation {
25 string model = 1;
26 string type = 2;
27 string on_field = 3;
28};
29
30message ModelField {
31 string name = 1;
32 string hint = 2;
33 string type = 3;
34 FieldRelation relation = 4;
35 repeated FieldValidator validators = 5;
36 repeated FieldOption options = 6;
37 string default = 7;
38 bool read_only = 8;
39};
40
41message ModelDef {
42 string name = 1;
43 repeated ModelField fields = 2;
44 repeated FieldRelation relations = 3;
45 string app = 4;
46 string verbose_name = 5;
47 string description = 6;
48};
49
50message ModelDefs {
51 repeated ModelDef items = 1;
52};
53
54service modeldefs {
55
56 rpc ListModelDefs(google.protobuf.Empty) returns (ModelDefs) {
57 option (googleapi.http) = {
58 get: "/xosapi/v1/modeldefs"
59 };
60 }
61};