forked from infobloxopen/protoc-gen-atlas-query-validate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.proto
74 lines (61 loc) · 2.73 KB
/
example.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
syntax = "proto3";
package example;
import "google/protobuf/wrappers.proto";
import "github.com/infobloxopen/protoc-gen-atlas-query-validate/options/query_validate.proto";
import "github.com/infobloxopen/atlas-app-toolkit/query/collection_operators.proto";
option go_package = "github.com/infobloxopen/protoc-gen-atlas-query-validate/example;example";
message User {
option (atlas.query.message) = {
// enable_nested_fields: true;
validate: {name: "custom_search", value: {value_type_url: ".example.Address", nested_fields: ["country"]}};
validate: {name: "custom_search_2", value: {value_type: STRING, filtering: {allow: MATCH, allow: EQ}}};
validate: {name: "list_of_addresses", value: {value_type_url: ".example.Address", enable_nested_fields: true, field_selection: {disable: false}}};
validate: {name: "user_friend", value: {value_type_url: ".example.User", enable_nested_fields: true}};
};
string first_name = 1 [(atlas.query.validate).filtering = {allow: MATCH, allow: EQ}];
float weight = 2 [(atlas.query.validate).filtering.deny = LE];
bool on_vacation = 3 [(atlas.query.validate).sorting.disable = true];
string speciality = 4 [(atlas.query.validate) = {filtering: {allow: MATCH}, sorting: {disable: true}}];
string comment = 5 [(atlas.query.validate).filtering.deny = IN];
google.protobuf.StringValue last_name = 6;
string id = 7 [(atlas.query.validate).filtering.deny = ALL];
repeated string array = 8;
CustomType custom_type = 9 [(atlas.query.validate) = {enable_nested_fields: true}];
CustomType custom_type_string = 10 [(atlas.query.validate) = {value_type: STRING}];
Address home_address = 11 [(atlas.query.validate) = {enable_nested_fields: true}];
Address work_address = 12;
string company = 13 [(atlas.query.validate).filtering.deny = IEQ];
string nationality = 14 [(atlas.query.validate).filtering.deny = IN];
bool boolean_field = 15;
}
message CustomType {
CustomType recur = 1;
string name = 2;
}
message Address {
string city = 1 [(atlas.query.validate) = {filtering: {allow: EQ}, sorting: {disable: true}}];
string country = 2;
}
message ListRequest {
infoblox.api.Filtering filter = 1;
infoblox.api.Sorting order_by = 2;
infoblox.api.FieldSelection fields = 3;
infoblox.api.Pagination paging = 4;
}
message ReadRequest {
infoblox.api.Sorting order_by = 1;
infoblox.api.FieldSelection fields = 2;
infoblox.api.Pagination paging = 3;
}
message ListUserResponse {
repeated User results = 1;
}
message ReadUserResponse {
User result = 1;
}
service TestService {
rpc List (ListRequest) returns (ListUserResponse) {
}
rpc Read (ReadRequest) returns (ReadUserResponse) {
}
}