// @generated /// An expression together with source information as returned by the parser. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ParsedExpr { /// The parsed expression. #[prost(message, optional, tag = "2")] pub expr: ::core::option::Option, /// The source info derived from input that generated the parsed `expr`. #[prost(message, optional, tag = "3")] pub source_info: ::core::option::Option, } /// An abstract representation of a common expression. /// /// Expressions are abstractly represented as a collection of identifiers, /// select statements, function calls, literals, and comprehensions. All /// operators with the exception of the '.' operator are modelled as function /// calls. This makes it easy to represent new operators into the existing AST. /// /// All references within expressions must resolve to a \[Decl][google.api.expr.v1alpha1.Decl\] provided at /// type-check for an expression to be valid. A reference may either be a bare /// identifier `name` or a qualified identifier `google.api.name`. References /// may either refer to a value or a function declaration. /// /// For example, the expression `google.api.name.startsWith('expr')` references /// the declaration `google.api.name` within a \[Expr.Select][google.api.expr.v1alpha1.Expr.Select\] expression, and /// the function declaration `startsWith`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Expr { /// Required. An id assigned to this node by the parser which is unique in a /// given expression tree. This is used to associate type information and other /// attributes to a node in the parse tree. #[prost(int64, tag = "2")] pub id: i64, /// Required. Variants of expressions. #[prost(oneof = "expr::ExprKind", tags = "3, 4, 5, 6, 7, 8, 9")] pub expr_kind: ::core::option::Option, } /// Nested message and enum types in `Expr`. pub mod expr { /// An identifier expression. e.g. `request`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Ident { /// Required. Holds a single, unqualified identifier, possibly preceded by a /// '.'. /// /// Qualified names are represented by the \[Expr.Select][google.api.expr.v1alpha1.Expr.Select\] expression. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, } /// A field selection expression. e.g. `request.auth`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Select { /// Required. The target of the selection expression. /// /// For example, in the select expression `request.auth`, the `request` /// portion of the expression is the `operand`. #[prost(message, optional, boxed, tag = "1")] pub operand: ::core::option::Option<::prost::alloc::boxed::Box>, /// Required. The name of the field to select. /// /// For example, in the select expression `request.auth`, the `auth` portion /// of the expression would be the `field`. #[prost(string, tag = "2")] pub field: ::prost::alloc::string::String, /// Whether the select is to be interpreted as a field presence test. /// /// This results from the macro `has(request.auth)`. #[prost(bool, tag = "3")] pub test_only: bool, } /// A call expression, including calls to predefined functions and operators. /// /// For example, `value == 10`, `size(map_value)`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Call { /// The target of an method call-style expression. For example, `x` in /// `x.f()`. #[prost(message, optional, boxed, tag = "1")] pub target: ::core::option::Option<::prost::alloc::boxed::Box>, /// Required. The name of the function or method being called. #[prost(string, tag = "2")] pub function: ::prost::alloc::string::String, /// The arguments. #[prost(message, repeated, tag = "3")] pub args: ::prost::alloc::vec::Vec, } /// A list creation expression. /// /// Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogeneous, e.g. /// `dyn([1, 'hello', 2.0])` #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateList { /// The elements part of the list. #[prost(message, repeated, tag = "1")] pub elements: ::prost::alloc::vec::Vec, /// The indices within the elements list which are marked as optional /// elements. /// /// When an optional-typed value is present, the value it contains /// is included in the list. If the optional-typed value is absent, the list /// element is omitted from the CreateList result. #[prost(int32, repeated, tag = "2")] pub optional_indices: ::prost::alloc::vec::Vec, } /// A map or message creation expression. /// /// Maps are constructed as `{'key_name': 'value'}`. Message construction is /// similar, but prefixed with a type name and composed of field ids: /// `types.MyType{field_id: 'value'}`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreateStruct { /// The type name of the message to be created, empty when creating map /// literals. #[prost(string, tag = "1")] pub message_name: ::prost::alloc::string::String, /// The entries in the creation expression. #[prost(message, repeated, tag = "2")] pub entries: ::prost::alloc::vec::Vec, } /// Nested message and enum types in `CreateStruct`. pub mod create_struct { /// Represents an entry. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Entry { /// Required. An id assigned to this node by the parser which is unique /// in a given expression tree. This is used to associate type /// information and other attributes to the node. #[prost(int64, tag = "1")] pub id: i64, /// Required. The value assigned to the key. /// /// If the optional_entry field is true, the expression must resolve to an /// optional-typed value. If the optional value is present, the key will be /// set; however, if the optional value is absent, the key will be unset. #[prost(message, optional, tag = "4")] pub value: ::core::option::Option, /// Whether the key-value pair is optional. #[prost(bool, tag = "5")] pub optional_entry: bool, /// The `Entry` key kinds. #[prost(oneof = "entry::KeyKind", tags = "2, 3")] pub key_kind: ::core::option::Option, } /// Nested message and enum types in `Entry`. pub mod entry { /// The `Entry` key kinds. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum KeyKind { /// The field key for a message creator statement. #[prost(string, tag = "2")] FieldKey(::prost::alloc::string::String), /// The key expression for a map creation statement. #[prost(message, tag = "3")] MapKey(super::super::super::Expr), } } } /// A comprehension expression applied to a list or map. /// /// Comprehensions are not part of the core syntax, but enabled with macros. /// A macro matches a specific call signature within a parsed AST and replaces /// the call with an alternate AST block. Macro expansion happens at parse /// time. /// /// The following macros are supported within CEL: /// /// Aggregate type macros may be applied to all elements in a list or all keys /// in a map: /// /// * `all`, `exists`, `exists_one` - test a predicate expression against /// the inputs and return `true` if the predicate is satisfied for all, /// any, or only one value `list.all(x, x < 10)`. /// * `filter` - test a predicate expression against the inputs and return /// the subset of elements which satisfy the predicate: /// `payments.filter(p, p > 1000)`. /// * `map` - apply an expression to all elements in the input and return the /// output aggregate type: `[1, 2, 3].map(i, i * i)`. /// /// The `has(m.x)` macro tests whether the property `x` is present in struct /// `m`. The semantics of this macro depend on the type of `m`. For proto2 /// messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the /// macro tests whether the property is set to its default. For map and struct /// types, the macro tests whether the property `x` is defined on `m`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Comprehension { /// The name of the iteration variable. #[prost(string, tag = "1")] pub iter_var: ::prost::alloc::string::String, /// The range over which var iterates. #[prost(message, optional, boxed, tag = "2")] pub iter_range: ::core::option::Option<::prost::alloc::boxed::Box>, /// The name of the variable used for accumulation of the result. #[prost(string, tag = "3")] pub accu_var: ::prost::alloc::string::String, /// The initial value of the accumulator. #[prost(message, optional, boxed, tag = "4")] pub accu_init: ::core::option::Option<::prost::alloc::boxed::Box>, /// An expression which can contain iter_var and accu_var. /// /// Returns false when the result has been computed and may be used as /// a hint to short-circuit the remainder of the comprehension. #[prost(message, optional, boxed, tag = "5")] pub loop_condition: ::core::option::Option< ::prost::alloc::boxed::Box, >, /// An expression which can contain iter_var and accu_var. /// /// Computes the next value of accu_var. #[prost(message, optional, boxed, tag = "6")] pub loop_step: ::core::option::Option<::prost::alloc::boxed::Box>, /// An expression which can contain accu_var. /// /// Computes the result. #[prost(message, optional, boxed, tag = "7")] pub result: ::core::option::Option<::prost::alloc::boxed::Box>, } /// Required. Variants of expressions. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum ExprKind { /// A literal expression. #[prost(message, tag = "3")] ConstExpr(super::Constant), /// An identifier expression. #[prost(message, tag = "4")] IdentExpr(Ident), /// A field selection expression, e.g. `request.auth`. #[prost(message, tag = "5")] SelectExpr(::prost::alloc::boxed::Box