SEBA-349 GRPC
added xos proto files
Change-Id: I59feae392782331d11e1ac506c18f772ccfb8898
diff --git a/contrib/xos/modeldefs.proto b/contrib/xos/modeldefs.proto
new file mode 100644
index 0000000..1df3234
--- /dev/null
+++ b/contrib/xos/modeldefs.proto
@@ -0,0 +1,61 @@
+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"
+ };
+ }
+};