@@ -122,24 +122,42 @@ message Consistency {
122
122
// RelationshipFilter is a collection of filters which when applied to a
123
123
// relationship will return relationships that have exactly matching fields.
124
124
//
125
- // resource_type is required. All other fields are optional and if left
126
- // unspecified will not filter relationships.
125
+ // All fields are optional and if left unspecified will not filter relationships,
126
+ // but at least one field must be specified.
127
+ //
128
+ // NOTE: The performance of the API will be affected by the selection of fields
129
+ // on which to filter. If a field is not indexed, the performance of the API
130
+ // can be significantly slower.
127
131
message RelationshipFilter {
132
+ // resource_type is the *optional* resource type of the relationship.
133
+ // NOTE: It is not prefixed with "optional_" for legacy compatibility.
128
134
string resource_type = 1 [ (validate.rules ).string = {
129
135
pattern : "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$" ,
130
136
max_bytes : 128 ,
131
137
} ];
132
138
139
+ // optional_resource_id is the *optional* resource ID of the relationship.
140
+ // If specified, optional_resource_id_prefix cannot be specified.
133
141
string optional_resource_id = 2 [ (validate.rules ).string = {
134
142
pattern : "^([a-zA-Z0-9/_|\\-=+]{1,})?$" ,
135
143
max_bytes : 1024 ,
136
144
} ];
137
145
146
+ // optional_resource_id_prefix is the *optional* prefix for the resource ID of the relationship.
147
+ // If specified, optional_resource_id cannot be specified.
148
+ string optional_resource_id_prefix = 5 [ (validate.rules ).string = {
149
+ pattern : "^([a-zA-Z0-9/_|\\-=+]{1,})?$" ,
150
+ max_bytes : 1024 ,
151
+ } ];
152
+
153
+
154
+ // relation is the *optional* relation of the relationship.
138
155
string optional_relation = 3 [ (validate.rules ).string = {
139
156
pattern : "^([a-z][a-z0-9_]{1,62}[a-z0-9])?$" ,
140
157
max_bytes : 64 ,
141
158
} ];
142
159
160
+ // optional_subject_filter is the optional filter for the subjects of the relationships.
143
161
SubjectFilter optional_subject_filter = 4 ;
144
162
}
145
163
0 commit comments