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