defmodule Google.Api.Expr.V1alpha1.SourceInfo.Extension.Component do @moduledoc """ CEL component specifier. """ use Protobuf, enum: true, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :COMPONENT_UNSPECIFIED, 0 field :COMPONENT_PARSER, 1 field :COMPONENT_TYPE_CHECKER, 2 field :COMPONENT_RUNTIME, 3 end defmodule Google.Api.Expr.V1alpha1.ParsedExpr do @moduledoc """ An expression together with source information as returned by the parser. A representation of the abstract syntax of the Common Expression Language. """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :expr, 2, type: Google.Api.Expr.V1alpha1.Expr field :source_info, 3, type: Google.Api.Expr.V1alpha1.SourceInfo, json_name: "sourceInfo" end defmodule Google.Api.Expr.V1alpha1.Expr.Ident do @moduledoc """ An identifier expression. e.g. `request`. """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :name, 1, type: :string end defmodule Google.Api.Expr.V1alpha1.Expr.Select do @moduledoc """ A field selection expression. e.g. `request.auth`. """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :operand, 1, type: Google.Api.Expr.V1alpha1.Expr field :field, 2, type: :string field :test_only, 3, type: :bool, json_name: "testOnly" end defmodule Google.Api.Expr.V1alpha1.Expr.Call do @moduledoc """ A call expression, including calls to predefined functions and operators. For example, `value == 10`, `size(map_value)`. """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :target, 1, type: Google.Api.Expr.V1alpha1.Expr field :function, 2, type: :string field :args, 3, repeated: true, type: Google.Api.Expr.V1alpha1.Expr end defmodule Google.Api.Expr.V1alpha1.Expr.CreateList do @moduledoc """ A list creation expression. Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogeneous, e.g. `dyn([1, 'hello', 2.0])` """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :elements, 1, repeated: true, type: Google.Api.Expr.V1alpha1.Expr field :optional_indices, 2, repeated: true, type: :int32, json_name: "optionalIndices" end defmodule Google.Api.Expr.V1alpha1.Expr.CreateStruct.Entry do @moduledoc """ Represents an entry. """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 oneof :key_kind, 0 field :id, 1, type: :int64 field :field_key, 2, type: :string, json_name: "fieldKey", oneof: 0 field :map_key, 3, type: Google.Api.Expr.V1alpha1.Expr, json_name: "mapKey", oneof: 0 field :value, 4, type: Google.Api.Expr.V1alpha1.Expr field :optional_entry, 5, type: :bool, json_name: "optionalEntry" end defmodule Google.Api.Expr.V1alpha1.Expr.CreateStruct do @moduledoc """ 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'}`. """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :message_name, 1, type: :string, json_name: "messageName" field :entries, 2, repeated: true, type: Google.Api.Expr.V1alpha1.Expr.CreateStruct.Entry end defmodule Google.Api.Expr.V1alpha1.Expr.Comprehension do @moduledoc """ 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`. Comprehensions for the standard environment macros evaluation can be best visualized as the following pseudocode: ``` let `accu_var` = `accu_init` for (let `iter_var` in `iter_range`) { if (!`loop_condition`) { break } `accu_var` = `loop_step` } return `result` ``` Comprehensions for the optional V2 macros which support map-to-map translation differ slightly from the standard environment macros in that they expose both the key or index in addition to the value for each list or map entry: ``` let `accu_var` = `accu_init` for (let `iter_var`, `iter_var2` in `iter_range`) { if (!`loop_condition`) { break } `accu_var` = `loop_step` } return `result` ``` """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :iter_var, 1, type: :string, json_name: "iterVar" field :iter_var2, 8, type: :string, json_name: "iterVar2" field :iter_range, 2, type: Google.Api.Expr.V1alpha1.Expr, json_name: "iterRange" field :accu_var, 3, type: :string, json_name: "accuVar" field :accu_init, 4, type: Google.Api.Expr.V1alpha1.Expr, json_name: "accuInit" field :loop_condition, 5, type: Google.Api.Expr.V1alpha1.Expr, json_name: "loopCondition" field :loop_step, 6, type: Google.Api.Expr.V1alpha1.Expr, json_name: "loopStep" field :result, 7, type: Google.Api.Expr.V1alpha1.Expr end defmodule Google.Api.Expr.V1alpha1.Expr do @moduledoc """ 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`. """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 oneof :expr_kind, 0 field :id, 2, type: :int64 field :const_expr, 3, type: Google.Api.Expr.V1alpha1.Constant, json_name: "constExpr", oneof: 0 field :ident_expr, 4, type: Google.Api.Expr.V1alpha1.Expr.Ident, json_name: "identExpr", oneof: 0 field :select_expr, 5, type: Google.Api.Expr.V1alpha1.Expr.Select, json_name: "selectExpr", oneof: 0 field :call_expr, 6, type: Google.Api.Expr.V1alpha1.Expr.Call, json_name: "callExpr", oneof: 0 field :list_expr, 7, type: Google.Api.Expr.V1alpha1.Expr.CreateList, json_name: "listExpr", oneof: 0 field :struct_expr, 8, type: Google.Api.Expr.V1alpha1.Expr.CreateStruct, json_name: "structExpr", oneof: 0 field :comprehension_expr, 9, type: Google.Api.Expr.V1alpha1.Expr.Comprehension, json_name: "comprehensionExpr", oneof: 0 end defmodule Google.Api.Expr.V1alpha1.Constant do @moduledoc """ Represents a primitive literal. Named 'Constant' here for backwards compatibility. This is similar as the primitives supported in the well-known type `google.protobuf.Value`, but richer so it can represent CEL's full range of primitives. Lists and structs are not included as constants as these aggregate types may contain [Expr][google.api.expr.v1alpha1.Expr] elements which require evaluation and are thus not constant. Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`, `true`, `null`. """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 oneof :constant_kind, 0 field :null_value, 1, type: Google.Protobuf.NullValue, json_name: "nullValue", enum: true, oneof: 0 field :bool_value, 2, type: :bool, json_name: "boolValue", oneof: 0 field :int64_value, 3, type: :int64, json_name: "int64Value", oneof: 0 field :uint64_value, 4, type: :uint64, json_name: "uint64Value", oneof: 0 field :double_value, 5, type: :double, json_name: "doubleValue", oneof: 0 field :string_value, 6, type: :string, json_name: "stringValue", oneof: 0 field :bytes_value, 7, type: :bytes, json_name: "bytesValue", oneof: 0 field :duration_value, 8, type: Google.Protobuf.Duration, json_name: "durationValue", oneof: 0, deprecated: true field :timestamp_value, 9, type: Google.Protobuf.Timestamp, json_name: "timestampValue", oneof: 0, deprecated: true end defmodule Google.Api.Expr.V1alpha1.SourceInfo.Extension.Version do @moduledoc """ Version """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :major, 1, type: :int64 field :minor, 2, type: :int64 end defmodule Google.Api.Expr.V1alpha1.SourceInfo.Extension do @moduledoc """ An extension that was requested for the source expression. """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :id, 1, type: :string field :affected_components, 2, repeated: true, type: Google.Api.Expr.V1alpha1.SourceInfo.Extension.Component, json_name: "affectedComponents", enum: true field :version, 3, type: Google.Api.Expr.V1alpha1.SourceInfo.Extension.Version end defmodule Google.Api.Expr.V1alpha1.SourceInfo.PositionsEntry do use Protobuf, map: true, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :key, 1, type: :int64 field :value, 2, type: :int32 end defmodule Google.Api.Expr.V1alpha1.SourceInfo.MacroCallsEntry do use Protobuf, map: true, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :key, 1, type: :int64 field :value, 2, type: Google.Api.Expr.V1alpha1.Expr end defmodule Google.Api.Expr.V1alpha1.SourceInfo do @moduledoc """ Source information collected at parse time. """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :syntax_version, 1, type: :string, json_name: "syntaxVersion" field :location, 2, type: :string field :line_offsets, 3, repeated: true, type: :int32, json_name: "lineOffsets" field :positions, 4, repeated: true, type: Google.Api.Expr.V1alpha1.SourceInfo.PositionsEntry, map: true field :macro_calls, 5, repeated: true, type: Google.Api.Expr.V1alpha1.SourceInfo.MacroCallsEntry, json_name: "macroCalls", map: true field :extensions, 6, repeated: true, type: Google.Api.Expr.V1alpha1.SourceInfo.Extension end defmodule Google.Api.Expr.V1alpha1.SourcePosition do @moduledoc """ A specific position in source. """ use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :location, 1, type: :string field :offset, 2, type: :int32 field :line, 3, type: :int32 field :column, 4, type: :int32 end