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