You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1352 lines
45 KiB

  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/api/expr/v1beta1/expr.proto
  3. package expr // import "google.golang.org/genproto/googleapis/api/expr/v1beta1"
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import _struct "github.com/golang/protobuf/ptypes/struct"
  8. // Reference imports to suppress errors if they are not otherwise used.
  9. var _ = proto.Marshal
  10. var _ = fmt.Errorf
  11. var _ = math.Inf
  12. // This is a compile-time assertion to ensure that this generated file
  13. // is compatible with the proto package it is being compiled against.
  14. // A compilation error at this line likely means your copy of the
  15. // proto package needs to be updated.
  16. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  17. // An expression together with source information as returned by the parser.
  18. type ParsedExpr struct {
  19. // The parsed expression.
  20. Expr *Expr `protobuf:"bytes,2,opt,name=expr,proto3" json:"expr,omitempty"`
  21. // The source info derived from input that generated the parsed `expr`.
  22. SourceInfo *SourceInfo `protobuf:"bytes,3,opt,name=source_info,json=sourceInfo,proto3" json:"source_info,omitempty"`
  23. // The syntax version of the source, e.g. `cel1`.
  24. SyntaxVersion string `protobuf:"bytes,4,opt,name=syntax_version,json=syntaxVersion,proto3" json:"syntax_version,omitempty"`
  25. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  26. XXX_unrecognized []byte `json:"-"`
  27. XXX_sizecache int32 `json:"-"`
  28. }
  29. func (m *ParsedExpr) Reset() { *m = ParsedExpr{} }
  30. func (m *ParsedExpr) String() string { return proto.CompactTextString(m) }
  31. func (*ParsedExpr) ProtoMessage() {}
  32. func (*ParsedExpr) Descriptor() ([]byte, []int) {
  33. return fileDescriptor_expr_18d50d0297e9a0ab, []int{0}
  34. }
  35. func (m *ParsedExpr) XXX_Unmarshal(b []byte) error {
  36. return xxx_messageInfo_ParsedExpr.Unmarshal(m, b)
  37. }
  38. func (m *ParsedExpr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  39. return xxx_messageInfo_ParsedExpr.Marshal(b, m, deterministic)
  40. }
  41. func (dst *ParsedExpr) XXX_Merge(src proto.Message) {
  42. xxx_messageInfo_ParsedExpr.Merge(dst, src)
  43. }
  44. func (m *ParsedExpr) XXX_Size() int {
  45. return xxx_messageInfo_ParsedExpr.Size(m)
  46. }
  47. func (m *ParsedExpr) XXX_DiscardUnknown() {
  48. xxx_messageInfo_ParsedExpr.DiscardUnknown(m)
  49. }
  50. var xxx_messageInfo_ParsedExpr proto.InternalMessageInfo
  51. func (m *ParsedExpr) GetExpr() *Expr {
  52. if m != nil {
  53. return m.Expr
  54. }
  55. return nil
  56. }
  57. func (m *ParsedExpr) GetSourceInfo() *SourceInfo {
  58. if m != nil {
  59. return m.SourceInfo
  60. }
  61. return nil
  62. }
  63. func (m *ParsedExpr) GetSyntaxVersion() string {
  64. if m != nil {
  65. return m.SyntaxVersion
  66. }
  67. return ""
  68. }
  69. // An abstract representation of a common expression.
  70. //
  71. // Expressions are abstractly represented as a collection of identifiers,
  72. // select statements, function calls, literals, and comprehensions. All
  73. // operators with the exception of the '.' operator are modelled as function
  74. // calls. This makes it easy to represent new operators into the existing AST.
  75. //
  76. // All references within expressions must resolve to a
  77. // [Decl][google.api.expr.v1beta1.Decl] provided at type-check for an expression
  78. // to be valid. A reference may either be a bare identifier `name` or a
  79. // qualified identifier `google.api.name`. References may either refer to a
  80. // value or a function declaration.
  81. //
  82. // For example, the expression `google.api.name.startsWith('expr')` references
  83. // the declaration `google.api.name` within a
  84. // [Expr.Select][google.api.expr.v1beta1.Expr.Select] expression, and the
  85. // function declaration `startsWith`.
  86. type Expr struct {
  87. // Required. An id assigned to this node by the parser which is unique in a
  88. // given expression tree. This is used to associate type information and other
  89. // attributes to a node in the parse tree.
  90. Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
  91. // Required. Variants of expressions.
  92. //
  93. // Types that are valid to be assigned to ExprKind:
  94. // *Expr_LiteralExpr
  95. // *Expr_IdentExpr
  96. // *Expr_SelectExpr
  97. // *Expr_CallExpr
  98. // *Expr_ListExpr
  99. // *Expr_StructExpr
  100. // *Expr_ComprehensionExpr
  101. ExprKind isExpr_ExprKind `protobuf_oneof:"expr_kind"`
  102. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  103. XXX_unrecognized []byte `json:"-"`
  104. XXX_sizecache int32 `json:"-"`
  105. }
  106. func (m *Expr) Reset() { *m = Expr{} }
  107. func (m *Expr) String() string { return proto.CompactTextString(m) }
  108. func (*Expr) ProtoMessage() {}
  109. func (*Expr) Descriptor() ([]byte, []int) {
  110. return fileDescriptor_expr_18d50d0297e9a0ab, []int{1}
  111. }
  112. func (m *Expr) XXX_Unmarshal(b []byte) error {
  113. return xxx_messageInfo_Expr.Unmarshal(m, b)
  114. }
  115. func (m *Expr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  116. return xxx_messageInfo_Expr.Marshal(b, m, deterministic)
  117. }
  118. func (dst *Expr) XXX_Merge(src proto.Message) {
  119. xxx_messageInfo_Expr.Merge(dst, src)
  120. }
  121. func (m *Expr) XXX_Size() int {
  122. return xxx_messageInfo_Expr.Size(m)
  123. }
  124. func (m *Expr) XXX_DiscardUnknown() {
  125. xxx_messageInfo_Expr.DiscardUnknown(m)
  126. }
  127. var xxx_messageInfo_Expr proto.InternalMessageInfo
  128. func (m *Expr) GetId() int32 {
  129. if m != nil {
  130. return m.Id
  131. }
  132. return 0
  133. }
  134. type isExpr_ExprKind interface {
  135. isExpr_ExprKind()
  136. }
  137. type Expr_LiteralExpr struct {
  138. LiteralExpr *Literal `protobuf:"bytes,3,opt,name=literal_expr,json=literalExpr,proto3,oneof"`
  139. }
  140. type Expr_IdentExpr struct {
  141. IdentExpr *Expr_Ident `protobuf:"bytes,4,opt,name=ident_expr,json=identExpr,proto3,oneof"`
  142. }
  143. type Expr_SelectExpr struct {
  144. SelectExpr *Expr_Select `protobuf:"bytes,5,opt,name=select_expr,json=selectExpr,proto3,oneof"`
  145. }
  146. type Expr_CallExpr struct {
  147. CallExpr *Expr_Call `protobuf:"bytes,6,opt,name=call_expr,json=callExpr,proto3,oneof"`
  148. }
  149. type Expr_ListExpr struct {
  150. ListExpr *Expr_CreateList `protobuf:"bytes,7,opt,name=list_expr,json=listExpr,proto3,oneof"`
  151. }
  152. type Expr_StructExpr struct {
  153. StructExpr *Expr_CreateStruct `protobuf:"bytes,8,opt,name=struct_expr,json=structExpr,proto3,oneof"`
  154. }
  155. type Expr_ComprehensionExpr struct {
  156. ComprehensionExpr *Expr_Comprehension `protobuf:"bytes,9,opt,name=comprehension_expr,json=comprehensionExpr,proto3,oneof"`
  157. }
  158. func (*Expr_LiteralExpr) isExpr_ExprKind() {}
  159. func (*Expr_IdentExpr) isExpr_ExprKind() {}
  160. func (*Expr_SelectExpr) isExpr_ExprKind() {}
  161. func (*Expr_CallExpr) isExpr_ExprKind() {}
  162. func (*Expr_ListExpr) isExpr_ExprKind() {}
  163. func (*Expr_StructExpr) isExpr_ExprKind() {}
  164. func (*Expr_ComprehensionExpr) isExpr_ExprKind() {}
  165. func (m *Expr) GetExprKind() isExpr_ExprKind {
  166. if m != nil {
  167. return m.ExprKind
  168. }
  169. return nil
  170. }
  171. func (m *Expr) GetLiteralExpr() *Literal {
  172. if x, ok := m.GetExprKind().(*Expr_LiteralExpr); ok {
  173. return x.LiteralExpr
  174. }
  175. return nil
  176. }
  177. func (m *Expr) GetIdentExpr() *Expr_Ident {
  178. if x, ok := m.GetExprKind().(*Expr_IdentExpr); ok {
  179. return x.IdentExpr
  180. }
  181. return nil
  182. }
  183. func (m *Expr) GetSelectExpr() *Expr_Select {
  184. if x, ok := m.GetExprKind().(*Expr_SelectExpr); ok {
  185. return x.SelectExpr
  186. }
  187. return nil
  188. }
  189. func (m *Expr) GetCallExpr() *Expr_Call {
  190. if x, ok := m.GetExprKind().(*Expr_CallExpr); ok {
  191. return x.CallExpr
  192. }
  193. return nil
  194. }
  195. func (m *Expr) GetListExpr() *Expr_CreateList {
  196. if x, ok := m.GetExprKind().(*Expr_ListExpr); ok {
  197. return x.ListExpr
  198. }
  199. return nil
  200. }
  201. func (m *Expr) GetStructExpr() *Expr_CreateStruct {
  202. if x, ok := m.GetExprKind().(*Expr_StructExpr); ok {
  203. return x.StructExpr
  204. }
  205. return nil
  206. }
  207. func (m *Expr) GetComprehensionExpr() *Expr_Comprehension {
  208. if x, ok := m.GetExprKind().(*Expr_ComprehensionExpr); ok {
  209. return x.ComprehensionExpr
  210. }
  211. return nil
  212. }
  213. // XXX_OneofFuncs is for the internal use of the proto package.
  214. func (*Expr) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
  215. return _Expr_OneofMarshaler, _Expr_OneofUnmarshaler, _Expr_OneofSizer, []interface{}{
  216. (*Expr_LiteralExpr)(nil),
  217. (*Expr_IdentExpr)(nil),
  218. (*Expr_SelectExpr)(nil),
  219. (*Expr_CallExpr)(nil),
  220. (*Expr_ListExpr)(nil),
  221. (*Expr_StructExpr)(nil),
  222. (*Expr_ComprehensionExpr)(nil),
  223. }
  224. }
  225. func _Expr_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  226. m := msg.(*Expr)
  227. // expr_kind
  228. switch x := m.ExprKind.(type) {
  229. case *Expr_LiteralExpr:
  230. b.EncodeVarint(3<<3 | proto.WireBytes)
  231. if err := b.EncodeMessage(x.LiteralExpr); err != nil {
  232. return err
  233. }
  234. case *Expr_IdentExpr:
  235. b.EncodeVarint(4<<3 | proto.WireBytes)
  236. if err := b.EncodeMessage(x.IdentExpr); err != nil {
  237. return err
  238. }
  239. case *Expr_SelectExpr:
  240. b.EncodeVarint(5<<3 | proto.WireBytes)
  241. if err := b.EncodeMessage(x.SelectExpr); err != nil {
  242. return err
  243. }
  244. case *Expr_CallExpr:
  245. b.EncodeVarint(6<<3 | proto.WireBytes)
  246. if err := b.EncodeMessage(x.CallExpr); err != nil {
  247. return err
  248. }
  249. case *Expr_ListExpr:
  250. b.EncodeVarint(7<<3 | proto.WireBytes)
  251. if err := b.EncodeMessage(x.ListExpr); err != nil {
  252. return err
  253. }
  254. case *Expr_StructExpr:
  255. b.EncodeVarint(8<<3 | proto.WireBytes)
  256. if err := b.EncodeMessage(x.StructExpr); err != nil {
  257. return err
  258. }
  259. case *Expr_ComprehensionExpr:
  260. b.EncodeVarint(9<<3 | proto.WireBytes)
  261. if err := b.EncodeMessage(x.ComprehensionExpr); err != nil {
  262. return err
  263. }
  264. case nil:
  265. default:
  266. return fmt.Errorf("Expr.ExprKind has unexpected type %T", x)
  267. }
  268. return nil
  269. }
  270. func _Expr_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  271. m := msg.(*Expr)
  272. switch tag {
  273. case 3: // expr_kind.literal_expr
  274. if wire != proto.WireBytes {
  275. return true, proto.ErrInternalBadWireType
  276. }
  277. msg := new(Literal)
  278. err := b.DecodeMessage(msg)
  279. m.ExprKind = &Expr_LiteralExpr{msg}
  280. return true, err
  281. case 4: // expr_kind.ident_expr
  282. if wire != proto.WireBytes {
  283. return true, proto.ErrInternalBadWireType
  284. }
  285. msg := new(Expr_Ident)
  286. err := b.DecodeMessage(msg)
  287. m.ExprKind = &Expr_IdentExpr{msg}
  288. return true, err
  289. case 5: // expr_kind.select_expr
  290. if wire != proto.WireBytes {
  291. return true, proto.ErrInternalBadWireType
  292. }
  293. msg := new(Expr_Select)
  294. err := b.DecodeMessage(msg)
  295. m.ExprKind = &Expr_SelectExpr{msg}
  296. return true, err
  297. case 6: // expr_kind.call_expr
  298. if wire != proto.WireBytes {
  299. return true, proto.ErrInternalBadWireType
  300. }
  301. msg := new(Expr_Call)
  302. err := b.DecodeMessage(msg)
  303. m.ExprKind = &Expr_CallExpr{msg}
  304. return true, err
  305. case 7: // expr_kind.list_expr
  306. if wire != proto.WireBytes {
  307. return true, proto.ErrInternalBadWireType
  308. }
  309. msg := new(Expr_CreateList)
  310. err := b.DecodeMessage(msg)
  311. m.ExprKind = &Expr_ListExpr{msg}
  312. return true, err
  313. case 8: // expr_kind.struct_expr
  314. if wire != proto.WireBytes {
  315. return true, proto.ErrInternalBadWireType
  316. }
  317. msg := new(Expr_CreateStruct)
  318. err := b.DecodeMessage(msg)
  319. m.ExprKind = &Expr_StructExpr{msg}
  320. return true, err
  321. case 9: // expr_kind.comprehension_expr
  322. if wire != proto.WireBytes {
  323. return true, proto.ErrInternalBadWireType
  324. }
  325. msg := new(Expr_Comprehension)
  326. err := b.DecodeMessage(msg)
  327. m.ExprKind = &Expr_ComprehensionExpr{msg}
  328. return true, err
  329. default:
  330. return false, nil
  331. }
  332. }
  333. func _Expr_OneofSizer(msg proto.Message) (n int) {
  334. m := msg.(*Expr)
  335. // expr_kind
  336. switch x := m.ExprKind.(type) {
  337. case *Expr_LiteralExpr:
  338. s := proto.Size(x.LiteralExpr)
  339. n += 1 // tag and wire
  340. n += proto.SizeVarint(uint64(s))
  341. n += s
  342. case *Expr_IdentExpr:
  343. s := proto.Size(x.IdentExpr)
  344. n += 1 // tag and wire
  345. n += proto.SizeVarint(uint64(s))
  346. n += s
  347. case *Expr_SelectExpr:
  348. s := proto.Size(x.SelectExpr)
  349. n += 1 // tag and wire
  350. n += proto.SizeVarint(uint64(s))
  351. n += s
  352. case *Expr_CallExpr:
  353. s := proto.Size(x.CallExpr)
  354. n += 1 // tag and wire
  355. n += proto.SizeVarint(uint64(s))
  356. n += s
  357. case *Expr_ListExpr:
  358. s := proto.Size(x.ListExpr)
  359. n += 1 // tag and wire
  360. n += proto.SizeVarint(uint64(s))
  361. n += s
  362. case *Expr_StructExpr:
  363. s := proto.Size(x.StructExpr)
  364. n += 1 // tag and wire
  365. n += proto.SizeVarint(uint64(s))
  366. n += s
  367. case *Expr_ComprehensionExpr:
  368. s := proto.Size(x.ComprehensionExpr)
  369. n += 1 // tag and wire
  370. n += proto.SizeVarint(uint64(s))
  371. n += s
  372. case nil:
  373. default:
  374. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  375. }
  376. return n
  377. }
  378. // An identifier expression. e.g. `request`.
  379. type Expr_Ident struct {
  380. // Required. Holds a single, unqualified identifier, possibly preceded by a
  381. // '.'.
  382. //
  383. // Qualified names are represented by the
  384. // [Expr.Select][google.api.expr.v1beta1.Expr.Select] expression.
  385. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  386. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  387. XXX_unrecognized []byte `json:"-"`
  388. XXX_sizecache int32 `json:"-"`
  389. }
  390. func (m *Expr_Ident) Reset() { *m = Expr_Ident{} }
  391. func (m *Expr_Ident) String() string { return proto.CompactTextString(m) }
  392. func (*Expr_Ident) ProtoMessage() {}
  393. func (*Expr_Ident) Descriptor() ([]byte, []int) {
  394. return fileDescriptor_expr_18d50d0297e9a0ab, []int{1, 0}
  395. }
  396. func (m *Expr_Ident) XXX_Unmarshal(b []byte) error {
  397. return xxx_messageInfo_Expr_Ident.Unmarshal(m, b)
  398. }
  399. func (m *Expr_Ident) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  400. return xxx_messageInfo_Expr_Ident.Marshal(b, m, deterministic)
  401. }
  402. func (dst *Expr_Ident) XXX_Merge(src proto.Message) {
  403. xxx_messageInfo_Expr_Ident.Merge(dst, src)
  404. }
  405. func (m *Expr_Ident) XXX_Size() int {
  406. return xxx_messageInfo_Expr_Ident.Size(m)
  407. }
  408. func (m *Expr_Ident) XXX_DiscardUnknown() {
  409. xxx_messageInfo_Expr_Ident.DiscardUnknown(m)
  410. }
  411. var xxx_messageInfo_Expr_Ident proto.InternalMessageInfo
  412. func (m *Expr_Ident) GetName() string {
  413. if m != nil {
  414. return m.Name
  415. }
  416. return ""
  417. }
  418. // A field selection expression. e.g. `request.auth`.
  419. type Expr_Select struct {
  420. // Required. The target of the selection expression.
  421. //
  422. // For example, in the select expression `request.auth`, the `request`
  423. // portion of the expression is the `operand`.
  424. Operand *Expr `protobuf:"bytes,1,opt,name=operand,proto3" json:"operand,omitempty"`
  425. // Required. The name of the field to select.
  426. //
  427. // For example, in the select expression `request.auth`, the `auth` portion
  428. // of the expression would be the `field`.
  429. Field string `protobuf:"bytes,2,opt,name=field,proto3" json:"field,omitempty"`
  430. // Whether the select is to be interpreted as a field presence test.
  431. //
  432. // This results from the macro `has(request.auth)`.
  433. TestOnly bool `protobuf:"varint,3,opt,name=test_only,json=testOnly,proto3" json:"test_only,omitempty"`
  434. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  435. XXX_unrecognized []byte `json:"-"`
  436. XXX_sizecache int32 `json:"-"`
  437. }
  438. func (m *Expr_Select) Reset() { *m = Expr_Select{} }
  439. func (m *Expr_Select) String() string { return proto.CompactTextString(m) }
  440. func (*Expr_Select) ProtoMessage() {}
  441. func (*Expr_Select) Descriptor() ([]byte, []int) {
  442. return fileDescriptor_expr_18d50d0297e9a0ab, []int{1, 1}
  443. }
  444. func (m *Expr_Select) XXX_Unmarshal(b []byte) error {
  445. return xxx_messageInfo_Expr_Select.Unmarshal(m, b)
  446. }
  447. func (m *Expr_Select) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  448. return xxx_messageInfo_Expr_Select.Marshal(b, m, deterministic)
  449. }
  450. func (dst *Expr_Select) XXX_Merge(src proto.Message) {
  451. xxx_messageInfo_Expr_Select.Merge(dst, src)
  452. }
  453. func (m *Expr_Select) XXX_Size() int {
  454. return xxx_messageInfo_Expr_Select.Size(m)
  455. }
  456. func (m *Expr_Select) XXX_DiscardUnknown() {
  457. xxx_messageInfo_Expr_Select.DiscardUnknown(m)
  458. }
  459. var xxx_messageInfo_Expr_Select proto.InternalMessageInfo
  460. func (m *Expr_Select) GetOperand() *Expr {
  461. if m != nil {
  462. return m.Operand
  463. }
  464. return nil
  465. }
  466. func (m *Expr_Select) GetField() string {
  467. if m != nil {
  468. return m.Field
  469. }
  470. return ""
  471. }
  472. func (m *Expr_Select) GetTestOnly() bool {
  473. if m != nil {
  474. return m.TestOnly
  475. }
  476. return false
  477. }
  478. // A call expression, including calls to predefined functions and operators.
  479. //
  480. // For example, `value == 10`, `size(map_value)`.
  481. type Expr_Call struct {
  482. // The target of an method call-style expression. For example, `x` in
  483. // `x.f()`.
  484. Target *Expr `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
  485. // Required. The name of the function or method being called.
  486. Function string `protobuf:"bytes,2,opt,name=function,proto3" json:"function,omitempty"`
  487. // The arguments.
  488. Args []*Expr `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"`
  489. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  490. XXX_unrecognized []byte `json:"-"`
  491. XXX_sizecache int32 `json:"-"`
  492. }
  493. func (m *Expr_Call) Reset() { *m = Expr_Call{} }
  494. func (m *Expr_Call) String() string { return proto.CompactTextString(m) }
  495. func (*Expr_Call) ProtoMessage() {}
  496. func (*Expr_Call) Descriptor() ([]byte, []int) {
  497. return fileDescriptor_expr_18d50d0297e9a0ab, []int{1, 2}
  498. }
  499. func (m *Expr_Call) XXX_Unmarshal(b []byte) error {
  500. return xxx_messageInfo_Expr_Call.Unmarshal(m, b)
  501. }
  502. func (m *Expr_Call) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  503. return xxx_messageInfo_Expr_Call.Marshal(b, m, deterministic)
  504. }
  505. func (dst *Expr_Call) XXX_Merge(src proto.Message) {
  506. xxx_messageInfo_Expr_Call.Merge(dst, src)
  507. }
  508. func (m *Expr_Call) XXX_Size() int {
  509. return xxx_messageInfo_Expr_Call.Size(m)
  510. }
  511. func (m *Expr_Call) XXX_DiscardUnknown() {
  512. xxx_messageInfo_Expr_Call.DiscardUnknown(m)
  513. }
  514. var xxx_messageInfo_Expr_Call proto.InternalMessageInfo
  515. func (m *Expr_Call) GetTarget() *Expr {
  516. if m != nil {
  517. return m.Target
  518. }
  519. return nil
  520. }
  521. func (m *Expr_Call) GetFunction() string {
  522. if m != nil {
  523. return m.Function
  524. }
  525. return ""
  526. }
  527. func (m *Expr_Call) GetArgs() []*Expr {
  528. if m != nil {
  529. return m.Args
  530. }
  531. return nil
  532. }
  533. // A list creation expression.
  534. //
  535. // Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogenous, e.g.
  536. // `dyn([1, 'hello', 2.0])`
  537. type Expr_CreateList struct {
  538. // The elements part of the list.
  539. Elements []*Expr `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"`
  540. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  541. XXX_unrecognized []byte `json:"-"`
  542. XXX_sizecache int32 `json:"-"`
  543. }
  544. func (m *Expr_CreateList) Reset() { *m = Expr_CreateList{} }
  545. func (m *Expr_CreateList) String() string { return proto.CompactTextString(m) }
  546. func (*Expr_CreateList) ProtoMessage() {}
  547. func (*Expr_CreateList) Descriptor() ([]byte, []int) {
  548. return fileDescriptor_expr_18d50d0297e9a0ab, []int{1, 3}
  549. }
  550. func (m *Expr_CreateList) XXX_Unmarshal(b []byte) error {
  551. return xxx_messageInfo_Expr_CreateList.Unmarshal(m, b)
  552. }
  553. func (m *Expr_CreateList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  554. return xxx_messageInfo_Expr_CreateList.Marshal(b, m, deterministic)
  555. }
  556. func (dst *Expr_CreateList) XXX_Merge(src proto.Message) {
  557. xxx_messageInfo_Expr_CreateList.Merge(dst, src)
  558. }
  559. func (m *Expr_CreateList) XXX_Size() int {
  560. return xxx_messageInfo_Expr_CreateList.Size(m)
  561. }
  562. func (m *Expr_CreateList) XXX_DiscardUnknown() {
  563. xxx_messageInfo_Expr_CreateList.DiscardUnknown(m)
  564. }
  565. var xxx_messageInfo_Expr_CreateList proto.InternalMessageInfo
  566. func (m *Expr_CreateList) GetElements() []*Expr {
  567. if m != nil {
  568. return m.Elements
  569. }
  570. return nil
  571. }
  572. // A map or message creation expression.
  573. //
  574. // Maps are constructed as `{'key_name': 'value'}`. Message construction is
  575. // similar, but prefixed with a type name and composed of field ids:
  576. // `types.MyType{field_id: 'value'}`.
  577. type Expr_CreateStruct struct {
  578. // The type name of the message to be created, empty when creating map
  579. // literals.
  580. Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
  581. // The entries in the creation expression.
  582. Entries []*Expr_CreateStruct_Entry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"`
  583. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  584. XXX_unrecognized []byte `json:"-"`
  585. XXX_sizecache int32 `json:"-"`
  586. }
  587. func (m *Expr_CreateStruct) Reset() { *m = Expr_CreateStruct{} }
  588. func (m *Expr_CreateStruct) String() string { return proto.CompactTextString(m) }
  589. func (*Expr_CreateStruct) ProtoMessage() {}
  590. func (*Expr_CreateStruct) Descriptor() ([]byte, []int) {
  591. return fileDescriptor_expr_18d50d0297e9a0ab, []int{1, 4}
  592. }
  593. func (m *Expr_CreateStruct) XXX_Unmarshal(b []byte) error {
  594. return xxx_messageInfo_Expr_CreateStruct.Unmarshal(m, b)
  595. }
  596. func (m *Expr_CreateStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  597. return xxx_messageInfo_Expr_CreateStruct.Marshal(b, m, deterministic)
  598. }
  599. func (dst *Expr_CreateStruct) XXX_Merge(src proto.Message) {
  600. xxx_messageInfo_Expr_CreateStruct.Merge(dst, src)
  601. }
  602. func (m *Expr_CreateStruct) XXX_Size() int {
  603. return xxx_messageInfo_Expr_CreateStruct.Size(m)
  604. }
  605. func (m *Expr_CreateStruct) XXX_DiscardUnknown() {
  606. xxx_messageInfo_Expr_CreateStruct.DiscardUnknown(m)
  607. }
  608. var xxx_messageInfo_Expr_CreateStruct proto.InternalMessageInfo
  609. func (m *Expr_CreateStruct) GetType() string {
  610. if m != nil {
  611. return m.Type
  612. }
  613. return ""
  614. }
  615. func (m *Expr_CreateStruct) GetEntries() []*Expr_CreateStruct_Entry {
  616. if m != nil {
  617. return m.Entries
  618. }
  619. return nil
  620. }
  621. // Represents an entry.
  622. type Expr_CreateStruct_Entry struct {
  623. // Required. An id assigned to this node by the parser which is unique
  624. // in a given expression tree. This is used to associate type
  625. // information and other attributes to the node.
  626. Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
  627. // The `Entry` key kinds.
  628. //
  629. // Types that are valid to be assigned to KeyKind:
  630. // *Expr_CreateStruct_Entry_FieldKey
  631. // *Expr_CreateStruct_Entry_MapKey
  632. KeyKind isExpr_CreateStruct_Entry_KeyKind `protobuf_oneof:"key_kind"`
  633. // Required. The value assigned to the key.
  634. Value *Expr `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
  635. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  636. XXX_unrecognized []byte `json:"-"`
  637. XXX_sizecache int32 `json:"-"`
  638. }
  639. func (m *Expr_CreateStruct_Entry) Reset() { *m = Expr_CreateStruct_Entry{} }
  640. func (m *Expr_CreateStruct_Entry) String() string { return proto.CompactTextString(m) }
  641. func (*Expr_CreateStruct_Entry) ProtoMessage() {}
  642. func (*Expr_CreateStruct_Entry) Descriptor() ([]byte, []int) {
  643. return fileDescriptor_expr_18d50d0297e9a0ab, []int{1, 4, 0}
  644. }
  645. func (m *Expr_CreateStruct_Entry) XXX_Unmarshal(b []byte) error {
  646. return xxx_messageInfo_Expr_CreateStruct_Entry.Unmarshal(m, b)
  647. }
  648. func (m *Expr_CreateStruct_Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  649. return xxx_messageInfo_Expr_CreateStruct_Entry.Marshal(b, m, deterministic)
  650. }
  651. func (dst *Expr_CreateStruct_Entry) XXX_Merge(src proto.Message) {
  652. xxx_messageInfo_Expr_CreateStruct_Entry.Merge(dst, src)
  653. }
  654. func (m *Expr_CreateStruct_Entry) XXX_Size() int {
  655. return xxx_messageInfo_Expr_CreateStruct_Entry.Size(m)
  656. }
  657. func (m *Expr_CreateStruct_Entry) XXX_DiscardUnknown() {
  658. xxx_messageInfo_Expr_CreateStruct_Entry.DiscardUnknown(m)
  659. }
  660. var xxx_messageInfo_Expr_CreateStruct_Entry proto.InternalMessageInfo
  661. func (m *Expr_CreateStruct_Entry) GetId() int32 {
  662. if m != nil {
  663. return m.Id
  664. }
  665. return 0
  666. }
  667. type isExpr_CreateStruct_Entry_KeyKind interface {
  668. isExpr_CreateStruct_Entry_KeyKind()
  669. }
  670. type Expr_CreateStruct_Entry_FieldKey struct {
  671. FieldKey string `protobuf:"bytes,2,opt,name=field_key,json=fieldKey,proto3,oneof"`
  672. }
  673. type Expr_CreateStruct_Entry_MapKey struct {
  674. MapKey *Expr `protobuf:"bytes,3,opt,name=map_key,json=mapKey,proto3,oneof"`
  675. }
  676. func (*Expr_CreateStruct_Entry_FieldKey) isExpr_CreateStruct_Entry_KeyKind() {}
  677. func (*Expr_CreateStruct_Entry_MapKey) isExpr_CreateStruct_Entry_KeyKind() {}
  678. func (m *Expr_CreateStruct_Entry) GetKeyKind() isExpr_CreateStruct_Entry_KeyKind {
  679. if m != nil {
  680. return m.KeyKind
  681. }
  682. return nil
  683. }
  684. func (m *Expr_CreateStruct_Entry) GetFieldKey() string {
  685. if x, ok := m.GetKeyKind().(*Expr_CreateStruct_Entry_FieldKey); ok {
  686. return x.FieldKey
  687. }
  688. return ""
  689. }
  690. func (m *Expr_CreateStruct_Entry) GetMapKey() *Expr {
  691. if x, ok := m.GetKeyKind().(*Expr_CreateStruct_Entry_MapKey); ok {
  692. return x.MapKey
  693. }
  694. return nil
  695. }
  696. func (m *Expr_CreateStruct_Entry) GetValue() *Expr {
  697. if m != nil {
  698. return m.Value
  699. }
  700. return nil
  701. }
  702. // XXX_OneofFuncs is for the internal use of the proto package.
  703. func (*Expr_CreateStruct_Entry) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
  704. return _Expr_CreateStruct_Entry_OneofMarshaler, _Expr_CreateStruct_Entry_OneofUnmarshaler, _Expr_CreateStruct_Entry_OneofSizer, []interface{}{
  705. (*Expr_CreateStruct_Entry_FieldKey)(nil),
  706. (*Expr_CreateStruct_Entry_MapKey)(nil),
  707. }
  708. }
  709. func _Expr_CreateStruct_Entry_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  710. m := msg.(*Expr_CreateStruct_Entry)
  711. // key_kind
  712. switch x := m.KeyKind.(type) {
  713. case *Expr_CreateStruct_Entry_FieldKey:
  714. b.EncodeVarint(2<<3 | proto.WireBytes)
  715. b.EncodeStringBytes(x.FieldKey)
  716. case *Expr_CreateStruct_Entry_MapKey:
  717. b.EncodeVarint(3<<3 | proto.WireBytes)
  718. if err := b.EncodeMessage(x.MapKey); err != nil {
  719. return err
  720. }
  721. case nil:
  722. default:
  723. return fmt.Errorf("Expr_CreateStruct_Entry.KeyKind has unexpected type %T", x)
  724. }
  725. return nil
  726. }
  727. func _Expr_CreateStruct_Entry_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  728. m := msg.(*Expr_CreateStruct_Entry)
  729. switch tag {
  730. case 2: // key_kind.field_key
  731. if wire != proto.WireBytes {
  732. return true, proto.ErrInternalBadWireType
  733. }
  734. x, err := b.DecodeStringBytes()
  735. m.KeyKind = &Expr_CreateStruct_Entry_FieldKey{x}
  736. return true, err
  737. case 3: // key_kind.map_key
  738. if wire != proto.WireBytes {
  739. return true, proto.ErrInternalBadWireType
  740. }
  741. msg := new(Expr)
  742. err := b.DecodeMessage(msg)
  743. m.KeyKind = &Expr_CreateStruct_Entry_MapKey{msg}
  744. return true, err
  745. default:
  746. return false, nil
  747. }
  748. }
  749. func _Expr_CreateStruct_Entry_OneofSizer(msg proto.Message) (n int) {
  750. m := msg.(*Expr_CreateStruct_Entry)
  751. // key_kind
  752. switch x := m.KeyKind.(type) {
  753. case *Expr_CreateStruct_Entry_FieldKey:
  754. n += 1 // tag and wire
  755. n += proto.SizeVarint(uint64(len(x.FieldKey)))
  756. n += len(x.FieldKey)
  757. case *Expr_CreateStruct_Entry_MapKey:
  758. s := proto.Size(x.MapKey)
  759. n += 1 // tag and wire
  760. n += proto.SizeVarint(uint64(s))
  761. n += s
  762. case nil:
  763. default:
  764. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  765. }
  766. return n
  767. }
  768. // A comprehension expression applied to a list or map.
  769. //
  770. // Comprehensions are not part of the core syntax, but enabled with macros.
  771. // A macro matches a specific call signature within a parsed AST and replaces
  772. // the call with an alternate AST block. Macro expansion happens at parse
  773. // time.
  774. //
  775. // The following macros are supported within CEL:
  776. //
  777. // Aggregate type macros may be applied to all elements in a list or all keys
  778. // in a map:
  779. //
  780. // * `all`, `exists`, `exists_one` - test a predicate expression against
  781. // the inputs and return `true` if the predicate is satisfied for all,
  782. // any, or only one value `list.all(x, x < 10)`.
  783. // * `filter` - test a predicate expression against the inputs and return
  784. // the subset of elements which satisfy the predicate:
  785. // `payments.filter(p, p > 1000)`.
  786. // * `map` - apply an expression to all elements in the input and return the
  787. // output aggregate type: `[1, 2, 3].map(i, i * i)`.
  788. //
  789. // The `has(m.x)` macro tests whether the property `x` is present in struct
  790. // `m`. The semantics of this macro depend on the type of `m`. For proto2
  791. // messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the
  792. // macro tests whether the property is set to its default. For map and struct
  793. // types, the macro tests whether the property `x` is defined on `m`.
  794. type Expr_Comprehension struct {
  795. // The name of the iteration variable.
  796. IterVar string `protobuf:"bytes,1,opt,name=iter_var,json=iterVar,proto3" json:"iter_var,omitempty"`
  797. // The range over which var iterates.
  798. IterRange *Expr `protobuf:"bytes,2,opt,name=iter_range,json=iterRange,proto3" json:"iter_range,omitempty"`
  799. // The name of the variable used for accumulation of the result.
  800. AccuVar string `protobuf:"bytes,3,opt,name=accu_var,json=accuVar,proto3" json:"accu_var,omitempty"`
  801. // The initial value of the accumulator.
  802. AccuInit *Expr `protobuf:"bytes,4,opt,name=accu_init,json=accuInit,proto3" json:"accu_init,omitempty"`
  803. // An expression which can contain iter_var and accu_var.
  804. //
  805. // Returns false when the result has been computed and may be used as
  806. // a hint to short-circuit the remainder of the comprehension.
  807. LoopCondition *Expr `protobuf:"bytes,5,opt,name=loop_condition,json=loopCondition,proto3" json:"loop_condition,omitempty"`
  808. // An expression which can contain iter_var and accu_var.
  809. //
  810. // Computes the next value of accu_var.
  811. LoopStep *Expr `protobuf:"bytes,6,opt,name=loop_step,json=loopStep,proto3" json:"loop_step,omitempty"`
  812. // An expression which can contain accu_var.
  813. //
  814. // Computes the result.
  815. Result *Expr `protobuf:"bytes,7,opt,name=result,proto3" json:"result,omitempty"`
  816. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  817. XXX_unrecognized []byte `json:"-"`
  818. XXX_sizecache int32 `json:"-"`
  819. }
  820. func (m *Expr_Comprehension) Reset() { *m = Expr_Comprehension{} }
  821. func (m *Expr_Comprehension) String() string { return proto.CompactTextString(m) }
  822. func (*Expr_Comprehension) ProtoMessage() {}
  823. func (*Expr_Comprehension) Descriptor() ([]byte, []int) {
  824. return fileDescriptor_expr_18d50d0297e9a0ab, []int{1, 5}
  825. }
  826. func (m *Expr_Comprehension) XXX_Unmarshal(b []byte) error {
  827. return xxx_messageInfo_Expr_Comprehension.Unmarshal(m, b)
  828. }
  829. func (m *Expr_Comprehension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  830. return xxx_messageInfo_Expr_Comprehension.Marshal(b, m, deterministic)
  831. }
  832. func (dst *Expr_Comprehension) XXX_Merge(src proto.Message) {
  833. xxx_messageInfo_Expr_Comprehension.Merge(dst, src)
  834. }
  835. func (m *Expr_Comprehension) XXX_Size() int {
  836. return xxx_messageInfo_Expr_Comprehension.Size(m)
  837. }
  838. func (m *Expr_Comprehension) XXX_DiscardUnknown() {
  839. xxx_messageInfo_Expr_Comprehension.DiscardUnknown(m)
  840. }
  841. var xxx_messageInfo_Expr_Comprehension proto.InternalMessageInfo
  842. func (m *Expr_Comprehension) GetIterVar() string {
  843. if m != nil {
  844. return m.IterVar
  845. }
  846. return ""
  847. }
  848. func (m *Expr_Comprehension) GetIterRange() *Expr {
  849. if m != nil {
  850. return m.IterRange
  851. }
  852. return nil
  853. }
  854. func (m *Expr_Comprehension) GetAccuVar() string {
  855. if m != nil {
  856. return m.AccuVar
  857. }
  858. return ""
  859. }
  860. func (m *Expr_Comprehension) GetAccuInit() *Expr {
  861. if m != nil {
  862. return m.AccuInit
  863. }
  864. return nil
  865. }
  866. func (m *Expr_Comprehension) GetLoopCondition() *Expr {
  867. if m != nil {
  868. return m.LoopCondition
  869. }
  870. return nil
  871. }
  872. func (m *Expr_Comprehension) GetLoopStep() *Expr {
  873. if m != nil {
  874. return m.LoopStep
  875. }
  876. return nil
  877. }
  878. func (m *Expr_Comprehension) GetResult() *Expr {
  879. if m != nil {
  880. return m.Result
  881. }
  882. return nil
  883. }
  884. // Represents a primitive literal.
  885. //
  886. // This is similar to the primitives supported in the well-known type
  887. // `google.protobuf.Value`, but richer so it can represent CEL's full range of
  888. // primitives.
  889. //
  890. // Lists and structs are not included as constants as these aggregate types may
  891. // contain [Expr][google.api.expr.v1beta1.Expr] elements which require
  892. // evaluation and are thus not constant.
  893. //
  894. // Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`,
  895. // `true`, `null`.
  896. type Literal struct {
  897. // Required. The valid constant kinds.
  898. //
  899. // Types that are valid to be assigned to ConstantKind:
  900. // *Literal_NullValue
  901. // *Literal_BoolValue
  902. // *Literal_Int64Value
  903. // *Literal_Uint64Value
  904. // *Literal_DoubleValue
  905. // *Literal_StringValue
  906. // *Literal_BytesValue
  907. ConstantKind isLiteral_ConstantKind `protobuf_oneof:"constant_kind"`
  908. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  909. XXX_unrecognized []byte `json:"-"`
  910. XXX_sizecache int32 `json:"-"`
  911. }
  912. func (m *Literal) Reset() { *m = Literal{} }
  913. func (m *Literal) String() string { return proto.CompactTextString(m) }
  914. func (*Literal) ProtoMessage() {}
  915. func (*Literal) Descriptor() ([]byte, []int) {
  916. return fileDescriptor_expr_18d50d0297e9a0ab, []int{2}
  917. }
  918. func (m *Literal) XXX_Unmarshal(b []byte) error {
  919. return xxx_messageInfo_Literal.Unmarshal(m, b)
  920. }
  921. func (m *Literal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  922. return xxx_messageInfo_Literal.Marshal(b, m, deterministic)
  923. }
  924. func (dst *Literal) XXX_Merge(src proto.Message) {
  925. xxx_messageInfo_Literal.Merge(dst, src)
  926. }
  927. func (m *Literal) XXX_Size() int {
  928. return xxx_messageInfo_Literal.Size(m)
  929. }
  930. func (m *Literal) XXX_DiscardUnknown() {
  931. xxx_messageInfo_Literal.DiscardUnknown(m)
  932. }
  933. var xxx_messageInfo_Literal proto.InternalMessageInfo
  934. type isLiteral_ConstantKind interface {
  935. isLiteral_ConstantKind()
  936. }
  937. type Literal_NullValue struct {
  938. NullValue _struct.NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"`
  939. }
  940. type Literal_BoolValue struct {
  941. BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"`
  942. }
  943. type Literal_Int64Value struct {
  944. Int64Value int64 `protobuf:"varint,3,opt,name=int64_value,json=int64Value,proto3,oneof"`
  945. }
  946. type Literal_Uint64Value struct {
  947. Uint64Value uint64 `protobuf:"varint,4,opt,name=uint64_value,json=uint64Value,proto3,oneof"`
  948. }
  949. type Literal_DoubleValue struct {
  950. DoubleValue float64 `protobuf:"fixed64,5,opt,name=double_value,json=doubleValue,proto3,oneof"`
  951. }
  952. type Literal_StringValue struct {
  953. StringValue string `protobuf:"bytes,6,opt,name=string_value,json=stringValue,proto3,oneof"`
  954. }
  955. type Literal_BytesValue struct {
  956. BytesValue []byte `protobuf:"bytes,7,opt,name=bytes_value,json=bytesValue,proto3,oneof"`
  957. }
  958. func (*Literal_NullValue) isLiteral_ConstantKind() {}
  959. func (*Literal_BoolValue) isLiteral_ConstantKind() {}
  960. func (*Literal_Int64Value) isLiteral_ConstantKind() {}
  961. func (*Literal_Uint64Value) isLiteral_ConstantKind() {}
  962. func (*Literal_DoubleValue) isLiteral_ConstantKind() {}
  963. func (*Literal_StringValue) isLiteral_ConstantKind() {}
  964. func (*Literal_BytesValue) isLiteral_ConstantKind() {}
  965. func (m *Literal) GetConstantKind() isLiteral_ConstantKind {
  966. if m != nil {
  967. return m.ConstantKind
  968. }
  969. return nil
  970. }
  971. func (m *Literal) GetNullValue() _struct.NullValue {
  972. if x, ok := m.GetConstantKind().(*Literal_NullValue); ok {
  973. return x.NullValue
  974. }
  975. return _struct.NullValue_NULL_VALUE
  976. }
  977. func (m *Literal) GetBoolValue() bool {
  978. if x, ok := m.GetConstantKind().(*Literal_BoolValue); ok {
  979. return x.BoolValue
  980. }
  981. return false
  982. }
  983. func (m *Literal) GetInt64Value() int64 {
  984. if x, ok := m.GetConstantKind().(*Literal_Int64Value); ok {
  985. return x.Int64Value
  986. }
  987. return 0
  988. }
  989. func (m *Literal) GetUint64Value() uint64 {
  990. if x, ok := m.GetConstantKind().(*Literal_Uint64Value); ok {
  991. return x.Uint64Value
  992. }
  993. return 0
  994. }
  995. func (m *Literal) GetDoubleValue() float64 {
  996. if x, ok := m.GetConstantKind().(*Literal_DoubleValue); ok {
  997. return x.DoubleValue
  998. }
  999. return 0
  1000. }
  1001. func (m *Literal) GetStringValue() string {
  1002. if x, ok := m.GetConstantKind().(*Literal_StringValue); ok {
  1003. return x.StringValue
  1004. }
  1005. return ""
  1006. }
  1007. func (m *Literal) GetBytesValue() []byte {
  1008. if x, ok := m.GetConstantKind().(*Literal_BytesValue); ok {
  1009. return x.BytesValue
  1010. }
  1011. return nil
  1012. }
  1013. // XXX_OneofFuncs is for the internal use of the proto package.
  1014. func (*Literal) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
  1015. return _Literal_OneofMarshaler, _Literal_OneofUnmarshaler, _Literal_OneofSizer, []interface{}{
  1016. (*Literal_NullValue)(nil),
  1017. (*Literal_BoolValue)(nil),
  1018. (*Literal_Int64Value)(nil),
  1019. (*Literal_Uint64Value)(nil),
  1020. (*Literal_DoubleValue)(nil),
  1021. (*Literal_StringValue)(nil),
  1022. (*Literal_BytesValue)(nil),
  1023. }
  1024. }
  1025. func _Literal_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  1026. m := msg.(*Literal)
  1027. // constant_kind
  1028. switch x := m.ConstantKind.(type) {
  1029. case *Literal_NullValue:
  1030. b.EncodeVarint(1<<3 | proto.WireVarint)
  1031. b.EncodeVarint(uint64(x.NullValue))
  1032. case *Literal_BoolValue:
  1033. t := uint64(0)
  1034. if x.BoolValue {
  1035. t = 1
  1036. }
  1037. b.EncodeVarint(2<<3 | proto.WireVarint)
  1038. b.EncodeVarint(t)
  1039. case *Literal_Int64Value:
  1040. b.EncodeVarint(3<<3 | proto.WireVarint)
  1041. b.EncodeVarint(uint64(x.Int64Value))
  1042. case *Literal_Uint64Value:
  1043. b.EncodeVarint(4<<3 | proto.WireVarint)
  1044. b.EncodeVarint(uint64(x.Uint64Value))
  1045. case *Literal_DoubleValue:
  1046. b.EncodeVarint(5<<3 | proto.WireFixed64)
  1047. b.EncodeFixed64(math.Float64bits(x.DoubleValue))
  1048. case *Literal_StringValue:
  1049. b.EncodeVarint(6<<3 | proto.WireBytes)
  1050. b.EncodeStringBytes(x.StringValue)
  1051. case *Literal_BytesValue:
  1052. b.EncodeVarint(7<<3 | proto.WireBytes)
  1053. b.EncodeRawBytes(x.BytesValue)
  1054. case nil:
  1055. default:
  1056. return fmt.Errorf("Literal.ConstantKind has unexpected type %T", x)
  1057. }
  1058. return nil
  1059. }
  1060. func _Literal_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  1061. m := msg.(*Literal)
  1062. switch tag {
  1063. case 1: // constant_kind.null_value
  1064. if wire != proto.WireVarint {
  1065. return true, proto.ErrInternalBadWireType
  1066. }
  1067. x, err := b.DecodeVarint()
  1068. m.ConstantKind = &Literal_NullValue{_struct.NullValue(x)}
  1069. return true, err
  1070. case 2: // constant_kind.bool_value
  1071. if wire != proto.WireVarint {
  1072. return true, proto.ErrInternalBadWireType
  1073. }
  1074. x, err := b.DecodeVarint()
  1075. m.ConstantKind = &Literal_BoolValue{x != 0}
  1076. return true, err
  1077. case 3: // constant_kind.int64_value
  1078. if wire != proto.WireVarint {
  1079. return true, proto.ErrInternalBadWireType
  1080. }
  1081. x, err := b.DecodeVarint()
  1082. m.ConstantKind = &Literal_Int64Value{int64(x)}
  1083. return true, err
  1084. case 4: // constant_kind.uint64_value
  1085. if wire != proto.WireVarint {
  1086. return true, proto.ErrInternalBadWireType
  1087. }
  1088. x, err := b.DecodeVarint()
  1089. m.ConstantKind = &Literal_Uint64Value{x}
  1090. return true, err
  1091. case 5: // constant_kind.double_value
  1092. if wire != proto.WireFixed64 {
  1093. return true, proto.ErrInternalBadWireType
  1094. }
  1095. x, err := b.DecodeFixed64()
  1096. m.ConstantKind = &Literal_DoubleValue{math.Float64frombits(x)}
  1097. return true, err
  1098. case 6: // constant_kind.string_value
  1099. if wire != proto.WireBytes {
  1100. return true, proto.ErrInternalBadWireType
  1101. }
  1102. x, err := b.DecodeStringBytes()
  1103. m.ConstantKind = &Literal_StringValue{x}
  1104. return true, err
  1105. case 7: // constant_kind.bytes_value
  1106. if wire != proto.WireBytes {
  1107. return true, proto.ErrInternalBadWireType
  1108. }
  1109. x, err := b.DecodeRawBytes(true)
  1110. m.ConstantKind = &Literal_BytesValue{x}
  1111. return true, err
  1112. default:
  1113. return false, nil
  1114. }
  1115. }
  1116. func _Literal_OneofSizer(msg proto.Message) (n int) {
  1117. m := msg.(*Literal)
  1118. // constant_kind
  1119. switch x := m.ConstantKind.(type) {
  1120. case *Literal_NullValue:
  1121. n += 1 // tag and wire
  1122. n += proto.SizeVarint(uint64(x.NullValue))
  1123. case *Literal_BoolValue:
  1124. n += 1 // tag and wire
  1125. n += 1
  1126. case *Literal_Int64Value:
  1127. n += 1 // tag and wire
  1128. n += proto.SizeVarint(uint64(x.Int64Value))
  1129. case *Literal_Uint64Value:
  1130. n += 1 // tag and wire
  1131. n += proto.SizeVarint(uint64(x.Uint64Value))
  1132. case *Literal_DoubleValue:
  1133. n += 1 // tag and wire
  1134. n += 8
  1135. case *Literal_StringValue:
  1136. n += 1 // tag and wire
  1137. n += proto.SizeVarint(uint64(len(x.StringValue)))
  1138. n += len(x.StringValue)
  1139. case *Literal_BytesValue:
  1140. n += 1 // tag and wire
  1141. n += proto.SizeVarint(uint64(len(x.BytesValue)))
  1142. n += len(x.BytesValue)
  1143. case nil:
  1144. default:
  1145. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  1146. }
  1147. return n
  1148. }
  1149. func init() {
  1150. proto.RegisterType((*ParsedExpr)(nil), "google.api.expr.v1beta1.ParsedExpr")
  1151. proto.RegisterType((*Expr)(nil), "google.api.expr.v1beta1.Expr")
  1152. proto.RegisterType((*Expr_Ident)(nil), "google.api.expr.v1beta1.Expr.Ident")
  1153. proto.RegisterType((*Expr_Select)(nil), "google.api.expr.v1beta1.Expr.Select")
  1154. proto.RegisterType((*Expr_Call)(nil), "google.api.expr.v1beta1.Expr.Call")
  1155. proto.RegisterType((*Expr_CreateList)(nil), "google.api.expr.v1beta1.Expr.CreateList")
  1156. proto.RegisterType((*Expr_CreateStruct)(nil), "google.api.expr.v1beta1.Expr.CreateStruct")
  1157. proto.RegisterType((*Expr_CreateStruct_Entry)(nil), "google.api.expr.v1beta1.Expr.CreateStruct.Entry")
  1158. proto.RegisterType((*Expr_Comprehension)(nil), "google.api.expr.v1beta1.Expr.Comprehension")
  1159. proto.RegisterType((*Literal)(nil), "google.api.expr.v1beta1.Literal")
  1160. }
  1161. func init() {
  1162. proto.RegisterFile("google/api/expr/v1beta1/expr.proto", fileDescriptor_expr_18d50d0297e9a0ab)
  1163. }
  1164. var fileDescriptor_expr_18d50d0297e9a0ab = []byte{
  1165. // 936 bytes of a gzipped FileDescriptorProto
  1166. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x96, 0x6f, 0x6f, 0x23, 0xb5,
  1167. 0x13, 0xc7, 0xbb, 0xf9, 0xbb, 0x3b, 0x69, 0xfb, 0xd3, 0xcf, 0x42, 0x22, 0x6c, 0x39, 0x51, 0x7a,
  1168. 0x87, 0x54, 0x81, 0x94, 0xd0, 0x3b, 0xfe, 0x97, 0x27, 0xf4, 0xae, 0xba, 0x14, 0x0e, 0xa8, 0xb6,
  1169. 0x52, 0x1f, 0x20, 0xa4, 0xc8, 0xd9, 0x38, 0x8b, 0xa9, 0x63, 0xaf, 0xbc, 0xde, 0xaa, 0x79, 0x0f,
  1170. 0xbc, 0x0a, 0x1e, 0xc3, 0x03, 0x5e, 0x00, 0xef, 0xeb, 0x1e, 0xa2, 0x19, 0x3b, 0xa1, 0x15, 0xca,
  1171. 0x25, 0xcf, 0xd6, 0xe3, 0xcf, 0x7c, 0x3d, 0x9e, 0x19, 0x4f, 0x02, 0x47, 0x85, 0x31, 0x85, 0x12,
  1172. 0x43, 0x5e, 0xca, 0xa1, 0xb8, 0x2b, 0xed, 0xf0, 0xf6, 0x64, 0x22, 0x1c, 0x3f, 0xa1, 0xc5, 0xa0,
  1173. 0xb4, 0xc6, 0x19, 0xf6, 0xb6, 0x67, 0x06, 0xbc, 0x94, 0x03, 0x32, 0x07, 0x26, 0x7d, 0xb2, 0xce,
  1174. 0xb9, 0x32, 0xb5, 0xcd, 0x85, 0x77, 0x4f, 0xdf, 0x0d, 0x14, 0xad, 0x26, 0xf5, 0x6c, 0x58, 0x39,
  1175. 0x5b, 0xe7, 0xce, 0xef, 0x1e, 0xfd, 0x11, 0x01, 0x5c, 0x72, 0x5b, 0x89, 0xe9, 0xf9, 0x5d, 0x69,
  1176. 0xd9, 0x09, 0xb4, 0x50, 0xa9, 0xdf, 0x38, 0x8c, 0x8e, 0x7b, 0x4f, 0x1f, 0x0d, 0xd6, 0x1c, 0x3d,
  1177. 0x40, 0x38, 0x23, 0x94, 0xbd, 0x80, 0x9e, 0x3f, 0x6f, 0x2c, 0xf5, 0xcc, 0xf4, 0x9b, 0xe4, 0xf9,
  1178. 0x78, 0xad, 0xe7, 0x15, 0xb1, 0x17, 0x7a, 0x66, 0x32, 0xa8, 0x56, 0xdf, 0xec, 0x03, 0xd8, 0xaf,
  1179. 0x16, 0xda, 0xf1, 0xbb, 0xf1, 0xad, 0xb0, 0x95, 0x34, 0xba, 0xdf, 0x3a, 0x8c, 0x8e, 0x93, 0x6c,
  1180. 0xcf, 0x5b, 0xaf, 0xbd, 0xf1, 0xe8, 0xef, 0x5d, 0x68, 0x51, 0xa0, 0xfb, 0xd0, 0x90, 0x53, 0x0a,
  1181. 0xb3, 0x9d, 0x35, 0xe4, 0x94, 0x9d, 0xc3, 0xae, 0x92, 0x4e, 0x58, 0xae, 0xc6, 0x74, 0x01, 0x1f,
  1182. 0xc6, 0xe1, 0xda, 0x30, 0x5e, 0x79, 0x78, 0xb4, 0x93, 0xf5, 0x82, 0xdf, 0xb9, 0xbf, 0x0c, 0xc8,
  1183. 0xa9, 0xd0, 0xce, 0x8b, 0xb4, 0x36, 0xdc, 0x05, 0x5d, 0x06, 0x17, 0xc8, 0x8f, 0x76, 0xb2, 0x84,
  1184. 0x1c, 0x49, 0xe5, 0x25, 0xf4, 0x2a, 0xa1, 0x44, 0x1e, 0x64, 0xda, 0x24, 0xf3, 0xe4, 0xcd, 0x32,
  1185. 0x57, 0xe4, 0x30, 0xda, 0xc9, 0xc0, 0xbb, 0x92, 0xd0, 0x37, 0x90, 0xe4, 0x5c, 0x85, 0x2b, 0x75,
  1186. 0x48, 0xe6, 0xe8, 0xcd, 0x32, 0xcf, 0xb9, 0xc2, 0x4b, 0xc5, 0xe8, 0x16, 0x62, 0x49, 0x94, 0xac,
  1187. 0x42, 0x24, 0x5d, 0x92, 0x38, 0xde, 0x20, 0x61, 0x05, 0x77, 0xe2, 0x95, 0xac, 0x30, 0x9a, 0x18,
  1188. 0x9d, 0x49, 0xe8, 0x7b, 0xe8, 0xf9, 0xce, 0xf1, 0x52, 0x31, 0x49, 0x7d, 0xb8, 0x8d, 0xd4, 0x15,
  1189. 0xb9, 0xd1, 0xd5, 0xe8, 0x8b, 0xe4, 0x7e, 0x06, 0x96, 0x9b, 0x79, 0x69, 0xc5, 0x2f, 0x42, 0x63,
  1190. 0x69, 0xbd, 0x6a, 0x42, 0xaa, 0x1f, 0x6d, 0x50, 0xbd, 0xef, 0x37, 0xda, 0xc9, 0xfe, 0xff, 0x40,
  1191. 0x08, 0x91, 0xf4, 0x00, 0xda, 0x54, 0x17, 0xc6, 0xa0, 0xa5, 0xf9, 0x5c, 0xf4, 0x23, 0xea, 0x26,
  1192. 0xfa, 0x4e, 0x1d, 0x74, 0x7c, 0xb6, 0xd9, 0xe7, 0xd0, 0x35, 0xa5, 0xb0, 0x5c, 0x4f, 0x09, 0xd8,
  1193. 0xd8, 0xf1, 0x4b, 0x9a, 0xbd, 0x05, 0xed, 0x99, 0x14, 0xca, 0x77, 0x60, 0x92, 0xf9, 0x05, 0x3b,
  1194. 0x80, 0xc4, 0x89, 0xca, 0x8d, 0x8d, 0x56, 0x0b, 0xea, 0xc0, 0x38, 0x8b, 0xd1, 0xf0, 0xa3, 0x56,
  1195. 0x8b, 0xf4, 0xb7, 0x08, 0x5a, 0x58, 0x1d, 0xf6, 0x29, 0x74, 0x1c, 0xb7, 0x85, 0x70, 0xdb, 0x9d,
  1196. 0x19, 0x60, 0x96, 0x42, 0x3c, 0xab, 0x75, 0xee, 0xf0, 0x6d, 0xf8, 0x53, 0x57, 0x6b, 0x7c, 0xb6,
  1197. 0xdc, 0x16, 0x55, 0xbf, 0x79, 0xd8, 0xdc, 0xe2, 0xd9, 0x22, 0x9a, 0xbe, 0x04, 0xf8, 0xb7, 0xd0,
  1198. 0xec, 0x4b, 0x88, 0x85, 0x12, 0x73, 0xa1, 0x5d, 0xd5, 0x8f, 0xb6, 0x11, 0x59, 0xe1, 0xe9, 0xef,
  1199. 0x0d, 0xd8, 0xbd, 0x5f, 0x67, 0x4c, 0xb9, 0x5b, 0x94, 0xab, 0x94, 0xe3, 0x37, 0xfb, 0x16, 0xba,
  1200. 0x42, 0x3b, 0x2b, 0x45, 0xd5, 0x6f, 0x90, 0xfc, 0xc7, 0xdb, 0x37, 0xce, 0xe0, 0x5c, 0x3b, 0xbb,
  1201. 0xc8, 0x96, 0x02, 0xe9, 0x5f, 0x11, 0xb4, 0xc9, 0x14, 0x86, 0x40, 0xb4, 0x1a, 0x02, 0x8f, 0x20,
  1202. 0xa1, 0x42, 0x8c, 0x6f, 0xc4, 0xc2, 0xe7, 0x08, 0x3b, 0x98, 0x4c, 0xdf, 0x89, 0x05, 0xfb, 0x02,
  1203. 0xba, 0x73, 0x5e, 0xd2, 0x66, 0x73, 0x8b, 0xcc, 0x8f, 0x76, 0xb2, 0xce, 0x9c, 0x97, 0xe8, 0xf9,
  1204. 0x0c, 0xda, 0xb7, 0x5c, 0xd5, 0x22, 0x4c, 0x84, 0x0d, 0xb9, 0xf1, 0xec, 0x19, 0x40, 0x7c, 0x23,
  1205. 0x16, 0xe3, 0x1b, 0xa9, 0xa7, 0xe9, 0xeb, 0x06, 0xec, 0x3d, 0x68, 0x5b, 0xf6, 0x0e, 0xc4, 0x38,
  1206. 0x77, 0xc6, 0xb7, 0xdc, 0x86, 0x4c, 0x75, 0x71, 0x7d, 0xcd, 0x2d, 0xfb, 0x1a, 0x80, 0xb6, 0x2c,
  1207. 0xd7, 0x85, 0xd8, 0x6e, 0x14, 0x27, 0xe8, 0x90, 0x21, 0x8f, 0xc2, 0x3c, 0xcf, 0x6b, 0x12, 0x6e,
  1208. 0x7a, 0x61, 0x5c, 0xa3, 0xf0, 0x57, 0x90, 0xd0, 0x96, 0xd4, 0xd2, 0x6d, 0x77, 0x15, 0x92, 0xba,
  1209. 0xd0, 0xd2, 0xb1, 0x17, 0xb0, 0xaf, 0x8c, 0x29, 0xc7, 0xb9, 0xd1, 0x53, 0x49, 0x4d, 0xd8, 0xde,
  1210. 0x46, 0x60, 0x0f, 0x9d, 0x9e, 0x2f, 0x7d, 0x30, 0x02, 0x52, 0xa9, 0x9c, 0x28, 0xc3, 0x40, 0xdb,
  1211. 0x14, 0x01, 0xf2, 0x57, 0x4e, 0x94, 0xf8, 0x6e, 0xac, 0xa8, 0x6a, 0xe5, 0xc2, 0x18, 0xdb, 0xf4,
  1212. 0x6e, 0x3c, 0x7c, 0xd6, 0x83, 0x04, 0x37, 0xa9, 0x0e, 0x47, 0x7f, 0x36, 0xa0, 0x1b, 0x46, 0x3f,
  1213. 0x3b, 0x05, 0xd0, 0xb5, 0x52, 0x63, 0x5f, 0x59, 0xac, 0xc1, 0xfe, 0xd3, 0x74, 0xa9, 0xb9, 0xfc,
  1214. 0xb5, 0x1c, 0xfc, 0x50, 0x2b, 0x75, 0x8d, 0x04, 0x8e, 0x78, 0xbd, 0x5c, 0xb0, 0xf7, 0x00, 0x26,
  1215. 0xc6, 0x2c, 0x9d, 0xb1, 0x46, 0x31, 0x02, 0x68, 0xf3, 0xc0, 0xfb, 0xd0, 0x93, 0xda, 0x7d, 0xf6,
  1216. 0x49, 0x20, 0xb0, 0x12, 0x4d, 0x1c, 0x81, 0x64, 0xf4, 0xc8, 0x63, 0xd8, 0xad, 0xef, 0x33, 0x58,
  1217. 0x91, 0x16, 0xfe, 0x22, 0xd5, 0x0f, 0xa1, 0xa9, 0xa9, 0x27, 0x4a, 0x04, 0x08, 0xb3, 0x1e, 0x21,
  1218. 0xe4, 0xad, 0x2b, 0xa8, 0x72, 0x56, 0xea, 0x22, 0x40, 0x9d, 0xd0, 0xfb, 0x3d, 0x6f, 0x5d, 0x45,
  1219. 0x34, 0x59, 0x38, 0x51, 0x05, 0x06, 0x93, 0xb8, 0x8b, 0x11, 0x91, 0x91, 0x90, 0xb3, 0xff, 0xc1,
  1220. 0x5e, 0x6e, 0x74, 0xe5, 0xb8, 0x76, 0x94, 0xaf, 0xb3, 0x5f, 0xe1, 0x20, 0x37, 0xf3, 0x75, 0x89,
  1221. 0x3e, 0x4b, 0x30, 0xd3, 0x97, 0x98, 0xaa, 0xcb, 0xe8, 0xa7, 0xd3, 0x40, 0x15, 0x46, 0x71, 0x5d,
  1222. 0x0c, 0x8c, 0x2d, 0x86, 0x85, 0xd0, 0x94, 0xc8, 0xa1, 0xdf, 0xe2, 0xa5, 0xac, 0xfe, 0xf3, 0x6f,
  1223. 0xe5, 0x14, 0x17, 0xaf, 0xa3, 0x68, 0xd2, 0x21, 0xf4, 0xd9, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff,
  1224. 0xcb, 0xa2, 0x13, 0x9a, 0x14, 0x09, 0x00, 0x00,
  1225. }