field.proto 14 KB

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