common.proto 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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/type/color.proto";
  19. option go_package = "google.golang.org/genproto/googleapis/apps/drive/labels/v2;labels";
  20. option java_multiple_files = true;
  21. option java_outer_classname = "CommonProto";
  22. option java_package = "com.google.apps.drive.labels.v2";
  23. option objc_class_prefix = "DLBL";
  24. option (google.api.resource_definition) = {
  25. type: "people.googleapis.com/Person"
  26. pattern: "persons/{person}"
  27. };
  28. // The lifecycle state of an object, such as label, field, or choice. The
  29. // lifecycle enforces the following transitions:
  30. //
  31. // * `UNPUBLISHED_DRAFT` (starting state)
  32. // * `UNPUBLISHED_DRAFT` -> `PUBLISHED`
  33. // * `UNPUBLISHED_DRAFT` -> (Deleted)
  34. // * `PUBLISHED` -> `DISABLED`
  35. // * `DISABLED` -> `PUBLISHED`
  36. // * `DISABLED` -> (Deleted)
  37. //
  38. // The published and disabled states have some distinct characteristics:
  39. //
  40. // * Published—Some kinds of changes might be made to an object in this state,
  41. // in which case `has_unpublished_changes` will be true. Also, some kinds of
  42. // changes are not permitted. Generally, any change that would invalidate or
  43. // cause new restrictions on existing metadata related to the label are
  44. // rejected.
  45. // * Disabled—When disabled, the configured `DisabledPolicy` takes effect.
  46. message Lifecycle {
  47. // The policy that governs how to treat a disabled label, field, or selection
  48. // choice in different contexts.
  49. message DisabledPolicy {
  50. // Whether to hide this disabled object in the search menu for Drive items.
  51. //
  52. // * When `false`, the object is generally shown in the UI as disabled but
  53. // it appears in the search results when searching for Drive items.
  54. // * When `true`, the object is generally hidden in the UI when
  55. // searching for Drive items.
  56. bool hide_in_search = 1;
  57. // Whether to show this disabled object in the apply menu on Drive items.
  58. //
  59. // * When `true`, the object is generally shown in the UI as disabled
  60. // and is unselectable.
  61. // * When `false`, the object is generally hidden in the UI.
  62. bool show_in_apply = 2;
  63. }
  64. // The state of the object associated with this lifecycle.
  65. enum State {
  66. // Unknown State.
  67. STATE_UNSPECIFIED = 0;
  68. // The initial state of an object. Once published, the object can never
  69. // return to this state. Once an object is published, certain kinds of
  70. // changes are no longer permitted.
  71. UNPUBLISHED_DRAFT = 1;
  72. // The object has been published. The object might have unpublished draft
  73. // changes as indicated by `has_unpublished_changes`.
  74. PUBLISHED = 2;
  75. // The object has been published and has since been disabled. The object
  76. // might have unpublished draft changes as indicated by
  77. // `has_unpublished_changes`.
  78. DISABLED = 3;
  79. // The object has been deleted.
  80. DELETED = 4;
  81. }
  82. // Output only. The state of the object associated with this lifecycle.
  83. State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  84. // Output only. Whether the object associated with this lifecycle has
  85. // unpublished changes.
  86. bool has_unpublished_changes = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  87. // The policy that governs how to show a disabled label, field, or selection
  88. // choice.
  89. DisabledPolicy disabled_policy = 3;
  90. }
  91. // Information about a user.
  92. message UserInfo {
  93. // The identifier for this user that can be used with the People API to get
  94. // more information.
  95. // For example, people/12345678.
  96. string person = 1 [
  97. (google.api.resource_reference) = { type: "people.googleapis.com/Person" }
  98. ];
  99. }
  100. // Badge status of the label.
  101. message BadgeConfig {
  102. // The color of the badge. When not specified, no badge is rendered.
  103. // The background, foreground, and solo (light and dark mode) colors set here
  104. // are changed in the Drive UI into the closest recommended supported color.
  105. google.type.Color color = 1;
  106. // Override the default global priority of this badge.
  107. // When set to 0, the default priority heuristic is used.
  108. int64 priority_override = 2;
  109. }
  110. // The color derived from BadgeConfig and changed to the closest recommended
  111. // supported color.
  112. message BadgeColors {
  113. // Output only. Badge background that pairs with the foreground.
  114. google.type.Color background_color = 1
  115. [(google.api.field_behavior) = OUTPUT_ONLY];
  116. // Output only. Badge foreground that pairs with the background.
  117. google.type.Color foreground_color = 2
  118. [(google.api.field_behavior) = OUTPUT_ONLY];
  119. // Output only. Color that can be used for text without a background.
  120. google.type.Color solo_color = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  121. }
  122. // Contains information about whether a label component should be considered
  123. // locked.
  124. message LockStatus {
  125. // Output only. Indicates whether this label component is the (direct) target
  126. // of a LabelLock. A label component can be implicitly locked even if it's
  127. // not the direct target of a LabelLock, in which case this field is set to
  128. // false.
  129. bool locked = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  130. }