label.proto 8.1 KB

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