visibility.proto 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // Copyright 2021 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.api;
  16. import "google/protobuf/descriptor.proto";
  17. option cc_enable_arenas = true;
  18. option go_package = "google.golang.org/genproto/googleapis/api/visibility;visibility";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "VisibilityProto";
  21. option java_package = "com.google.api";
  22. option objc_class_prefix = "GAPI";
  23. extend google.protobuf.EnumOptions {
  24. // See `VisibilityRule`.
  25. google.api.VisibilityRule enum_visibility = 72295727;
  26. }
  27. extend google.protobuf.EnumValueOptions {
  28. // See `VisibilityRule`.
  29. google.api.VisibilityRule value_visibility = 72295727;
  30. }
  31. extend google.protobuf.FieldOptions {
  32. // See `VisibilityRule`.
  33. google.api.VisibilityRule field_visibility = 72295727;
  34. }
  35. extend google.protobuf.MessageOptions {
  36. // See `VisibilityRule`.
  37. google.api.VisibilityRule message_visibility = 72295727;
  38. }
  39. extend google.protobuf.MethodOptions {
  40. // See `VisibilityRule`.
  41. google.api.VisibilityRule method_visibility = 72295727;
  42. }
  43. extend google.protobuf.ServiceOptions {
  44. // See `VisibilityRule`.
  45. google.api.VisibilityRule api_visibility = 72295727;
  46. }
  47. // `Visibility` defines restrictions for the visibility of service
  48. // elements. Restrictions are specified using visibility labels
  49. // (e.g., PREVIEW) that are elsewhere linked to users and projects.
  50. //
  51. // Users and projects can have access to more than one visibility label. The
  52. // effective visibility for multiple labels is the union of each label's
  53. // elements, plus any unrestricted elements.
  54. //
  55. // If an element and its parents have no restrictions, visibility is
  56. // unconditionally granted.
  57. //
  58. // Example:
  59. //
  60. // visibility:
  61. // rules:
  62. // - selector: google.calendar.Calendar.EnhancedSearch
  63. // restriction: PREVIEW
  64. // - selector: google.calendar.Calendar.Delegate
  65. // restriction: INTERNAL
  66. //
  67. // Here, all methods are publicly visible except for the restricted methods
  68. // EnhancedSearch and Delegate.
  69. message Visibility {
  70. // A list of visibility rules that apply to individual API elements.
  71. //
  72. // **NOTE:** All service configuration rules follow "last one wins" order.
  73. repeated VisibilityRule rules = 1;
  74. }
  75. // A visibility rule provides visibility configuration for an individual API
  76. // element.
  77. message VisibilityRule {
  78. // Selects methods, messages, fields, enums, etc. to which this rule applies.
  79. //
  80. // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
  81. string selector = 1;
  82. // A comma-separated list of visibility labels that apply to the `selector`.
  83. // Any of the listed labels can be used to grant the visibility.
  84. //
  85. // If a rule has multiple labels, removing one of the labels but not all of
  86. // them can break clients.
  87. //
  88. // Example:
  89. //
  90. // visibility:
  91. // rules:
  92. // - selector: google.calendar.Calendar.EnhancedSearch
  93. // restriction: INTERNAL, PREVIEW
  94. //
  95. // Removing INTERNAL from this restriction will break clients that rely on
  96. // this method and only had access to it through INTERNAL.
  97. string restriction = 2;
  98. }