Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / api / expr / v1alpha1 / conformance_service.proto
1 // Copyright 2018 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
16 syntax = "proto3";
17
18 package google.api.expr.v1alpha1;
19
20 import "google/api/expr/v1alpha1/checked.proto";
21 import "google/api/expr/v1alpha1/eval.proto";
22 import "google/api/expr/v1alpha1/syntax.proto";
23 import "google/rpc/status.proto";
24
25 option cc_enable_arenas = true;
26 option go_package = "google.golang.org/genproto/googleapis/api/expr/v1alpha1;expr";
27 option java_multiple_files = true;
28 option java_outer_classname = "ConformanceServiceProto";
29 option java_package = "com.google.api.expr.v1alpha1";
30
31 // Access a CEL implementation from another process or machine.
32 // A CEL implementation is decomposed as a parser, a static checker,
33 // and an evaluator.  Every CEL implementation is expected to provide
34 // a server for this API.  The API will be used for conformance testing
35 // and other utilities.
36 service ConformanceService {
37   // Transforms CEL source text into a parsed representation.
38   rpc Parse(ParseRequest) returns (ParseResponse) {}
39
40   // Runs static checks on a parsed CEL representation and return
41   // an annotated representation, or a set of issues.
42   rpc Check(CheckRequest) returns (CheckResponse) {}
43
44   // Evaluates a parsed or annotation CEL representation given
45   // values of external bindings.
46   rpc Eval(EvalRequest) returns (EvalResponse) {}
47 }
48
49 // Request message for the Parse method.
50 message ParseRequest {
51   // Required. Source text in CEL syntax.
52   string cel_source = 1;
53
54   // Tag for version of CEL syntax, for future use.
55   string syntax_version = 2;
56
57   // File or resource for source text, used in
58   // [SourceInfo][google.api.expr.v1alpha1.SourceInfo].
59   string source_location = 3;
60
61   // Prevent macro expansion.  See "Macros" in Language Defiinition.
62   bool disable_macros = 4;
63 }
64
65 // Response message for the Parse method.
66 message ParseResponse {
67   // The parsed representation, or unset if parsing failed.
68   ParsedExpr parsed_expr = 1;
69
70   // Any number of issues with [StatusDetails][] as the details.
71   repeated google.rpc.Status issues = 2;
72 }
73
74 // Request message for the Check method.
75 message CheckRequest {
76   // Required. The parsed representation of the CEL program.
77   ParsedExpr parsed_expr = 1;
78
79   // Declarations of types for external variables and functions.
80   // Required if program uses external variables or functions
81   // not in the default environment.
82   repeated Decl type_env = 2;
83
84   // The protocol buffer context.  See "Name Resolution" in the
85   // Language Definition.
86   string container = 3;
87
88   // If true, use only the declarations in
89   // [type_env][google.api.expr.v1alpha1.CheckRequest.type_env].  If false
90   // (default), add declarations for the standard definitions to the type
91   // environment.  See "Standard Definitions" in the Language Definition.
92   bool no_std_env = 4;
93 }
94
95 // Response message for the Check method.
96 message CheckResponse {
97   // The annotated representation, or unset if checking failed.
98   CheckedExpr checked_expr = 1;
99
100   // Any number of issues with [StatusDetails][] as the details.
101   repeated google.rpc.Status issues = 2;
102 }
103
104 // Request message for the Eval method.
105 message EvalRequest {
106   // Required. Either the parsed or annotated representation of the CEL program.
107   oneof expr_kind {
108     // Evaluate based on the parsed representation.
109     ParsedExpr parsed_expr = 1;
110
111     // Evaluate based on the checked representation.
112     CheckedExpr checked_expr = 2;
113   }
114
115   // Bindings for the external variables.  The types SHOULD be compatible
116   // with the type environment in
117   // [CheckRequest][google.api.expr.v1alpha1.CheckRequest], if checked.
118   map<string, ExprValue> bindings = 3;
119
120   // SHOULD be the same container as used in
121   // [CheckRequest][google.api.expr.v1alpha1.CheckRequest], if checked.
122   string container = 4;
123 }
124
125 // Response message for the Eval method.
126 message EvalResponse {
127   // The execution result, or unset if execution couldn't start.
128   ExprValue result = 1;
129
130   // Any number of issues with [StatusDetails][] as the details.
131   // Note that CEL execution errors are reified into
132   // [ExprValue][google.api.expr.v1alpha1.ExprValue]. Nevertheless, we'll allow
133   // out-of-band issues to be raised, which also makes the replies more regular.
134   repeated google.rpc.Status issues = 2;
135 }
136
137 // Warnings or errors in service execution are represented by
138 // [google.rpc.Status][google.rpc.Status] messages, with the following message
139 // in the details field.
140 message IssueDetails {
141   // Severities of issues.
142   enum Severity {
143     // An unspecified severity.
144     SEVERITY_UNSPECIFIED = 0;
145
146     // Deprecation issue for statements and method that may no longer be
147     // supported or maintained.
148     DEPRECATION = 1;
149
150     // Warnings such as: unused variables.
151     WARNING = 2;
152
153     // Errors such as: unmatched curly braces or variable redefinition.
154     ERROR = 3;
155   }
156
157   // The severity of the issue.
158   Severity severity = 1;
159
160   // Position in the source, if known.
161   SourcePosition position = 2;
162
163   // Expression ID from [Expr][google.api.expr.v1alpha1.Expr], 0 if unknown.
164   int64 id = 3;
165 }