xref: /aosp_15_r20/external/googleapis/google/apps/drive/labels/v2beta/label.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/api/resource.proto";
21import "google/apps/drive/labels/v2beta/common.proto";
22import "google/apps/drive/labels/v2beta/field.proto";
23import "google/protobuf/timestamp.proto";
24
25option go_package = "google.golang.org/genproto/googleapis/apps/drive/labels/v2beta;labels";
26option java_multiple_files = true;
27option java_outer_classname = "LabelProto";
28option java_package = "com.google.apps.drive.labels.v2beta";
29option objc_class_prefix = "DLBL";
30option (google.api.resource_definition) = {
31  type: "cloudidentity.googleapis.com/Customer"
32  pattern: "customers/{customer}"
33};
34
35// A label defines a taxonomy that can be applied to Drive items in order to
36// organize and search across items. Labels can be simple strings, or can
37// contain fields that describe additional metadata that can be further used to
38// organize and search Drive items.
39message Label {
40  option (google.api.resource) = {
41    type: "drivelabels.googleapis.com/Label"
42    pattern: "labels/{id}"
43  };
44
45  // Basic properties of the label.
46  message Properties {
47    // Required. Title of the label.
48    string title = 1 [(google.api.field_behavior) = REQUIRED];
49
50    // The description of the label.
51    string description = 2;
52  }
53
54  // UI display hints for rendering the label.
55  message DisplayHints {
56    // Whether the label should be shown in the UI as disabled.
57    bool disabled = 1;
58
59    // This label should be hidden in the search menu when searching for Drive
60    // items.
61    bool hidden_in_search = 2;
62
63    // This label should be shown in the apply menu when applying values to a
64    // Drive item.
65    bool shown_in_apply = 3;
66
67    // Order to display label in a list.
68    int64 priority = 4;
69  }
70
71  // The capabilities a user has on this label's applied metadata.
72  message AppliedCapabilities {
73    // Whether the user can read applied metadata related to this label.
74    bool can_read = 1;
75
76    // Whether the user can apply this label to items.
77    bool can_apply = 2;
78
79    // Whether the user can remove this label from items.
80    bool can_remove = 3;
81  }
82
83  // The capabilities related to this label when editing the label.
84  message SchemaCapabilities {
85    // Whether the user can change this label.
86    bool can_update = 1;
87
88    // Whether the user can delete this label.
89    // The user must have permission and the label must be disabled.
90    bool can_delete = 2;
91
92    // Whether the user can disable this label.
93    // The user must have permission and this label must not already be
94    // disabled.
95    bool can_disable = 3;
96
97    // Whether the user can enable this label.
98    // The user must have permission and this label must be disabled.
99    bool can_enable = 4;
100  }
101
102  // Behavior of this label when it's applied to Drive items.
103  message AppliedLabelPolicy {
104    // Indicates how the applied label and field values should be copied when
105    // a Drive item is copied.
106    enum CopyMode {
107      // Copy mode unspecified.
108      COPY_MODE_UNSPECIFIED = 0;
109
110      // The applied label and field values are not copied by default when
111      // the Drive item it's applied to is copied.
112      DO_NOT_COPY = 1;
113
114      // The applied label and field values are always copied when the
115      // Drive item it's applied to is copied.
116      // Only admins can use this mode.
117      ALWAYS_COPY = 2;
118
119      // The applied label and field values are copied if the
120      // label is appliable by the user making the copy.
121      COPY_APPLIABLE = 3;
122    }
123
124    // Indicates how the applied label and field values should be copied when
125    // a Drive item is copied.
126    CopyMode copy_mode = 1;
127  }
128
129  // The type of this label.
130  enum LabelType {
131    // Unknown label type.
132    LABEL_TYPE_UNSPECIFIED = 0;
133
134    // Shared labels may be shared with users to apply to Drive items.
135    SHARED = 1;
136
137    // Admin-owned label. Only creatable and editable by admins. Supports some
138    // additional admin-only features.
139    ADMIN = 2;
140
141    // A label owned by an internal Google application rather than a customer.
142    // These labels are read-only.
143    GOOGLE_APP = 3;
144  }
145
146  // Output only. Resource name of the label. Will be in the form of either:
147  // `labels/{id}` or `labels/{id}@{revision_id}` depending on the request.
148  // See `id` and `revision_id` below.
149  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
150
151  // Output only. Globally unique identifier of this label. ID makes up part of
152  // the label `name`, but unlike `name`, ID is consistent between revisions.
153  // Matches the regex: `([a-zA-Z0-9])+`
154  string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
155
156  // Output only. Revision ID of the label. Revision ID might be part of the
157  // label `name` depending on the request issued. A new revision is created
158  // whenever revisioned properties of a label are changed. Matches the regex:
159  // `([a-zA-Z0-9])+`
160  string revision_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
161
162  // Required. The type of label.
163  LabelType label_type = 4 [(google.api.field_behavior) = REQUIRED];
164
165  // Output only. The user who created this label.
166  UserInfo creator = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
167
168  // Output only. The time this label was created.
169  google.protobuf.Timestamp create_time = 6
170      [(google.api.field_behavior) = OUTPUT_ONLY];
171
172  // Output only. The user who created this label revision.
173  UserInfo revision_creator = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
174
175  // Output only. The time this label revision was created.
176  google.protobuf.Timestamp revision_create_time = 8
177      [(google.api.field_behavior) = OUTPUT_ONLY];
178
179  // Output only. The user who published this label.  This value has no meaning
180  // when the label is not published.
181  UserInfo publisher = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
182
183  // Output only. The time this label was published. This value has no meaning
184  // when the label is not published.
185  google.protobuf.Timestamp publish_time = 10
186      [(google.api.field_behavior) = OUTPUT_ONLY];
187
188  // Output only. The user who disabled this label. This value has no meaning
189  // when the label is not disabled.
190  UserInfo disabler = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
191
192  // Output only. The time this label was disabled. This value has no meaning
193  // when the label is not disabled.
194  google.protobuf.Timestamp disable_time = 12
195      [(google.api.field_behavior) = OUTPUT_ONLY];
196
197  // Output only. The customer this label belongs to.
198  // For example: "customers/123abc789."
199  string customer = 13 [
200    (google.api.field_behavior) = OUTPUT_ONLY,
201    (google.api.resource_reference) = {
202      type: "cloudidentity.googleapis.com/Customer"
203    }
204  ];
205
206  // Required. The basic properties of the label.
207  Properties properties = 14 [(google.api.field_behavior) = REQUIRED];
208
209  // Output only. The lifecycle state of the label including whether it's
210  // published, deprecated, and has draft changes.
211  Lifecycle lifecycle = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
212
213  // Output only. UI display hints for rendering the label.
214  DisplayHints display_hints = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
215
216  // Output only. The capabilities related to this label on applied metadata.
217  AppliedCapabilities applied_capabilities = 17
218      [(google.api.field_behavior) = OUTPUT_ONLY];
219
220  // Output only. The capabilities the user has on this label.
221  SchemaCapabilities schema_capabilities = 18
222      [(google.api.field_behavior) = OUTPUT_ONLY];
223
224  // Output only. Behavior of this label when it's applied to Drive items.
225  AppliedLabelPolicy applied_label_policy = 19
226      [(google.api.field_behavior) = OUTPUT_ONLY];
227
228  // List of fields in descending priority order.
229  repeated Field fields = 20;
230
231  // Custom URL to present to users to allow them to learn more about this label
232  // and how it should be used.
233  string learn_more_uri = 21;
234
235  // Output only. The LockStatus of this label.
236  LockStatus lock_status = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
237}
238