requests.proto 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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/label.proto";
  19. import "google/apps/drive/labels/v2/label_permission.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 = "RequestsProto";
  23. option java_package = "com.google.apps.drive.labels.v2";
  24. option objc_class_prefix = "DLBL";
  25. // Resource view that can be applied to label responses. The default value
  26. // `LABEL_VIEW_BASIC` implies the field mask:
  27. // `name,id,revision_id,label_type,properties.*`\
  28. enum LabelView {
  29. // Implies the field mask:
  30. // `name,id,revision_id,label_type,properties.*`
  31. LABEL_VIEW_BASIC = 0;
  32. // All possible fields.
  33. LABEL_VIEW_FULL = 1;
  34. }
  35. // Request to get a label by resource name.
  36. message GetLabelRequest {
  37. // Required. Label resource name.
  38. //
  39. // May be any of:
  40. //
  41. // * `labels/{id}` (equivalent to labels/{id}@latest)
  42. // * `labels/{id}@latest`
  43. // * `labels/{id}@published`
  44. // * `labels/{id}@{revision_id}`
  45. string name = 1 [
  46. (google.api.field_behavior) = REQUIRED,
  47. (google.api.resource_reference) = {
  48. type: "drivelabels.googleapis.com/Label"
  49. }
  50. ];
  51. // Set to `true` in order to use the user's admin credentials. The server
  52. // verifies that the user is an admin for the label before allowing access.
  53. bool use_admin_access = 2;
  54. // The BCP-47 language code to use for evaluating localized field labels.
  55. // When not specified, values in the default configured language are used.
  56. string language_code = 3;
  57. // When specified, only certain fields belonging to the indicated view are
  58. // returned.
  59. LabelView view = 4;
  60. }
  61. // Request to list labels available to the current user.
  62. message ListLabelsRequest {
  63. oneof access {
  64. // Set to `true` in order to use the user's admin credentials. This will
  65. // return all Labels within the customer.
  66. bool use_admin_access = 3;
  67. // Specifies the level of access the user must have on the returned Labels.
  68. // The minimum role a user must have on a label.
  69. // Defaults to `READER`.
  70. LabelPermission.LabelRole minimum_role = 4;
  71. }
  72. // Whether to include only published labels in the results.
  73. //
  74. // * When `true`, only the current published label revisions are returned.
  75. // Disabled labels are included. Returned label resource names
  76. // reference the published revision (`labels/{id}/{revision_id}`).
  77. // * When `false`, the current label revisions are returned, which might not
  78. // be published. Returned label resource names don't reference a specific
  79. // revision (`labels/{id}`).
  80. bool published_only = 1;
  81. // The BCP-47 language code to use for evaluating localized field labels.
  82. // When not specified, values in the default configured language are used.
  83. string language_code = 5;
  84. // Maximum number of labels to return per page. Default: 50. Max: 200.
  85. int32 page_size = 6;
  86. // The token of the page to return.
  87. string page_token = 7;
  88. // When specified, only certain fields belonging to the indicated view are
  89. // returned.
  90. LabelView view = 8;
  91. }
  92. // Response for listing Labels.
  93. message ListLabelsResponse {
  94. // Labels.
  95. repeated Label labels = 1;
  96. // The token of the next page in the response.
  97. string next_page_token = 2;
  98. }