xref: /aosp_15_r20/external/googleapis/google/apps/drive/labels/v2beta/field.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.apps.drive.labels.v2beta;
18
19import "google/api/field_behavior.proto";
20import "google/apps/drive/labels/v2beta/common.proto";
21import "google/protobuf/timestamp.proto";
22import "google/type/date.proto";
23
24option go_package = "google.golang.org/genproto/googleapis/apps/drive/labels/v2beta;labels";
25option java_multiple_files = true;
26option java_outer_classname = "FieldProto";
27option java_package = "com.google.apps.drive.labels.v2beta";
28option objc_class_prefix = "DLBL";
29
30// Defines a field that has a display name, data type, and other
31// configuration options. This field defines the kind of metadata that may be
32// set on a Drive item.
33message Field {
34  // The basic properties of the field.
35  message Properties {
36    // Required. The display text to show in the UI identifying this field.
37    string display_name = 1 [(google.api.field_behavior) = REQUIRED];
38
39    // Whether the field should be marked as required.
40    bool required = 2;
41
42    // Input only. Insert or move this field before the indicated field. If
43    // empty, the field is placed at the end of the list.
44    string insert_before_field = 3 [(google.api.field_behavior) = INPUT_ONLY];
45  }
46
47  // UI display hints for rendering a field.
48  message DisplayHints {
49    // Whether the field should be shown as required in the UI.
50    bool required = 1;
51
52    // Whether the field should be shown in the UI as disabled.
53    bool disabled = 2;
54
55    // This field should be hidden in the search menu when searching for Drive
56    // items.
57    bool hidden_in_search = 3;
58
59    // This field should be shown in the apply menu when applying values to a
60    // Drive item.
61    bool shown_in_apply = 4;
62  }
63
64  // The capabilities related to this field when editing the field.
65  message SchemaCapabilities {
66    // Whether the user can change this field.
67    bool can_update = 1;
68
69    // Whether the user can delete this field.
70    // The user must have permission and the field must be deprecated.
71    bool can_delete = 2;
72
73    // Whether the user can disable this field.
74    // The user must have permission and this field must not already be
75    // disabled.
76    bool can_disable = 3;
77
78    // Whether the user can enable this field.
79    // The user must have permission and this field must be disabled.
80    bool can_enable = 4;
81  }
82
83  // The capabilities related to this field on applied metadata.
84  message AppliedCapabilities {
85    // Whether the user can read related applied metadata on items.
86    bool can_read = 1;
87
88    // Whether the user can search for Drive items referencing this field.
89    bool can_search = 2;
90
91    // Whether the user can set this field on Drive items.
92    bool can_write = 3;
93  }
94
95  // Options for a multi-valued variant of an associated field type.
96  message ListOptions {
97    // Maximum number of entries permitted.
98    int32 max_entries = 1;
99  }
100
101  // Options for the Text field type.
102  message TextOptions {
103    // Output only. The minimum valid length of values for the text field.
104    int32 min_length = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
105
106    // Output only. The maximum valid length of values for the text field.
107    int32 max_length = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
108  }
109
110  // Options for the Integer field type.
111  message IntegerOptions {
112    // Output only. The minimum valid value for the integer field.
113    int64 min_value = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
114
115    // Output only. The maximum valid value for the integer field.
116    int64 max_value = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
117  }
118
119  // Options for the date field type.
120  message DateOptions {
121    // Localized date format options.
122    enum DateFormat {
123      // Date format unspecified.
124      DATE_FORMAT_UNSPECIFIED = 0;
125
126      // Includes full month name.
127      // For example, January 12, 1999
128      // (MMMM d, y)
129      LONG_DATE = 1;
130
131      // Short, numeric, representation.
132      // For example, 12/13/99
133      // (M/d/yy)
134      SHORT_DATE = 2;
135    }
136
137    // Localized date formatting option. Field values are rendered in
138    // this format according to their locale.
139    DateFormat date_format_type = 1;
140
141    // Output only. ICU date format.
142    string date_format = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
143
144    // Output only. Minimum valid value (year, month, day).
145    google.type.Date min_value = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
146
147    // Output only. Maximum valid value (year, month, day).
148    google.type.Date max_value = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
149  }
150
151  // Options for the selection field type.
152  message SelectionOptions {
153    // Selection field choice.
154    message Choice {
155      // Basic properties of the choice.
156      message Properties {
157        // Required. The display text to show in the UI identifying this field.
158        string display_name = 1 [(google.api.field_behavior) = REQUIRED];
159
160        // The description of this label.
161        string description = 2;
162
163        // The badge configuration for this choice. When set, the
164        // label that owns this choice is considered a "badged label".
165        BadgeConfig badge_config = 3;
166
167        // Input only. Insert or move this choice before the indicated choice.
168        // If empty, the choice is placed at the end of the list.
169        string insert_before_choice = 4
170            [(google.api.field_behavior) = INPUT_ONLY];
171      }
172
173      // UI display hints for rendering an option.
174      message DisplayHints {
175        // Whether the option should be shown in the UI as disabled.
176        bool disabled = 1;
177
178        // This option should be hidden in the search menu when searching for
179        // Drive items.
180        bool hidden_in_search = 2;
181
182        // This option should be shown in the apply menu when applying values to
183        // a Drive item.
184        bool shown_in_apply = 3;
185
186        // The colors to use for the badge. Changed to Google Material colors
187        // based on the chosen `properties.badge_config.color`.
188        BadgeColors badge_colors = 4;
189
190        // The dark-mode color to use for the badge. Changed to Google Material
191        // colors based on the chosen `properties.badge_config.color`.
192        BadgeColors dark_badge_colors = 5;
193
194        // The priority of this badge. Used to compare and sort between multiple
195        // badges. A lower number means the badge should be shown first.
196        // When a badging configuration is not present, this will be 0.
197        // Otherwise, this will be set to `BadgeConfig.priority_override` or the
198        // default heuristic which prefers creation date of the label, and field
199        // and option priority.
200        int64 badge_priority = 6;
201      }
202
203      // The capabilities related to this choice when editing the choice.
204      message SchemaCapabilities {
205        // Whether the user can update this choice.
206        bool can_update = 1;
207
208        // Whether the user can delete this choice.
209        bool can_delete = 2;
210
211        // Whether the user can disable this choice.
212        bool can_disable = 3;
213
214        // Whether the user can enable this choice.
215        bool can_enable = 4;
216      }
217
218      // The capabilities related to this choice on applied metadata.
219      message AppliedCapabilities {
220        // Whether the user can read related applied metadata on items.
221        bool can_read = 1;
222
223        // Whether the user can use this choice in search queries.
224        bool can_search = 2;
225
226        // Whether the user can select this choice on an item.
227        bool can_select = 3;
228      }
229
230      // The unique value of the choice.
231      // This ID is autogenerated. Matches the regex: `([a-zA-Z0-9_])+`.
232      string id = 1;
233
234      // Basic properties of the choice.
235      Properties properties = 2;
236
237      // Output only. Lifecycle of the choice.
238      Lifecycle lifecycle = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
239
240      // Output only. UI display hints for rendering a choice.
241      DisplayHints display_hints = 4
242          [(google.api.field_behavior) = OUTPUT_ONLY];
243
244      // Output only. The capabilities related to this option when editing the
245      // option.
246      SchemaCapabilities schema_capabilities = 5
247          [(google.api.field_behavior) = OUTPUT_ONLY];
248
249      // Output only. The capabilities related to this choice on applied
250      // metadata.
251      AppliedCapabilities applied_capabilities = 6
252          [(google.api.field_behavior) = OUTPUT_ONLY];
253
254      // Output only. The user who created this choice.
255      UserInfo creator = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
256
257      // Output only. The time this choice was created.
258      google.protobuf.Timestamp create_time = 8
259          [(google.api.field_behavior) = OUTPUT_ONLY];
260
261      // Output only. The user who updated this choice last.
262      UserInfo updater = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
263
264      // Output only. The time this choice was updated last.
265      google.protobuf.Timestamp update_time = 10
266          [(google.api.field_behavior) = OUTPUT_ONLY];
267
268      // Output only. The user who published this choice. This value has no
269      // meaning when the choice is not published.
270      UserInfo publisher = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
271
272      // Output only. The time this choice was published. This value has no
273      // meaning when the choice is not published.
274      google.protobuf.Timestamp publish_time = 12
275          [(google.api.field_behavior) = OUTPUT_ONLY];
276
277      // Output only. The user who disabled this choice. This value has no
278      // meaning when the option is not disabled.
279      UserInfo disabler = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
280
281      // Output only. The time this choice was disabled. This value has no
282      // meaning when the choice is not disabled.
283      google.protobuf.Timestamp disable_time = 14
284          [(google.api.field_behavior) = OUTPUT_ONLY];
285
286      // Output only. The LockStatus of this choice.
287      LockStatus lock_status = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
288    }
289
290    // When specified, indicates this field supports a list of values.
291    // Once the field is published, this cannot be changed.
292    ListOptions list_options = 1;
293
294    // The options available for this selection field.
295    // The list order is consistent, and modified with `insert_before_choice`.
296    repeated Choice choices = 2;
297  }
298
299  // Options for the user field type.
300  message UserOptions {
301    // When specified, indicates that this field supports a list of values.
302    // Once the field is published, this cannot be changed.
303    ListOptions list_options = 1;
304  }
305
306  // The data type and options of this field.
307  // Once published, the data type cannot be changed.
308  oneof type {
309    // Text field options.
310    TextOptions text_options = 16;
311
312    // Integer field options.
313    IntegerOptions integer_options = 18;
314
315    // Date field options.
316    DateOptions date_options = 19;
317
318    // Selection field options.
319    SelectionOptions selection_options = 20;
320
321    // User field options.
322    UserOptions user_options = 21;
323  }
324
325  // Output only. The key of a field, unique within a label or library.
326  //
327  // This value is autogenerated. Matches the regex: `([a-zA-Z0-9])+`
328  string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
329
330  // Output only. The key to use when constructing Drive search queries to find
331  // files based on values defined for this field on files.
332  // For example, "`{query_key}` > 2001-01-01".
333  string query_key = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
334
335  // The basic properties of the field.
336  Properties properties = 3;
337
338  // Output only. The lifecycle of this field.
339  Lifecycle lifecycle = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
340
341  // Output only. UI display hints for rendering a field.
342  DisplayHints display_hints = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
343
344  // Output only. The capabilities this user has when editing this field.
345  SchemaCapabilities schema_capabilities = 6
346      [(google.api.field_behavior) = OUTPUT_ONLY];
347
348  // Output only. The capabilities this user has on this field and its value
349  // when the label is applied on Drive items.
350  AppliedCapabilities applied_capabilities = 7
351      [(google.api.field_behavior) = OUTPUT_ONLY];
352
353  // Output only. The user who created this field.
354  UserInfo creator = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
355
356  // Output only. The time this field was created.
357  google.protobuf.Timestamp create_time = 9
358      [(google.api.field_behavior) = OUTPUT_ONLY];
359
360  // Output only. The user who modified this field.
361  UserInfo updater = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
362
363  // Output only. The time this field was updated.
364  google.protobuf.Timestamp update_time = 11
365      [(google.api.field_behavior) = OUTPUT_ONLY];
366
367  // Output only. The user who published this field. This value has no meaning
368  // when the field is not published.
369  UserInfo publisher = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
370
371  // Output only. The user who disabled this field. This value has no meaning
372  // when the field is not disabled.
373  UserInfo disabler = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
374
375  // Output only. The time this field was disabled. This value has no meaning
376  // when the field is not disabled.
377  google.protobuf.Timestamp disable_time = 14
378      [(google.api.field_behavior) = OUTPUT_ONLY];
379
380  // Output only. The LockStatus of this field.
381  LockStatus lock_status = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
382}
383