value.proto 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. // Copyright 2019 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. //
  15. syntax = "proto3";
  16. package google.api.expr.v1beta1;
  17. import "google/protobuf/any.proto";
  18. import "google/protobuf/struct.proto";
  19. option cc_enable_arenas = true;
  20. option go_package = "google.golang.org/genproto/googleapis/api/expr/v1beta1;expr";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "ValueProto";
  23. option java_package = "com.google.api.expr.v1beta1";
  24. // Represents a CEL value.
  25. //
  26. // This is similar to `google.protobuf.Value`, but can represent CEL's full
  27. // range of values.
  28. message Value {
  29. // Required. The valid kinds of values.
  30. oneof kind {
  31. // Null value.
  32. google.protobuf.NullValue null_value = 1;
  33. // Boolean value.
  34. bool bool_value = 2;
  35. // Signed integer value.
  36. int64 int64_value = 3;
  37. // Unsigned integer value.
  38. uint64 uint64_value = 4;
  39. // Floating point value.
  40. double double_value = 5;
  41. // UTF-8 string value.
  42. string string_value = 6;
  43. // Byte string value.
  44. bytes bytes_value = 7;
  45. // An enum value.
  46. EnumValue enum_value = 9;
  47. // The proto message backing an object value.
  48. google.protobuf.Any object_value = 10;
  49. // Map value.
  50. MapValue map_value = 11;
  51. // List value.
  52. ListValue list_value = 12;
  53. // A Type value represented by the fully qualified name of the type.
  54. string type_value = 15;
  55. }
  56. }
  57. // An enum value.
  58. message EnumValue {
  59. // The fully qualified name of the enum type.
  60. string type = 1;
  61. // The value of the enum.
  62. int32 value = 2;
  63. }
  64. // A list.
  65. //
  66. // Wrapped in a message so 'not set' and empty can be differentiated, which is
  67. // required for use in a 'oneof'.
  68. message ListValue {
  69. // The ordered values in the list.
  70. repeated Value values = 1;
  71. }
  72. // A map.
  73. //
  74. // Wrapped in a message so 'not set' and empty can be differentiated, which is
  75. // required for use in a 'oneof'.
  76. message MapValue {
  77. // An entry in the map.
  78. message Entry {
  79. // The key.
  80. //
  81. // Must be unique with in the map.
  82. // Currently only boolean, int, uint, and string values can be keys.
  83. Value key = 1;
  84. // The value.
  85. Value value = 2;
  86. }
  87. // The set of map entries.
  88. //
  89. // CEL has fewer restrictions on keys, so a protobuf map represenation
  90. // cannot be used.
  91. repeated Entry entries = 1;
  92. }