expr.proto 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.type;
  16. option go_package = "google.golang.org/genproto/googleapis/type/expr;expr";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "ExprProto";
  19. option java_package = "com.google.type";
  20. option objc_class_prefix = "GTP";
  21. // Represents a textual expression in the Common Expression Language (CEL)
  22. // syntax. CEL is a C-like expression language. The syntax and semantics of CEL
  23. // are documented at https://github.com/google/cel-spec.
  24. //
  25. // Example (Comparison):
  26. //
  27. // title: "Summary size limit"
  28. // description: "Determines if a summary is less than 100 chars"
  29. // expression: "document.summary.size() < 100"
  30. //
  31. // Example (Equality):
  32. //
  33. // title: "Requestor is owner"
  34. // description: "Determines if requestor is the document owner"
  35. // expression: "document.owner == request.auth.claims.email"
  36. //
  37. // Example (Logic):
  38. //
  39. // title: "Public documents"
  40. // description: "Determine whether the document should be publicly visible"
  41. // expression: "document.type != 'private' && document.type != 'internal'"
  42. //
  43. // Example (Data Manipulation):
  44. //
  45. // title: "Notification string"
  46. // description: "Create a notification string with a timestamp."
  47. // expression: "'New message received at ' + string(document.create_time)"
  48. //
  49. // The exact variables and functions that may be referenced within an expression
  50. // are determined by the service that evaluates it. See the service
  51. // documentation for additional information.
  52. message Expr {
  53. // Textual representation of an expression in Common Expression Language
  54. // syntax.
  55. string expression = 1;
  56. // Optional. Title for the expression, i.e. a short string describing
  57. // its purpose. This can be used e.g. in UIs which allow to enter the
  58. // expression.
  59. string title = 2;
  60. // Optional. Description of the expression. This is a longer text which
  61. // describes the expression, e.g. when hovered over it in a UI.
  62. string description = 3;
  63. // Optional. String indicating the location of the expression for error
  64. // reporting, e.g. a file name and a position in the file.
  65. string location = 4;
  66. }