field.proto 14 KB

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