blob: 1df3234f4120a7b8d2322eabe5e0a7cfbfcdf0fa [file] [log] [blame]
syntax = "proto3";
package xos;
import "google/protobuf/empty.proto";
import "annotations.proto";
// This API is used by the UI to validate fields.
message FieldValidator {
string name = 1;
oneof val_value {
bool bool_value = 2;
int64 int_value = 3;
string str_value = 4;
};
};
message FieldOption {
string id = 1;
string label = 2;
}
message FieldRelation {
string model = 1;
string type = 2;
string on_field = 3;
};
message ModelField {
string name = 1;
string hint = 2;
string type = 3;
FieldRelation relation = 4;
repeated FieldValidator validators = 5;
repeated FieldOption options = 6;
string default = 7;
bool read_only = 8;
};
message ModelDef {
string name = 1;
repeated ModelField fields = 2;
repeated FieldRelation relations = 3;
string app = 4;
string verbose_name = 5;
string description = 6;
};
message ModelDefs {
repeated ModelDef items = 1;
};
service modeldefs {
rpc ListModelDefs(google.protobuf.Empty) returns (ModelDefs) {
option (googleapi.http) = {
get: "/xosapi/v1/modeldefs"
};
}
};